From e89b87212e30f0813d1bad887d772e0fa4e597e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pinkava?= Date: Mon, 11 Nov 2019 13:53:40 +0100 Subject: [PATCH] stable/sealed-secrets: allow disable of controller installation (#18763) The main goal is to allow installation of CRD using separate Helm deployment. This is an alternative to using separate Helm Chart for CRD deployment. This is helpfull for example during distaster recovery. When Sealed Secrets installation is broken and need to be reinstalled, the helm tries also to install CRD (if enabled), but when CRD already exists installation fails. This is especially usefull with deployment automation and declarative deployments definitions. Signed-off-by: Jiri Pinkava --- stable/sealed-secrets/Chart.yaml | 2 +- stable/sealed-secrets/README.md | 1 + stable/sealed-secrets/templates/NOTES.txt | 6 +++++- stable/sealed-secrets/templates/deployment.yaml | 2 ++ stable/sealed-secrets/templates/service.yaml | 2 ++ stable/sealed-secrets/values.yaml | 4 ++++ 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/stable/sealed-secrets/Chart.yaml b/stable/sealed-secrets/Chart.yaml index 38934c1120..e8252be8b1 100644 --- a/stable/sealed-secrets/Chart.yaml +++ b/stable/sealed-secrets/Chart.yaml @@ -1,6 +1,6 @@ name: sealed-secrets description: A Helm chart for Sealed Secrets -version: 1.4.3 +version: 1.5.0 appVersion: 0.9.1 kubeVersion: ">=1.9.0-0" home: https://github.com/bitnami-labs/sealed-secrets diff --git a/stable/sealed-secrets/README.md b/stable/sealed-secrets/README.md index fab8bada6b..835d439eb9 100644 --- a/stable/sealed-secrets/README.md +++ b/stable/sealed-secrets/README.md @@ -45,6 +45,7 @@ Read about kubeseal usage on [sealed-secrets docs](https://github.com/bitnami-la | Parameter | Description | Default | |----------:|:------------|:--------| +| **controller.create** | `true` if Sealed Secrets controller resources should be created | `true` | | **rbac.create** | `true` if rbac resources should be created | `true` | | **rbac.pspEnabled** | `true` if psp resources should be created | `false` | | **serviceAccount.create** | Whether to create a service account or not | `true` | diff --git a/stable/sealed-secrets/templates/NOTES.txt b/stable/sealed-secrets/templates/NOTES.txt index 8f5047e2e6..beca3a4966 100644 --- a/stable/sealed-secrets/templates/NOTES.txt +++ b/stable/sealed-secrets/templates/NOTES.txt @@ -1,3 +1,4 @@ +{{ if .Values.controller.create -}} You should now be able to create sealed secrets. 1. Install client-side tool into /usr/local/bin/ @@ -40,4 +41,7 @@ kubectl create -f mysealedsecret.[json|yaml] Running 'kubectl get secret secret-name -o [json|yaml]' will show the decrypted secret that was generated from the sealed secret. Both the SealedSecret and generated Secret must have the same name and namespace. - +{{- else }} +Sealed Secrets controller not installed, You need to install controller before +sealed secrets can be created. +{{- end }} diff --git a/stable/sealed-secrets/templates/deployment.yaml b/stable/sealed-secrets/templates/deployment.yaml index cb5e7b7bba..ca115df1cf 100644 --- a/stable/sealed-secrets/templates/deployment.yaml +++ b/stable/sealed-secrets/templates/deployment.yaml @@ -1,3 +1,4 @@ +{{- if .Values.controller.create -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -67,3 +68,4 @@ spec: tolerations: {{ toYaml . | indent 8 }} {{- end }} +{{- end }} diff --git a/stable/sealed-secrets/templates/service.yaml b/stable/sealed-secrets/templates/service.yaml index 243265fe9c..5f805e6f69 100644 --- a/stable/sealed-secrets/templates/service.yaml +++ b/stable/sealed-secrets/templates/service.yaml @@ -1,3 +1,4 @@ +{{- if .Values.controller.create -}} apiVersion: v1 kind: Service metadata: @@ -13,3 +14,4 @@ spec: - port: 8080 selector: app.kubernetes.io/name: {{ template "sealed-secrets.name" . }} +{{- end }} diff --git a/stable/sealed-secrets/values.yaml b/stable/sealed-secrets/values.yaml index 6a867686df..b6589b4d5c 100644 --- a/stable/sealed-secrets/values.yaml +++ b/stable/sealed-secrets/values.yaml @@ -8,6 +8,10 @@ nodeSelector: {} tolerations: [] affinity: {} +controller: + # controller.create: `true` if Sealed Secrets controller should be created + create: true + serviceAccount: # serviceAccount.create: Whether to create a service account or not create: true