Skip to content

Commit 3efd2f5

Browse files
authored
Merge pull request #12 from etoensfeldt/feature/1.0.3/#329665
Feature/1.0.3/#329665 Fix issues #9 #10 #11
2 parents 256c65c + f0ab697 commit 3efd2f5

File tree

4 files changed

+38
-18
lines changed

4 files changed

+38
-18
lines changed

README.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<br />
77
<h1 align="center">OPC Router Helm Chart</h1>
88
<p align="center">
9-
OPC Router Helm Chart for the deployment of the opc router in a kubernetes cluster.
9+
OPC Router Helm Chart for the deployment of the OPC Router in a kubernetes cluster.
1010
<br />
1111
<a href="https://opc-router.com/?utm_source=GitHub&utm_medium=HelmChart&utm_campaign=OpcRouterChart"><strong>OPC Router</strong></a>
1212
-
@@ -30,8 +30,10 @@
3030
- [**Parameters**](#parameters)
3131
- [**Global parameters**](#global-parameters)
3232
- [**Common parameters**](#common-parameters)
33-
- [**OPCRouter parameters**](#opcrouter-parameters)
33+
- [**OPC Router parameters**](#opc-router-parameters)
3434
- [**WARNING: MongoDB root password and replica key set**](#warning-mongodb-root-password-and-replica-key-set)
35+
- [**Using the `opcrouter/runtime` image**](#using-the-opcrouterruntime-image)
36+
- [**Using Ingress or reverse proxies**](#using-ingress-or-reverse-proxies)
3537
- [**Redundancy mode**](#redundancy-mode)
3638
- [**OPC Router redudancy mode**](#opc-router-redudancy-mode)
3739
- [**MongoDB redundancy mode**](#mongodb-redundancy-mode)
@@ -41,8 +43,8 @@
4143
## General Information
4244

4345
### **What is the helm chart doing?**
44-
- This helm chart will allow deploying the opc router onto any kubernetes cluster.
45-
- There are multiple possible configurations to deploy the opc router this chart allows.
46+
- This helm chart will allow deploying the OPC Router onto any kubernetes cluster.
47+
- There are multiple possible configurations to deploy the OPC Router this chart allows.
4648

4749
# Getting Started
4850

@@ -67,7 +69,7 @@ To install the chart with the name `my-opcrouter`:
6769
helm install my-opcrouter opc-router/opc-router \
6870
--set I_do_accept_the_EULA=true
6971
```
70-
This command will install the opc router with standard settings, as a service with a seperate mongodb container. The mongodb won't require authentification, which is not recommended. Accepting the [End User License Agreement](https://www.opc-router.com/terms-of-use-and-eula/) by setting `I_do_accept_the_EULA` to true is required for the OPCRouter to run.
72+
This command will install the OPC Router with standard settings, as a service with a seperate mongodb container. The mongodb won't require authentification, which is not recommended. Accepting the [End User License Agreement](https://www.opc-router.com/terms-of-use-and-eula/) by setting `I_do_accept_the_EULA` to true is required for the OPC Router to run.
7173

7274
To deploy this chart with password authentification for the web management and for the mongodb use this command:
7375
```shell
@@ -109,15 +111,15 @@ However, keep in mind that the persitant volumes of the mongodb container don't
109111
| `nameOverride` | String to partially override opc-router.fullname template (will maintain the release name) | `""` |
110112
| `fullnameOverride` | String to fully override opc-router.fullname template | `""` |
111113

112-
### **OPCRouter parameters**
114+
### **OPC Router parameters**
113115

114116
| Name | Description | Default value |
115117
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------- |
116-
| `I_do_accept_the_EULA` | If this is false the opc router container won't be able to run. | `false` |
118+
| `I_do_accept_the_EULA` | If this is false the OPC Router container won't be able to run. | `false` |
117119
| `image.repository` | OPC-Router image registry. | `opcrouter/service` |
118120
| `image.tag` | OPC-Router image tag (immutable tags are recommended). | `""` |
119121
| `image.pullPolicy` | OPC-Router image pull policy. | `IfNotPresent` |
120-
| `envVars` | Array of environment variables for the opc router container. | `[]` |
122+
| `envVars` | Array of environment variables for the OPC Router container. | `[]` |
121123
| `serviceAccount.create` | Specifies whether a service account should be created. | `true` |
122124
| `serviceAccount.annotations` | Annotations to add to the service account. | `{}` |
123125
| `serviceAccount.name` | Name of the service account to use. If not set and create is true, it is generated using the fullname. | `""` |
@@ -149,23 +151,39 @@ However, keep in mind that the persitant volumes of the mongodb container don't
149151

150152
## **WARNING: MongoDB root password and replica key set**
151153

152-
When using the mongodb container, keep in mind that that the root password and replica key set can only be set once, as upon initial declaration they are stored in a persistent volume. This may be an issue when using automatically deploying the chart using ArgoCD or Flux, as automatic redeployments can cause the root password to be regenerated when not having set static values for them in the values.yaml. This however will only make the database inaccessible to the opc router, as it will use the new passwords, though the mongodb still uses the old initial passwords. Thus it is highly recommended to set mongodb.auth.existingSecret or mongodb.auth.rootPassword and mongodb.auth.replicaSetKey when not manually deploying the chart for testing purposes.
154+
When using the mongodb container, keep in mind that that the root password and replica key set can only be set once, as upon initial declaration they are stored in a persistent volume. This may be an issue when using automatically deploying the chart using ArgoCD or Flux, as automatic redeployments can cause the root password to be regenerated when not having set static values for them in the values.yaml. This however will only make the database inaccessible to the OPC Router, as it will use the new passwords, though the mongodb still uses the old initial passwords. Thus it is highly recommended to set `mongodb.auth.existingSecret` or `mongodb.auth.rootPassword` and `mongodb.auth.replicaSetKey` when not manually deploying the chart for testing purposes.
155+
156+
## **Using the `opcrouter/runtime` image**
157+
158+
By default, the helm chart is configured to use the `opcrouter/service` image, which doesn't include an internal mongodb. The mongodb is then instead also installed sperately by the helm chart.
159+
160+
It is possible to configure the helm chart to use the `opcrouter/runtime` image, which comes with an internal mongodb inside the OPC Router container, by setting `global.imageRegistry` to it. Therefore it is recommended to disable to deployment of the external mongodb, by setting `mongodb.deploy` to `false`, otherwise the internal mongodb will be created and running, but will not be used by the OPC Router.
161+
162+
Furthermore it is also strongly recommended to increase the capacity of the inray volume (`claims.inray.capacity`), as the data of the internal mongodb is stored there, when using the internal mongodb. At minimum it should be set to 2gb, it is however recommended to set it to 8gb.
163+
164+
## **Using Ingress or reverse proxies**
165+
166+
The rerouting of the traffic for to the OPC Router web management may require some extra configuration. Generally, when some form of reverse proxy is being used, the `ASPNETCORE_FORWARDEDHEADERS_ENABLED` environment variable needs to be set to `true`. When `ingress.enabled` is set to `true` this is already automatically done.
167+
168+
In some configurations it is desirable to change the base path for the OPC Router web management. This always requires setting the `WEB_BASE_PATH` environment variable to the new base path for the OPC Router web management to properly function.
169+
170+
For configuring environment variables, refer to [Adding extra environment variables](#adding-extra-environment-variables).
153171

154172
## **Redundancy mode**
155-
The opc router and mongodb deployed by the chart can both be configured to run in redundancy mode, offering increased protection against hardware failures.
173+
The OPC Router and mongodb deployed by the chart can both be configured to run in redundancy mode, offering increased protection against hardware failures.
156174

157175
### **OPC Router redudancy mode**
158-
Setting the opc router into redundancy mode will cause a second pod with a opc router runtime container to be deployed. This container will load the same project as the main container, but will remain dorment until the main container is unreachable.
176+
Setting the OPC Router into redundancy mode will cause a second pod with a OPC Router runtime container to be deployed. This container will load the same project as the main container, but will remain dorment until the main container is unreachable.
159177

160-
The redundancy mode for the opc router is currently not availible and will be enabled at a later date.
178+
The redundancy mode for the OPC Router is currently not availible and will be enabled at a later date.
161179

162180
### **MongoDB redundancy mode**
163181
By setting the replica count of the mongodb above one, additional pods running the mongodb containers are created. These mongodb containers will connect and copy the primary container, but aren't accessible themself. When the primary container becomes unreachable, a new primary container will be elected, taking its place.
164182

165183
Keep in mind that currently when the primary mongodb changes, external connection to the application can get lost until the original primary pod is again the primary pod.
166184

167185
## **Loading a project from a git repository**
168-
Please refer to [this sample project](https://github.com/OPC-Router/helm-sample-project) on general information of how to deploy a opc router project from a git repository onto a kubernetes cluster using this helm chart.
186+
Please refer to [this sample project](https://github.com/OPC-Router/helm-sample-project) on general information of how to deploy a OPC Router project from a git repository onto a kubernetes cluster using this helm chart.
169187

170188
## **Adding extra environment variables**
171189

charts/opc-router/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.0.2
18+
version: 1.0.3
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/opc-router/templates/deployment.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ spec:
2020
labels:
2121
{{- include "opc-router.labels" . | nindent 8 }}
2222
{{- include "opc-router.originalSelectorLabels" . | nindent 8 }}
23-
{{- if eq .Values.image.repository "opcrouter/runtime" }}
2423
{{- if not .Values.mongodb.deploy }}
2524
{{- include "opc-router.selectorLabels" . | nindent 8 }}
2625
{{- end }}
27-
{{- end }}
2826
spec:
2927
{{- with .Values.imagePullSecrets }}
3028
imagePullSecrets:
@@ -49,13 +47,11 @@ spec:
4947
protocol: TCP
5048
name: web-management
5149
{{- end }}
52-
{{- if eq .Values.image.repository "opcrouter/runtime" }}
5350
{{- if not .Values.mongodb.deploy }}
5451
- name: mongodb
5552
containerPort: 27017
5653
protocol: TCP
5754
{{- end }}
58-
{{- end }}
5955
# Environment variables for the opcrouter container
6056
env:
6157
# Variables for connecting a service to the mongodb if a service is specified
@@ -102,6 +98,10 @@ spec:
10298
- name: OR_IMPORT_RUNTIME_CONFIGURATION_FILE
10399
value: "/data/project/{{ .Values.project.configPath }}"
104100
{{- end }}
101+
{{- if .Values.ingress.enabled }}
102+
- name: ASPNETCORE_FORWARDEDHEADERS_ENABLED
103+
value: "true"
104+
{{- end }}
105105
- name: OR_I_ACCEPT_EULA
106106
value: {{ .Values.I_do_accept_the_EULA | quote }}
107107
# Loading environment variables specified in the values file

charts/opc-router/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ image:
66
# Image for the opc router container
77
# Has to be either "opcrouter/runtime" for the integrated database
88
# or "opcrouter/service", which utilizes the external mongodb
9+
# If using an image which uses an integrated mongodb like opcrouter/runtime,
10+
# it is required to set 'mongodb.deploy' to 'false' for the integrated mongodb to be used
911
repository: opcrouter/service
1012
pullPolicy: IfNotPresent
1113
# Overrides the image tag whose default is the chart appVersion.

0 commit comments

Comments
 (0)