Skip to content

Commit

Permalink
Tomcat : support other init containers
Browse files Browse the repository at this point in the history
  • Loading branch information
olevitt committed Oct 19, 2020
1 parent ae06607 commit c9e21ad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 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.0
version: 0.1.1

# 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
17 changes: 13 additions & 4 deletions charts/tomcat/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,21 @@ spec:
port: {{ .Values.image.containerPort }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.init.warUrl }}
{{- if .Values.init.enabled }}
initContainers:
- name: download-war
image: "curlimages/curl"
command: ["curl"]
args: ["-o","/data/ROOT.war","-L", {{ .Values.init.warUrl | quote }}]
image: {{ .Values.init.image | quote }}
command: {{- range .Values.init.command }}
- {{ . | quote }}
{{- end }}
args: {{- range .Values.init.args }}
- {{ . | quote }}
{{- end }}
env:
{{- range $key, $val := .Values.init.env }}
- name: {{ $key }}
value: {{ $val | quote }}
{{- end}}
volumeMounts:
- mountPath: /data
name: {{$volumeName}}
Expand Down
7 changes: 6 additions & 1 deletion charts/tomcat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ image:
containerPort: 8080

init:
warUrl: "https://tomcat.apache.org/tomcat-9.0-doc/appdev/sample/sample.war"
enabled: true
image: curlimages/curl
command: ["curl"]
args: ["-o", "/data/ROOT.war", "-L", "$WAR_URL"]
env:
WAR_URL: "https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war"

imagePullSecrets: []
nameOverride: ""
Expand Down

0 comments on commit c9e21ad

Please sign in to comment.