Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/temporal/templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ spec:
subPath: config_template.yaml
- name: dynamic-config
mountPath: /etc/temporal/dynamic_config
{{- if $.Values.shims.dockerize }}
- name: shims
mountPath: /usr/local/bin/dockerize
subPath: dockerize
{{- end }}
{{- if $.Values.server.additionalVolumeMounts }}
{{- toYaml $.Values.server.additionalVolumeMounts | nindent 12}}
{{- end }}
Expand All @@ -132,10 +134,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if $.Values.shims.dockerize }}
- name: shims
configMap:
name: "{{ include "temporal.fullname" $ }}-shims"
defaultMode: 0555
{{- end }}
- name: config
configMap:
name: "{{ include "temporal.fullname" $ }}-config"
Expand Down
6 changes: 5 additions & 1 deletion charts/temporal/templates/server-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ datacenter', '{{ $store.config.datacenter }}'{{- end }}]
{{- with $.Values.admintools.additionalVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if $.Values.shims.elasticsearchTool }}
- name: shims
mountPath: /usr/local/sbin/temporal-elasticsearch-tool
subPath: temporal-elasticsearch-tool
{{- end }}
{{- with $.Values.schema.resources }}
resources:
{{- toYaml . | nindent 12 }}
Expand Down Expand Up @@ -164,13 +166,15 @@ datacenter', '{{ $store.config.datacenter }}'{{- end }}]
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or $.Values.admintools.additionalVolumes true }}
{{- if or $.Values.admintools.additionalVolumes $.Values.shims.elasticsearchTool }}
volumes:
{{- with $.Values.admintools.additionalVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if $.Values.shims.elasticsearchTool }}
- name: shims
configMap:
name: "{{ include "temporal.fullname" $ }}-shims"
defaultMode: 0555
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/temporal/templates/shim-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{{- if or $.Values.shims.dockerize $.Values.shims.elasticsearchTool }}
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ include "temporal.fullname" $ }}-shims"
labels:
{{- include "temporal.resourceLabels" (list $ "" "") | nindent 4 }}
data:
{{- if $.Values.shims.dockerize }}
dockerize: |-
#!/bin/sh
set -e
Expand Down Expand Up @@ -38,6 +40,8 @@ data:

echo "Skipped dockerize, copied $SRC to $DST"
fi
{{- end }}
{{- if $.Values.shims.elasticsearchTool }}
temporal-elasticsearch-tool: |-
#!/bin/sh
set -e
Expand Down Expand Up @@ -312,3 +316,5 @@ data:
exit 1
;;
esac
{{- end }}
{{- end }}
35 changes: 35 additions & 0 deletions charts/temporal/tests/server_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,41 @@ tests:
- equal:
path: spec.template.spec.initContainers[0].name
value: my-init-container
- it: includes volume mounts with shim by default
template: templates/server-deployment.yaml
documentSelector:
path: .kind
value: Deployment
matchMany: true
asserts:
- exists:
path: spec.template.spec.containers[0].volumeMounts[?(@.name=='config')]
- exists:
path: spec.template.spec.containers[0].volumeMounts[?(@.name=='dynamic-config')]
- exists:
path: spec.template.spec.containers[0].volumeMounts[?(@.name=='shims')]
- exists:
path: spec.template.spec.volumes[?(@.name=='config')]
- exists:
path: spec.template.spec.volumes[?(@.name=='dynamic-config')]
- exists:
path: spec.template.spec.volumes[?(@.name=='shims')]
- it: includes additional volumes without shim when disabled
template: templates/server-deployment.yaml
documentSelector:
path: .kind
value: Deployment
matchMany: true
set:
shims:
dockerize: false
asserts:
- exists:
path: spec.template.spec.volumes[?(@.name=='config')]
- notExists:
path: spec.template.spec.volumes[?(@.name=='shims')]
- notExists:
path: spec.template.spec.containers[0].volumeMounts[?(@.name=='shims')]
- it: omits prometheus annotations when disabled
template: templates/server-deployment.yaml
documentSelector:
Expand Down
3 changes: 3 additions & 0 deletions charts/temporal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -503,5 +503,8 @@ schema:
resources: {}
containerSecurityContext: {}
securityContext: {}
shims:
dockerize: true
elasticsearchTool: true
test:
podAnnotations: {}