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 secret for mqtt username password #281

Open
wants to merge 3 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 }}