Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions charts/athens-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ This will deploy a single Athens instance in the `athens` namespace with `disk`
| basicAuth.secretName | string | `"athens-proxy-basic-auth"` | Secret name, containing the 'passwordSecretKey' and 'usernameSecretKey' |
| basicAuth.usernameSecretKey | string | `"username"` | |
| configEnvVars | list | `[]` | Set environment variables to be passed to athens pods |
| extraContainers | list | `[]` | Define extra containers (e.g. sidecars) for athens-proxy |
| extraInitContainers | list | `[]` | Define extra init containers for athens-proxy |
| extraLabels | object | `{}` | Add extra labels to all resources |
| extraVolumeMounts | object | `{}` | Add extra volume mounts to deployment pod primary container |
Expand All @@ -61,6 +62,7 @@ This will deploy a single Athens instance in the `athens` namespace with `disk`
| gitconfig.secretKey | string | `"gitconfig"` | Key in the kubernetes secret that contains git config data |
| gitconfig.secretName | string | `"athens-proxy-gitconfig"` | Name of the kubernetes secret (in the same namespace as athens-proxy) that contains git config |
| goGetWorkers | int | `3` | Specify the number of go workers |
| hostAliases | list | `[]` | Add entries to the pod's /etc/hosts, see https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/ |
| image.pullPolicy | string | `"IfNotPresent"` | Specify a imagePullPolicy. see http://kubernetes.io/docs/user-guide/images/#pre-pulling-images |
| image.pullSecrets | list | `[]` | Specify secrets containing credentials for pulling images |
| image.registry | string | `"docker.io"` | |
Expand Down
7 changes: 7 additions & 0 deletions charts/athens-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ spec:
runAsGroup: 1000
{{- end }}
serviceAccountName: {{ include "serviceAccountName" . | quote }}
{{- with .Values.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- toYaml .Values.image.pullSecrets | nindent 8 }}
Expand Down Expand Up @@ -367,6 +371,9 @@ spec:
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
volumes:
- name: storage-volume
{{- if .Values.storage.disk.persistence.enabled }}
Expand Down
65 changes: 65 additions & 0 deletions charts/athens-proxy/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
templates:
- deployment.yaml
- config-upstream.yaml
- config-ssh-git-servers.yaml
- secret-ssh-git-servers.yaml

tests:
- it: should not set hostAliases by default
template: deployment.yaml
asserts:
- hasDocuments:
count: 1
- notExists:
path: spec.template.spec.hostAliases

- it: should render configured hostAliases
template: deployment.yaml
set:
hostAliases:
- ip: "10.0.0.1"
hostnames:
- goproxy.internal
- goproxy.example.com
asserts:
- hasDocuments:
count: 1
- equal:
path: spec.template.spec.hostAliases
value:
- ip: "10.0.0.1"
hostnames:
- goproxy.internal
- goproxy.example.com

- it: should only render the athens-proxy container by default
template: deployment.yaml
asserts:
- hasDocuments:
count: 1
- lengthEqual:
path: spec.template.spec.containers
count: 1

- it: should append extraContainers after the athens-proxy container
template: deployment.yaml
set:
extraContainers:
- name: sidecar
image: busybox:1.28
command: ['sh', '-c', "sleep infinity"]
asserts:
- hasDocuments:
count: 1
- lengthEqual:
path: spec.template.spec.containers
count: 2
- equal:
path: spec.template.spec.containers[0].name
value: RELEASE-NAME-athens-proxy
- equal:
path: spec.template.spec.containers[1]
value:
name: sidecar
image: busybox:1.28
command: ['sh', '-c', "sleep infinity"]
12 changes: 12 additions & 0 deletions charts/athens-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,18 @@ extraInitContainers: []
# image: busybox:1.28
# command: ['sh', '-c', "echo 'hello world'"]

# -- Define extra containers (e.g. sidecars) for athens-proxy
extraContainers: []
# - name: sidecar
# image: busybox:1.28
# command: ['sh', '-c', "sleep infinity"]

# -- Add entries to the pod's /etc/hosts, see https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/
hostAliases: []
# - ip: "10.0.0.1"
# hostnames:
# - "goproxy.internal"

# -- Specify the number of go workers
goGetWorkers: 3

Expand Down
Loading