From e2089b202c4fda13ea780f1adb6fd7a4a9f5b3bc Mon Sep 17 00:00:00 2001 From: Tomy Guichard Date: Sat, 3 Jun 2023 11:21:01 +0200 Subject: [PATCH] Update chart --- charts/livebox-exporter/Chart.yaml | 4 +-- .../livebox-exporter/templates/configmap.yaml | 10 ++++++++ .../templates/deployment.yaml | 25 ++++++++++++++++--- charts/livebox-exporter/templates/secret.yaml | 4 +-- charts/livebox-exporter/values.yaml | 21 +++++++++------- 5 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 charts/livebox-exporter/templates/configmap.yaml diff --git a/charts/livebox-exporter/Chart.yaml b/charts/livebox-exporter/Chart.yaml index 171c10a..fe972e1 100644 --- a/charts/livebox-exporter/Chart.yaml +++ b/charts/livebox-exporter/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: livebox-exporter description: A prometheus exporter for Livebox type: application -version: 0.2.0 -appVersion: "v0.2.0" +version: 0.3.0 +appVersion: "v0.3.0" diff --git a/charts/livebox-exporter/templates/configmap.yaml b/charts/livebox-exporter/templates/configmap.yaml new file mode 100644 index 0000000..aefe3a2 --- /dev/null +++ b/charts/livebox-exporter/templates/configmap.yaml @@ -0,0 +1,10 @@ +{{- if .Values.livebox.caCert }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "livebox-exporter.fullname" . }} + labels: + {{- include "livebox-exporter.labels" . | nindent 4 }} +data: + ca.crt: {{ toYaml .Values.livebox.caCert | indent 2 }} +{{- end }} \ No newline at end of file diff --git a/charts/livebox-exporter/templates/deployment.yaml b/charts/livebox-exporter/templates/deployment.yaml index be2aa8d..e7cb588 100644 --- a/charts/livebox-exporter/templates/deployment.yaml +++ b/charts/livebox-exporter/templates/deployment.yaml @@ -41,13 +41,26 @@ spec: - name: ADMIN_PASSWORD valueFrom: secretKeyRef: - {{- if .Values.adminPassword.secretKeyRef }} - name: {{ .Values.adminPassword.secretKeyRef.name}} - key: {{ .Values.adminPassword.secretKeyRef.key }} + {{- if .Values.livebox.adminPassword.secretKeyRef }} + name: {{ .Values.livebox.adminPassword.secretKeyRef.name}} + key: {{ .Values.livebox.adminPassword.secretKeyRef.key }} {{- else }} name: {{ include "livebox-exporter.fullname" . }}-admin key: password {{- end }} + {{- with .Values.livebox.address }} + - name: LIVEBOX_ADDRESS + value: {{ . }} + {{- end }} + {{- if .Values.livebox.caCert }} + - name: LIVEBOX_CACERT + value: /etc/livebox/certs/ca.crt + {{- end }} + {{- if .Values.livebox.caCert }} + volumeMounts: + - name: livebox-crt + mountPath: /etc/livebox/certs + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -60,3 +73,9 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- if .Values.livebox.caCert }} + volumes: + - name: livebox-crt + configMap: + name: {{ include "livebox-exporter.fullname" . }} + {{- end }} \ No newline at end of file diff --git a/charts/livebox-exporter/templates/secret.yaml b/charts/livebox-exporter/templates/secret.yaml index f2f0c3b..18a30f7 100644 --- a/charts/livebox-exporter/templates/secret.yaml +++ b/charts/livebox-exporter/templates/secret.yaml @@ -1,4 +1,4 @@ -{{- if not .Values.adminPassword.secretKeyRef }} +{{- if not .Values.livebox.adminPassword.secretKeyRef }} apiVersion: v1 kind: Secret metadata: @@ -7,5 +7,5 @@ metadata: {{- include "livebox-exporter.labels" . | nindent 4 }} type: Opaque data: - password: {{ .Values.adminPassword.value | b64enc }} + password: {{ .Values.livebox.adminPassword.value | b64enc }} {{- end }} \ No newline at end of file diff --git a/charts/livebox-exporter/values.yaml b/charts/livebox-exporter/values.yaml index 98120a7..e2a2cee 100644 --- a/charts/livebox-exporter/values.yaml +++ b/charts/livebox-exporter/values.yaml @@ -1,7 +1,3 @@ -# Default values for livebox-exporter. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - replicaCount: 1 image: @@ -10,12 +6,19 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "" -adminPassword: - secretKeyRef: {} - # name: "" - # key: "" +livebox: + adminPassword: + secretKeyRef: {} + # name: "" + # key: "" - value: "changeme" + value: "changeme" + + # Address of the Livebox. If empty the exporter will use its own default value. + address: "" + + # CA cert of the Livebox. + caCert: "" imagePullSecrets: [] nameOverride: ""