From d1bfd63bbcf784fe1b5fc267f933bf354d54dc5a Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Sat, 10 Jun 2023 04:49:18 -0400 Subject: [PATCH] feat(kopia): *Breaking Change* Move to new common + update (#9550) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Let's see if I can do configmaps now (Stavros might be proud) ⚒️ Fixes # **⚙️ Type of change** - [X] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [X] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- charts/incubator/kopia/Chart.yaml | 6 +-- charts/incubator/kopia/ci/test-values.yaml | 10 +++++ charts/incubator/kopia/questions.yaml | 15 ++++++-- charts/incubator/kopia/templates/NOTES.txt | 1 + charts/incubator/kopia/templates/_secret.tpl | 10 +++++ charts/incubator/kopia/templates/common.yaml | 12 +++++- charts/incubator/kopia/values.yaml | 40 ++++++++++++++++---- 7 files changed, 79 insertions(+), 15 deletions(-) create mode 100644 charts/incubator/kopia/ci/test-values.yaml create mode 100644 charts/incubator/kopia/templates/NOTES.txt create mode 100644 charts/incubator/kopia/templates/_secret.tpl diff --git a/charts/incubator/kopia/Chart.yaml b/charts/incubator/kopia/Chart.yaml index 545f241c922..3f8737c2239 100644 --- a/charts/incubator/kopia/Chart.yaml +++ b/charts/incubator/kopia/Chart.yaml @@ -1,9 +1,9 @@ apiVersion: v2 -appVersion: "0.12.1" +appVersion: "0.13.0" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 + version: 12.13.0 description: Kopia is a simple, cross-platform tool for managing encrypted backups in the cloud. It provides fast, incremental backups, secure, client-side end-to-end encryption, compression and data deduplication. home: https://truecharts.org/charts/incubator/kopia icon: https://truecharts.org/img/hotlink-ok/chart-icons/kopia.png @@ -19,7 +19,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/kopia - https://kopia.io/docs/installation/#docker-images - https://github.com/kopia/kopia -version: 5.0.0 +version: 6.0.0 annotations: truecharts.org/catagories: | - utility diff --git a/charts/incubator/kopia/ci/test-values.yaml b/charts/incubator/kopia/ci/test-values.yaml new file mode 100644 index 00000000000..3d8a16608ab --- /dev/null +++ b/charts/incubator/kopia/ci/test-values.yaml @@ -0,0 +1,10 @@ +workload: + main: + podSpec: + containers: + main: + args: + - server + - start + - --address=http://0.0.0.0:10238 + - --insecure diff --git a/charts/incubator/kopia/questions.yaml b/charts/incubator/kopia/questions.yaml index 9b2e61d1974..3c6168ae978 100644 --- a/charts/incubator/kopia/questions.yaml +++ b/charts/incubator/kopia/questions.yaml @@ -11,19 +11,26 @@ questions: # Include{podSpec} # Include{containerMain} - - variable: env + - variable: kopia group: "App Configuration" label: "Image Environment" schema: additional_attrs: true type: dict attrs: + - variable: USER + label: "Kopia User" + description: "Repository user" + schema: + type: string + default: "secret" + required: true - variable: KOPIA_PASSWORD label: "KOPIA_PASSWORD" description: "Repository password" schema: type: string - default: "" + default: "secret" required: true private: true - variable: KOPIA_SERVER_USERNAME @@ -31,14 +38,14 @@ questions: description: "Username for WebUI" schema: type: string - default: "" + default: "server_user" required: true - variable: KOPIA_SERVER_PASSWORD label: "KOPIA_SERVER_PASSWORD" description: "Password for WebUI" schema: type: string - default: "" + default: "server_password" required: true private: true # Include{containerBasic} diff --git a/charts/incubator/kopia/templates/NOTES.txt b/charts/incubator/kopia/templates/NOTES.txt new file mode 100644 index 00000000000..efcb74cb772 --- /dev/null +++ b/charts/incubator/kopia/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "tc.v1.common.lib.chart.notes" $ -}} diff --git a/charts/incubator/kopia/templates/_secret.tpl b/charts/incubator/kopia/templates/_secret.tpl new file mode 100644 index 00000000000..a9753ada237 --- /dev/null +++ b/charts/incubator/kopia/templates/_secret.tpl @@ -0,0 +1,10 @@ +{{/* Define the secret */}} +{{- define "kopia.secret" -}} + +enabled: true +data: + USER: {{ .Values.kopia.user | default "user" }} + KOPIA_PASSWORD: {{ .Values.kopia.password | default "secret" }} + KOPIA_SERVER_USERNAME: {{ .Values.kopia.server_password | default "server_user" }} + KOPIA_SERVER_PASSWORD: {{ .Values.kopia.server_password | default "server_password" }} +{{- end }} diff --git a/charts/incubator/kopia/templates/common.yaml b/charts/incubator/kopia/templates/common.yaml index c1a366e1cf0..8a2de2a0ad8 100644 --- a/charts/incubator/kopia/templates/common.yaml +++ b/charts/incubator/kopia/templates/common.yaml @@ -1 +1,11 @@ -{{ include "tc.common.loader.all" . }} +{{/* Make sure all variables are set properly */}} +{{- include "tc.v1.common.loader.init" . }} + +{{/* Render secrets for kopia */}} +{{- $secrets := include "kopia.secret" . | fromYaml -}} +{{- if $secrets -}} +{{- $_ := set .Values.secret "kopia-secret" $secrets -}} +{{- end -}} + +{{/* Render the templates */}} +{{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/incubator/kopia/values.yaml b/charts/incubator/kopia/values.yaml index 0d4271e3730..367e571c905 100644 --- a/charts/incubator/kopia/values.yaml +++ b/charts/incubator/kopia/values.yaml @@ -1,19 +1,44 @@ image: repository: tccr.io/truecharts/kopia - tag: 0.12.1@sha256:8f1c82292cf0c2271be78a9ede514858ba16a80c9105d258aabbde899dd7f1eb + tag: 0.13.0@sha256:72ed1856efdd443be31e23535d24242056639a387587aa3ade5413e75dad0603 pullPolicy: IfNotPresent -extraArgs: ["server", "--address=http://0.0.0.0:10238", "--ui", "--insecure"] -secretEnv: - KOPIA_PASSWORD: "" - KOPIA_SERVER_USERNAME: "user" - KOPIA_SERVER_PASSWORD: "password" + +workload: + main: + podSpec: + containers: + main: + envFrom: + - secretRef: + name: "kopia-secret" + args: + - server + - start + - --address=http://0.0.0.0:10238 + - --insecure + - --server-username={{ .Values.kopia.server_username }} + - --server-password={{ .Values.kopia.server_password }} + probes: + liveness: + enabled: false + readiness: + enabled: false + startup: + enabled: false + +kopia: + kopia_user: "user" + kopia_password: "secret" + kopia_server_username: "user" + kopia_server_password: "password" service: main: ports: main: + protocol: http port: 10238 persistence: @@ -31,4 +56,5 @@ persistence: mountPath: "/app/rclone" portal: - enabled: true + open: + enabled: true