Skip to content

Commit

Permalink
Merge pull request #7 from mrueg/readyhealthy
Browse files Browse the repository at this point in the history
Extract ready/livenessProbe settings to values
  • Loading branch information
haad authored Feb 10, 2021
2 parents 7a3ec21 + 6f34abe commit c7a9ac5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
22 changes: 14 additions & 8 deletions stable/coredns/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,30 @@ spec:
{{ toYaml .Values.resources | indent 10 }}
ports:
{{ include "coredns.containerPorts" . | indent 8 }}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /health
port: 8080
scheme: HTTP
initialDelaySeconds: 60
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 5
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /ready
port: 8181
scheme: HTTP
initialDelaySeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 5
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- end }}
{{- if .Values.preStopSleep }}
lifecycle:
preStop:
Expand Down
17 changes: 17 additions & 0 deletions stable/coredns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,23 @@ servers:
# hello world
# foo bar

# To use the livenessProbe, the health plugin needs to be enabled in CoreDNS' server config
livenessProbe:
enabled: true
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
successThreshold: 1
# To use the readinessProbe, the ready plugin needs to be enabled in CoreDNS' server config
readinessProbe:
enabled: true
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
successThreshold: 1

# expects input structure as per specification https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#affinity-v1-core
# for example:
# affinity:
Expand Down

0 comments on commit c7a9ac5

Please sign in to comment.