From 5cf6c3af1055f6aa1068a3f341e5b5a2ff4177d4 Mon Sep 17 00:00:00 2001 From: Louise Champ Date: Thu, 7 Mar 2019 16:07:10 +0000 Subject: [PATCH] [incubator/vault] allow usage of config in existing configmap (#11952) * allow usage of config in existing configmap Signed-off-by: Louise Champ * reformat comments Signed-off-by: Louise Champ * Bumping chart version Signed-off-by: Matt Farina --- incubator/vault/Chart.yaml | 2 +- incubator/vault/README.md | 1 + incubator/vault/templates/configmap.yaml | 2 ++ incubator/vault/templates/deployment.yaml | 2 +- incubator/vault/values.yaml | 2 ++ 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/incubator/vault/Chart.yaml b/incubator/vault/Chart.yaml index c967d1b158..a3f1c49f30 100644 --- a/incubator/vault/Chart.yaml +++ b/incubator/vault/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: A Helm chart for Vault, a tool for managing secrets name: vault -version: 0.14.10 +version: 0.14.11 appVersion: 1.0.1 home: https://www.vaultproject.io/ icon: https://www.vaultproject.io/assets/images/mega-nav/logo-vault-0f83e3d2.svg diff --git a/incubator/vault/README.md b/incubator/vault/README.md index 2705839165..76b519d673 100644 --- a/incubator/vault/README.md +++ b/incubator/vault/README.md @@ -58,6 +58,7 @@ The following table lists the configurable parameters of the Vault chart and the | `vault.extraInitContainers` | Init containers to be added to the vault pod | `{}` | | `vault.extraVolumes` | Additional volumes to the controller pod | `{}` | | `vault.customSecrets` | Custom secrets available to Vault | `[]` | +| `vault.existingConfigName` | Location of existing Vault configuration | nil | | `vault.config` | Vault configuration | No default backend | | `replicaCount` | k8s replicas | `3` | | `resources.limits.cpu` | Container requested CPU | `nil` | diff --git a/incubator/vault/templates/configmap.yaml b/incubator/vault/templates/configmap.yaml index 8d4072ae37..531d7f4ae1 100644 --- a/incubator/vault/templates/configmap.yaml +++ b/incubator/vault/templates/configmap.yaml @@ -1,3 +1,4 @@ +{{ if not .Values.vault.existingConfigName }} apiVersion: v1 kind: ConfigMap metadata: @@ -10,3 +11,4 @@ metadata: data: config.json: | {{ .Values.vault.config | toJson }} +{{ end }} diff --git a/incubator/vault/templates/deployment.yaml b/incubator/vault/templates/deployment.yaml index 81b5b8d95c..1995ceaa7f 100644 --- a/incubator/vault/templates/deployment.yaml +++ b/incubator/vault/templates/deployment.yaml @@ -132,7 +132,7 @@ spec: volumes: - name: vault-config configMap: - name: "{{ template "vault.fullname" . }}-config" + name: {{ if .Values.vault.existingConfigName }}{{ .Values.vault.existingConfigName }}{{- else }}"{{ template "vault.fullname" . }}-config"{{- end }} - name: vault-root emptyDir: {} {{- range .Values.vault.customSecrets }} diff --git a/incubator/vault/values.yaml b/incubator/vault/values.yaml index eb3aaa73b4..f5ea268c4e 100644 --- a/incubator/vault/values.yaml +++ b/incubator/vault/values.yaml @@ -144,6 +144,8 @@ vault: readyIfSealed: false readyIfStandby: true readyIfUninitialized: true + ## Use an existing config in a named ConfigMap + # existingConfigName: vault-cm config: # A YAML representation of a final vault config.json file. # See https://www.vaultproject.io/docs/configuration/ for more information.