Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include replicaset name when enabled by user from values file #280

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions charts/iotagent-json/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ data:
*/
protocol: '{{ .Values.mqtt.broker.protocol }}',

{{- if .Values.mqtt.broker.auth -}}
/**
* User name for the IoTAgent in the MQTT broker, if authentication is activated.
*/
username: '{{ .Values.mqtt.broker.auth.username }}',

/**
* Password for the IoTAgent in the MQTT broker, if authentication is activated.
*/
password: '{{ .Values.mqtt.broker.auth.password }}',
{{- end }}
/**
* Set to `false` if using a self-signed certificate.
* Beware that you are exposing yourself to man in the middle attacks
Expand Down
9 changes: 9 additions & 0 deletions charts/iotagent-json/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ spec:
successThreshold: {{ .Values.deployment.readinessProbe.successThreshold }}
timeoutSeconds: {{ .Values.deployment.readinessProbe.timeoutSeconds }}
env:
{{- if .Values.mqtt.broker.auth -}}
- name: MQTT_USER
valueFrom:
secretKeyRef: {{ include "iota-json.fullname" . }}
key: mqttUsername
- name: MQTT_PW
valueFrom:
secretKeyRef: {{ include "iota-json.fullname" . }}
key: mqttPassword
{{- if .Values.iota.authentication -}}
{{- if eq .Values.iota.authentication.identityManager.type "keystone" -}}
- name: IOTA_AUTH_USER
Expand Down
12 changes: 12 additions & 0 deletions charts/iotagent-json/templates/secret-mqtt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.mqtt.broker.auth -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "iota-json.fullname" . }}
labels:
{{ include "iota-json.labels" . | nindent 4 }}
type: Opaque
data:
mqttUsername: {{ .Values.mqtt.broker.auth.username | b64enc }}
mqttPassword: {{ .Values.mqtt.broker.auth.password | b64enc }}
{{- end }}
5 changes: 2 additions & 3 deletions charts/orion/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,10 @@ spec:
{{- end }}
- name: {{ .Values.broker.envPrefix }}MONGO_DB
value: {{ .Values.broker.db.name }}
{{ $numHosts := len .Values.broker.db.hosts }}
{{- if gt $numHosts 1 -}}
{{- if .Values.broker.db.replicaSetEnabled }}
- name: {{ .Values.broker.envPrefix }}MONGO_REPLICA_SET
value: {{ .Values.broker.db.replicaSet }}
{{- end }}
{{- end }}
{{- if .Values.broker.db.auth }}
- name: {{ .Values.broker.envPrefix }}MONGO_USER
value: {{ .Values.broker.db.auth.user }}
Expand Down
2 changes: 2 additions & 0 deletions charts/orion/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ broker:
# password:
# -- the MongoDB authentication mechanism to use in the case user and password is set
# mech: SCRAM-SHA-1
# -- if replicaSetEnabled is true, replicaset name is included for connection with MongoDB
#replicaSetEnabled: false
# -- name of the replicaset
#replicaSet: rs0
# -- enable SSL in the connection to MongoDB. needs to correspond with the mongoDB setting
Expand Down