Skip to content

Commit

Permalink
Add extra options to helm chart (#73)
Browse files Browse the repository at this point in the history
* add helm option to change the frontend service name

* add helm option to set varnish container lifecycle options

* add helm option to add extracontainers to the pod

* add helm option to set the pod termination grace period
  • Loading branch information
blackjid committed May 12, 2021
1 parent 50372f1 commit 3be215e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
12 changes: 11 additions & 1 deletion chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
- -signaller-port=8090
- -frontend-watch
- -frontend-namespace={{ "$(NAMESPACE)" }}
- -frontend-service={{ include "kube-httpcache.fullname" . }}
- -frontend-service={{ .Values.cache.frontendService | default (include "kube-httpcache.fullname" .) }}
{{- if .Values.cache.backendWatch }}
- -backend-watch
{{- else }}
Expand All @@ -77,6 +77,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.lifecycle }}
lifecycle:
{{- toYaml .Values.lifecycle | nindent 12 }}
{{- end }}
volumeMounts:
- name: template
mountPath: /etc/varnish/tmpl
Expand Down Expand Up @@ -123,6 +127,9 @@ spec:
{{- toYaml .Values.exporter.resources | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.extraContainers }}
{{- toYaml .Values.extraContainers | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.configmap.enabled }}
- name: template
Expand All @@ -149,4 +156,7 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- end }}
{{- end }}
12 changes: 11 additions & 1 deletion chart/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
- -signaller-port=8090
- -frontend-watch
- -frontend-namespace={{ "$(NAMESPACE)" }}
- -frontend-service={{ include "kube-httpcache.fullname" . }}
- -frontend-service={{ .Values.cache.frontendService | default (include "kube-httpcache.fullname" .) }}
{{- if .Values.cache.backendWatch }}
- -backend-watch
{{- else }}
Expand All @@ -70,6 +70,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.lifecycle }}
lifecycle:
{{- toYaml .Values.lifecycle | nindent 12 }}
{{- end }}
volumeMounts:
- name: template
mountPath: /etc/varnish/tmpl
Expand Down Expand Up @@ -124,6 +128,9 @@ spec:
{{- toYaml .Values.exporter.resources | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.extraContainers }}
{{- toYaml .Values.extraContainers | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.configmap.enabled }}
- name: template
Expand All @@ -150,4 +157,7 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- end }}
{{- end }}
20 changes: 19 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ configmap:

# kube-httpcache specific configuration
cache:
# name of backend service
# frontendService: kube-httpcache-headless
# name of backend service
backendService: backend-service
# name of backend service namespace
Expand Down Expand Up @@ -76,6 +78,14 @@ securityContext: {}
# runAsNonRoot: true
# runAsUser: 1000

lifecycle: {}
# preStop:
# exec:
# command:
# - /bin/sh
# - -c
# - touch /etc/varnish/fail_probes; sleep 25

initContainers: {}
# initContainers: |
# - args:
Expand All @@ -93,7 +103,13 @@ initContainers: {}
# volumeMounts:
# - name: template
# mountPath: /etc/varnish/tmpl
#

extraContainers: []
# - name: my-sidecar
# image: myapp/my-sidecar
# command:
# - my-sidecar-command

extraVolumes: {}
# extraVolumes:
# - emptyDir: {}
Expand Down Expand Up @@ -183,6 +199,8 @@ nodeSelector: {}

tolerations: []

#terminationGracePeriodSeconds: 60

affinity: {}

livenessProbe: {}
Expand Down

0 comments on commit 3be215e

Please sign in to comment.