Skip to content

Commit

Permalink
Tomcat : override ready / liveness probes
Browse files Browse the repository at this point in the history
  • Loading branch information
olevitt committed Oct 20, 2020
1 parent ac21d64 commit 35a441c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/tomcat/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2
version: 0.1.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
18 changes: 15 additions & 3 deletions charts/tomcat/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,36 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.env }}
env:
{{- range $key, $val := .Values.tomcat.env }}
{{- range $key, $val := .Values.env }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end}}
{{- end}}
ports:
- name: http
containerPort: {{ .Values.image.containerPort }}
protocol: TCP
volumeMounts:
- mountPath: /usr/local/tomcat/webapps
name: {{$volumeName}}
{{- if .Values.liveness.enabled }}
livenessProbe:
httpGet:
path: /
path: {{ .Values.liveness.path }}
port: {{ .Values.image.containerPort }}
initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.liveness.periodSeconds }}
{{- end }}
{{- if .Values.readiness.enabled }}
readinessProbe:
httpGet:
path: /
path: {{ .Values.readiness.path }}
port: {{ .Values.image.containerPort }}
initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.readiness.periodSeconds }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.init.enabled }}
Expand All @@ -71,11 +81,13 @@ spec:
args: {{- range .Values.init.args }}
- {{ . | quote }}
{{- end }}
{{- if .Values.init.env }}
env:
{{- range $key, $val := .Values.init.env }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end}}
{{- end}}
volumeMounts:
- mountPath: /data
name: {{$volumeName}}
Expand Down
17 changes: 14 additions & 3 deletions charts/tomcat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,20 @@ image:
# Overrides the image tag whose default is the chart appVersion.
tag: "8.5"
containerPort: 8080
tomcat:
env:
TEST: "test"
env:
KEY: "value"

liveness:
enabled: true
path: "/"
initialDelaySeconds: 30
periodSeconds: 5

readiness:
enabled: true
path: "/"
initialDelaySeconds: 30
periodSeconds: 5

init:
enabled: true
Expand Down

0 comments on commit 35a441c

Please sign in to comment.