Skip to content

Commit

Permalink
[helm-chart] Basic-Auth support without environment-variables (#1289)
Browse files Browse the repository at this point in the history
* Added basic auth support

Signed-off-by: Alexander Zimmermann <alexander.zimmermann96@gmail.com>

* Disabled basicAuth for default

Signed-off-by: Alexander Zimmermann <alexander.zimmermann96@gmail.com>

* Count up helm chart version

* Using default values in http-headers

Signed-off-by: Alexander Zimmermann <alexander.zimmermann96@gmail.com>
  • Loading branch information
alexzimmer96 authored and arschles committed Jun 27, 2019
1 parent d398221 commit 9436778
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/athens-proxy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: athens-proxy
version: 0.2.11
version: 0.2.12
appVersion: 0.4.0
description: The proxy server for Go modules
icon: https://raw.githubusercontent.com/gomods/athens/master/docs/static/banner.png
Expand Down
16 changes: 16 additions & 0 deletions charts/athens-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,20 @@ spec:
httpGet:
path: "/healthz"
port: 3000
{{- if .Values.basicAuth.enabled }}
httpHeaders:
- name: Authorization
value: "Basic {{ (printf "%s:%s" (default "gomod" .Values.basicAuth.user) (default "gomod" .Values.basicAuth.password) | b64enc) }}"
{{- end }}
readinessProbe:
httpGet:
path: "{{ template "readinessPath" . }}"
port: 3000
{{- if .Values.basicAuth.enabled }}
httpHeaders:
- name: Authorization
value: "Basic {{ (printf "%s:%s" (default "gomod" .Values.basicAuth.user) (default "gomod" .Values.basicAuth.password) | b64enc) }}"
{{- end }}
env:
- name: ATHENS_GOGET_WORKERS
{{- if .Values.goGetWorkers }}
Expand Down Expand Up @@ -108,6 +118,12 @@ spec:
- name: ATHENS_TRACE_EXPORTER
value: "jaeger"
{{- end }}
{{- if .Values.basicAuth.enabled }}
- name: BASIC_AUTH_USER
value: "{{ default "gomod" .Values.basicAuth.user | quote }}"
- name: BASIC_AUTH_PASS
value: "{{ default "gomod" .Values.basicAuth.password | quote }}"
{{- end }}
ports:
- containerPort: 3000
{{- if or (eq .Values.storage.type "disk") .Values.upstreamProxy.enabled .Values.netrc.enabled }}
Expand Down
11 changes: 6 additions & 5 deletions charts/athens-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ storage:
useDefaultConfiguration: true

# 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"

# HTTP basic auth
basicAuth:
enabled: false
user: "some_user"
password: "some_password"

netrc:
# if enabled, it expects to find the content of a valid .netrc file imported as a secret named netrcsecret
Expand Down

0 comments on commit 9436778

Please sign in to comment.