From 3f535524c7bc9e46cfa12895f048772608f8a6bf Mon Sep 17 00:00:00 2001 From: Rimas Mocevicius Date: Wed, 5 Jun 2019 19:44:02 +0100 Subject: [PATCH] Add support for extra evv vars to deployment (#1270) --- charts/athens-proxy/Chart.yaml | 2 +- charts/athens-proxy/README.md | 15 ++++++++++++++- charts/athens-proxy/templates/deployment.yaml | 3 +++ charts/athens-proxy/values.yaml | 9 +++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/charts/athens-proxy/Chart.yaml b/charts/athens-proxy/Chart.yaml index 5fe81680..e9c61523 100644 --- a/charts/athens-proxy/Chart.yaml +++ b/charts/athens-proxy/Chart.yaml @@ -1,5 +1,5 @@ name: athens-proxy -version: 0.2.7 +version: 0.2.8 appVersion: 0.4.0 description: The proxy server for Go modules icon: https://raw.githubusercontent.com/gomods/athens/master/docs/static/banner.png diff --git a/charts/athens-proxy/README.md b/charts/athens-proxy/README.md index 24fb0ff4..9cda3d1e 100644 --- a/charts/athens-proxy/README.md +++ b/charts/athens-proxy/README.md @@ -47,7 +47,20 @@ Available options: - [Upstream module repository](https://docs.gomods.io/install/install-on-kubernetes/#upstream-module-repository) - [.netrc file support](https://docs.gomods.io/install/install-on-kubernetes/#netrc-file-support) -## Private git servers over ssh support +### Pass extra configuration environment variables + +You can pass any extra environment variables supported in [config.dev.toml](https://github.com/gomods/athens/blob/master/config.dev.toml). +The example below shows how to set username/password for basic auth: + +```yaml +configEnvVars: + - name: BASIC_AUTH_USER + value: "some_user" + - name: BASIC_AUTH_PASS + value: "some_password" +``` + +### Private git servers over ssh support One or more of git servers can added to `sshGitServers`, and the corresponding config files (git config and ssh config) and ssh keys will be created. Athens then will use these configs and keys to download the source from the git servers. diff --git a/charts/athens-proxy/templates/deployment.yaml b/charts/athens-proxy/templates/deployment.yaml index f993bbd2..c887d30a 100644 --- a/charts/athens-proxy/templates/deployment.yaml +++ b/charts/athens-proxy/templates/deployment.yaml @@ -61,6 +61,9 @@ spec: {{- else }} value: "3" {{- end }} + {{- if .Values.configEnvVars }} +{{ toYaml .Values.configEnvVars | indent 8 }} + {{- end }} - name: ATHENS_STORAGE_TYPE value: {{ .Values.storage.type | quote }} {{- if eq .Values.storage.type "disk"}} diff --git a/charts/athens-proxy/values.yaml b/charts/athens-proxy/values.yaml index 7ce6825d..5fe3edcb 100644 --- a/charts/athens-proxy/values.yaml +++ b/charts/athens-proxy/values.yaml @@ -45,6 +45,15 @@ storage: # for example, you need to run 'helm install --set storage.mongo.url=myurl ...' url: "SET THIS ON THE COMMAND LINE" +# Extra environment variables to be passed +# Commented lines below, show how to set username/password for basic auth +# You can add any new ones at the bottom +configEnvVars: {} +# - name: BASIC_AUTH_USER +# value: "some_user" +# - name: BASIC_AUTH_PASS +# value: "some_password" + netrc: # if enabled, it expects to find the content of a valid .netrc file imported as a secret named netrcsecret enabled: false