From a2a8544ff8b975372506d0a321cf29a4ededb64d Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 8 Jul 2024 13:20:15 +0200 Subject: [PATCH 1/5] Move rclone.conf to Kubernetes secret Fixes #3 --- charts/rclone-copy/templates/configmap.yaml | 2 -- charts/rclone-copy/templates/rclone-cron.yaml | 5 ++++- charts/rclone-copy/templates/secret.yaml | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/charts/rclone-copy/templates/configmap.yaml b/charts/rclone-copy/templates/configmap.yaml index 6255f67..d516b7a 100644 --- a/charts/rclone-copy/templates/configmap.yaml +++ b/charts/rclone-copy/templates/configmap.yaml @@ -3,7 +3,5 @@ kind: ConfigMap metadata: name: rclone-config-{{ .Release.Name }} data: - rclone.conf: | -{{ .Values.rcloneConf | indent 4 }} include-pattern.conf: | {{ .Values.includePattern | indent 4 }} diff --git a/charts/rclone-copy/templates/rclone-cron.yaml b/charts/rclone-copy/templates/rclone-cron.yaml index 73b36d1..8f072a9 100644 --- a/charts/rclone-copy/templates/rclone-cron.yaml +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -72,7 +72,7 @@ spec: # This is the default path where the rclone implementation assumes the config is located mountPath: "/root/.config/rclone/rclone_ro.conf" subPath: "rclone.conf" - - name: config + - name: includeConfig mountPath: "/root/include-pattern.conf" subPath: "include-pattern.conf" @@ -91,6 +91,9 @@ spec: restartPolicy: {{ .Values.restartPolicy }} volumes: - name: config + secret: + secretName: rclone-config-{{ .Release.Name }} + - name: includeConfig configMap: name: rclone-config-{{ .Release.Name }} backoffLimit: {{ .Values.backoffLimit }} diff --git a/charts/rclone-copy/templates/secret.yaml b/charts/rclone-copy/templates/secret.yaml index ca6de3d..af9948a 100644 --- a/charts/rclone-copy/templates/secret.yaml +++ b/charts/rclone-copy/templates/secret.yaml @@ -1,9 +1,10 @@ -{{- if .Values.configPassword }} apiVersion: v1 kind: Secret metadata: name: rclone-config-{{ .Release.Name }} type: Opaque data: + {{- if .Values.configPassword }} password: {{ .Values.configPassword | b64enc }} -{{- end }} + {{- end }} + rclone.conf: {{ .Values.rcloneConf | nindent 4 }} From 0f7b870dcf6225163fdf6b79763e7b5e0a7a0142 Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 8 Jul 2024 13:29:08 +0200 Subject: [PATCH 2/5] Update --- charts/rclone-copy/templates/secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/rclone-copy/templates/secret.yaml b/charts/rclone-copy/templates/secret.yaml index af9948a..b958e1a 100644 --- a/charts/rclone-copy/templates/secret.yaml +++ b/charts/rclone-copy/templates/secret.yaml @@ -7,4 +7,4 @@ data: {{- if .Values.configPassword }} password: {{ .Values.configPassword | b64enc }} {{- end }} - rclone.conf: {{ .Values.rcloneConf | nindent 4 }} + rclone.conf: {{ .Values.rcloneConf | nindent 4 | b64enc }} From 6df7e595f44ec83c04a80fe7dfb3f7c65bc15fac Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 8 Jul 2024 13:37:31 +0200 Subject: [PATCH 3/5] Update --- charts/rclone-copy/templates/rclone-cron.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/rclone-copy/templates/rclone-cron.yaml b/charts/rclone-copy/templates/rclone-cron.yaml index 8f072a9..8cb310d 100644 --- a/charts/rclone-copy/templates/rclone-cron.yaml +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -72,7 +72,7 @@ spec: # This is the default path where the rclone implementation assumes the config is located mountPath: "/root/.config/rclone/rclone_ro.conf" subPath: "rclone.conf" - - name: includeConfig + - name: include-config mountPath: "/root/include-pattern.conf" subPath: "include-pattern.conf" @@ -93,7 +93,7 @@ spec: - name: config secret: secretName: rclone-config-{{ .Release.Name }} - - name: includeConfig + - name: include-config configMap: name: rclone-config-{{ .Release.Name }} backoffLimit: {{ .Values.backoffLimit }} From f54239b1ee624c16d1bce8acbc590503ed97f200 Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 8 Jul 2024 13:39:06 +0200 Subject: [PATCH 4/5] Empty-Commit From 8ca0b59d1c8a9b1589a262ab32c5a4b12bf6aea5 Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 8 Jul 2024 13:52:58 +0200 Subject: [PATCH 5/5] Update --- charts/rclone-copy/templates/secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/rclone-copy/templates/secret.yaml b/charts/rclone-copy/templates/secret.yaml index b958e1a..1bc7839 100644 --- a/charts/rclone-copy/templates/secret.yaml +++ b/charts/rclone-copy/templates/secret.yaml @@ -7,4 +7,4 @@ data: {{- if .Values.configPassword }} password: {{ .Values.configPassword | b64enc }} {{- end }} - rclone.conf: {{ .Values.rcloneConf | nindent 4 | b64enc }} + rclone.conf: {{ .Values.rcloneConf | b64enc }}