From fa6e0d113415e08ffb31307cebfb05bc9fbb8992 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 4 May 2020 12:44:05 +0100 Subject: [PATCH] [aaisp-to-mqtt] Cleanup --- charts/aaisp-to-mqtt/Chart.yaml | 2 +- charts/aaisp-to-mqtt/templates/cronjob.yaml | 16 ++++++++-------- charts/aaisp-to-mqtt/templates/secrets.yaml | 10 +++++----- charts/aaisp-to-mqtt/values.yaml | 7 +------ 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/charts/aaisp-to-mqtt/Chart.yaml b/charts/aaisp-to-mqtt/Chart.yaml index 807b4a7..70e9efb 100644 --- a/charts/aaisp-to-mqtt/Chart.yaml +++ b/charts/aaisp-to-mqtt/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v1 appVersion: "0.2" description: Pulls data from the AAISP CHAOSv2 API into MQTT name: aaisp-to-mqtt -version: 0.1.2 +version: 0.2.0 diff --git a/charts/aaisp-to-mqtt/templates/cronjob.yaml b/charts/aaisp-to-mqtt/templates/cronjob.yaml index d783cb3..7796463 100644 --- a/charts/aaisp-to-mqtt/templates/cronjob.yaml +++ b/charts/aaisp-to-mqtt/templates/cronjob.yaml @@ -28,16 +28,16 @@ spec: app.kubernetes.io/managed-by: {{ include "aaisp-to-mqtt.name" . }} spec: restartPolicy: Never - {{- if (default .Values.image.pullSecrets .Values.cronjob.image.pullSecrets) }} + {{- if .Values.image.pullSecrets }} imagePullSecrets: - {{- range (default .Values.image.pullSecrets .Values.cronjob.image.pullSecrets) }} + {{- range .Values.image.pullSecrets }} - name: {{ . }} {{- end }} {{- end }} containers: - name: {{ .Chart.Name }} - image: "{{ default .Values.image.repository .Values.cronjob.image.repository }}:{{ default .Values.image.tag .Values.cronjob.image.tag }}" - imagePullPolicy: {{ default .Values.image.pullPolicy .Values.cronjob.image.pullPolicy }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} env: - name: AAISP_USERNAME valueFrom: @@ -68,16 +68,16 @@ spec: - name: MQTT_TOPIC_PREFIX value: {{ default "aaisp" .Values.mqtt.topicPrefix }} resources: -{{ toYaml (default .Values.resources .Values.cronjob.resources) | indent 16 }} - {{- with (default .Values.nodeSelector .Values.cronjob.nodeSelector) }} +{{ toYaml .Values.resources | indent 16 }} + {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 12 }} {{- end }} - {{- with (default .Values.affinity .Values.cronjob.affinity) }} + {{- with .Values.affinity }} affinity: {{ toYaml . | indent 12 }} {{- end }} - {{- with (default .Values.tolerations .Values.cronjob.tolerations) }} + {{- with .Values.tolerations }} tolerations: {{ toYaml . | indent 12 }}: {{- end }} diff --git a/charts/aaisp-to-mqtt/templates/secrets.yaml b/charts/aaisp-to-mqtt/templates/secrets.yaml index fdf22bc..5575137 100644 --- a/charts/aaisp-to-mqtt/templates/secrets.yaml +++ b/charts/aaisp-to-mqtt/templates/secrets.yaml @@ -1,4 +1,4 @@ -{{- if not .Values.cronjob.existingSecretName }} +{{- if not (.Values.existingSecretName) }} --- apiVersion: v1 kind: Secret @@ -11,10 +11,10 @@ metadata: app.kubernetes.io/managed-by: {{ include "aaisp-to-mqtt.name" . }} type: Opaque data: - aaisp.username: {{ .Values.aaisp.username }} - aaisp.password: {{ .Values.aaisp.password }} + aaisp.username: {{ .Values.aaisp.username | base64 }} + aaisp.password: {{ .Values.aaisp.password | base64 }} {{- if .Values.mqtt.authenticated }} - mqtt.username: {{ .Values.mqtt.username }} - mqtt.password: {{ .Values.mqtt.password }} + mqtt.username: {{ .Values.mqtt.username | base64 }} + mqtt.password: {{ .Values.mqtt.password | base64 }} {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/aaisp-to-mqtt/values.yaml b/charts/aaisp-to-mqtt/values.yaml index b2cb37f..9aab1c0 100644 --- a/charts/aaisp-to-mqtt/values.yaml +++ b/charts/aaisp-to-mqtt/values.yaml @@ -8,8 +8,8 @@ image: repository: nikdoof/aaisp-to-mqtt tag: latest pullPolicy: IfNotPresent + imagePullSecrets: [] -imagePullSecrets: [] nameOverride: "" fullnameOverride: "" @@ -36,11 +36,6 @@ cronjob: successfulJobsHistoryLimit: 3 failedJobsHistoryLimit: 1 # startingDeadlineSeconds: 10 - # imagePullSecrets: [] - # resources: {} - # nodeSelector: {} - # tolerations: [] - # affinity: {} resources: {} # We usually recommend not to specify default resources and to leave this as a conscious