From baa2f7f74f27b2cf9c2331042e8cb826caa385ea Mon Sep 17 00:00:00 2001 From: Yong Wen Chua Date: Thu, 24 Oct 2019 09:35:06 +0800 Subject: [PATCH] [incubator/vault] Allow disabling of setting `VAULT_API_ADDR` (#18224) * [incubator/vault] Allow disabling of setting `VAULT_API_ADDR` environment variables Signed-off-by: Yong Wen Chua * Fix scheme for API address Signed-off-by: Yong Wen Chua * Bump chart again Signed-off-by: Yong Wen Chua --- incubator/vault/Chart.yaml | 2 +- incubator/vault/README.md | 1 + incubator/vault/templates/deployment.yaml | 4 +++- incubator/vault/values.yaml | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/incubator/vault/Chart.yaml b/incubator/vault/Chart.yaml index 285dbe623e..11c75c78d0 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.22.1 +version: 0.22.2 appVersion: 1.2.3 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 a817368b3f..7cbf6df5e2 100644 --- a/incubator/vault/README.md +++ b/incubator/vault/README.md @@ -61,6 +61,7 @@ The following table lists the configurable parameters of the Vault chart and the | `vault.extraVolumes` | Additional volumes to the controller pod | `{}` | | `vault.extraVolumeMounts` | Extra volumes to mount to the controller pod | `{}` | | `vault.existingConfigName` | Location of existing Vault configuration | nil | +| `vault.podApiAddress` | Set the `VAULT_API_ADDR` environment variable to the Pod IP Address. This is the address (full URL) to advertise to other Vault servers in the cluster for client redirection.| `true` | | `vault.config` | Vault configuration | No default backend | | `replicaCount` | k8s replicas | `3` | | `resources.limits.cpu` | Container requested CPU | `nil` | diff --git a/incubator/vault/templates/deployment.yaml b/incubator/vault/templates/deployment.yaml index a512c80e99..44b607c9bf 100644 --- a/incubator/vault/templates/deployment.yaml +++ b/incubator/vault/templates/deployment.yaml @@ -139,8 +139,10 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP + {{- if .Values.vault.podApiAddress }} - name: VAULT_API_ADDR - value: "http://$(POD_IP):8200" + value: "{{ if .Values.vault.config.listener.tcp.tls_disable }}http{{ else }}https{{ end }}://$(POD_IP):8200" + {{- end }} {{- if not .Values.vault.dev }} - name: VAULT_CLUSTER_ADDR value: "https://$(POD_IP):8201" diff --git a/incubator/vault/values.yaml b/incubator/vault/values.yaml index 4f927bc9a4..9d3293ef68 100644 --- a/incubator/vault/values.yaml +++ b/incubator/vault/values.yaml @@ -241,6 +241,10 @@ vault: readyIfUninitialized: true initialDelaySeconds: 10 periodSeconds: 10 + # Set the `VAULT_API_ADDR` environment variable to the Pod IP Address + # This is the address (full URL) to advertise to other Vault servers in the cluster for client redirection. + # See https://www.vaultproject.io/docs/configuration/#api_addr + podApiAddress: true ## Use an existing config in a named ConfigMap # existingConfigName: vault-cm config: