Skip to content

Commit

Permalink
JIT-35959: feat(agent-group): make readiness and liveness probes conf…
Browse files Browse the repository at this point in the history
…igurable (#6)

* feat(agent-group): make readiness and liveness probes configurable

* docs(agent-group): add comments to values file
  • Loading branch information
Sean Krail authored Jul 7, 2020
1 parent e20e207 commit a69dfd1
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 11 deletions.
2 changes: 1 addition & 1 deletion charts/agent-group/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: agent-group
version: 1.0.4
version: 1.0.5
appVersion: 10
description: Jitterbit Agent Group
home: https://github.com/jitterbit/charts
Expand Down
2 changes: 2 additions & 0 deletions charts/agent-group/templates/_required.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@
{{- required "resources is required!" .Values.resources -}}
{{- required "revisionHistoryLimit is required!" .Values.revisionHistoryLimit -}}
{{- required "affinity is required!" .Values.affinity -}}
{{- required "readinessProbe is required!" .Values.readinessProbe -}}
{{- required "livenessProbe is required!" .Values.livenessProbe -}}
{{- end -}}
13 changes: 3 additions & 10 deletions charts/agent-group/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,10 @@ spec:
env:
{{- toYaml .Values.env | trimSuffix "\n" | nindent 12 }}
{{- end }}
readinessProbe: &probe
httpGet:
scheme: HTTP
port: http-healthz
path: /
initialDelaySeconds: 90
periodSeconds: 30
timeoutSeconds: 5
readinessProbe:
{{- toYaml .Values.readinessProbe | trimSuffix "\n" | nindent 12 }}
livenessProbe:
<<: *probe
initialDelaySeconds: 300
{{- toYaml .Values.livenessProbe | trimSuffix "\n" | nindent 12 }}
resources:
{{- toYaml .Values.resources | trimSuffix "\n" | nindent 12 }}
volumeMounts:
Expand Down
14 changes: 14 additions & 0 deletions charts/agent-group/values.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ required:
- resources
- revisionHistoryLimit
- affinity
- readinessProbe
- livenessProbe
- env
properties:
metadata:
Expand Down Expand Up @@ -91,6 +93,18 @@ properties:
affinity:
description: Pod affinity and anti-affinity definitions
$ref: "#/definitions/affinity"
readinessProbe:
description: >
Periodic probe of container service readiness.
Container will be removed from service endpoints if the probe fails.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
$ref: "#/definitions/probe"
livenessProbe:
description: >
Periodic probe of container liveness.
Container will be restarted if the probe fails.
More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
$ref: "#/definitions/probe"
env:
description: List of additional environment variables that may be specified in the container
$ref: "#/definitions/env"
20 changes: 20 additions & 0 deletions charts/agent-group/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ affinity:
app: '{{ template "agent-group.name" . }}'
release: "{{ .Release.Name }}"

# readinessProbe is the container's readinessProbe definition
readinessProbe:
httpGet:
scheme: HTTP
port: http-healthz
path: /
initialDelaySeconds: 90
periodSeconds: 30
timeoutSeconds: 5

# livenessProbe is the container's livenessProbe definition
livenessProbe:
httpGet:
scheme: HTTP
port: http-healthz
path: /
initialDelaySeconds: 300
periodSeconds: 30
timeoutSeconds: 5

# env is a list of extra environment variables that may be specified in the container
env: []
# - name: CATALINA_OPTS
Expand Down
3 changes: 3 additions & 0 deletions definitions.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ definitions:
affinity:
description: Pod affinity and anti-affinity definitions
$ref: "https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.12.8-standalone-strict/_definitions.json#/definitions/io.k8s.api.core.v1.Affinity"
probe:
description: Container's readiness and liveness probe definition
$ref: "https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.12.8-standalone-strict/_definitions.json#/definitions/io.k8s.api.core.v1.Probe"
env:
description: List of additional environment variables that may be specified in the container
type: array
Expand Down

0 comments on commit a69dfd1

Please sign in to comment.