Skip to content

Commit

Permalink
Ensure appVersion is used by default as the server image tag. (#488)
Browse files Browse the repository at this point in the history
* Bumps server version to the specified appVersion
* Use chart.appversion instead of image.tag from values in deployment spec
* Allow overriding deployment spec with image.tag

---------

Co-authored-by: Kshitij <[email protected]>
  • Loading branch information
ktulsyan and ktulsyan-oai authored May 16, 2024
1 parent 642483f commit 50566e1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion charts/temporal/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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.
version: 0.37.0
version: 0.38.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
2 changes: 1 addition & 1 deletion charts/temporal/templates/admintools-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
{{ include "temporal.serviceAccount" . }}
containers:
- name: admin-tools
image: "{{ .Values.admintools.image.repository }}:{{ .Values.admintools.image.tag }}"
image: "{{ .Values.admintools.image.repository }}:{{ default .Chart.AppVersion .Values.admintools.image.tag }}"
imagePullPolicy: {{ .Values.admintools.image.pullPolicy }}
ports:
- name: http
Expand Down
4 changes: 2 additions & 2 deletions charts/temporal/templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ spec:
{{- end }}
{{- if or $.Values.elasticsearch.enabled $.Values.elasticsearch.external }}
- name: check-elasticsearch-index
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
image: "{{ $.Values.admintools.image.repository }}:{{ default $.Chart.AppVersion $.Values.admintools.image.tag }}"
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
command: ['sh', '-c', 'until curl --silent --fail {{- if and $.Values.elasticsearch.username $.Values.elasticsearch.password }} --user {{ $.Values.elasticsearch.username }}:{{ $.Values.elasticsearch.password }} {{- end }} {{ $.Values.elasticsearch.scheme }}://{{ $.Values.elasticsearch.host }}:{{ $.Values.elasticsearch.port }}/{{ $.Values.elasticsearch.visibilityIndex }} 2>&1 > /dev/null; do echo waiting for elasticsearch index to become ready; sleep 1; done;']
{{- end }}
{{- end }}
containers:
- name: {{ $.Chart.Name }}-{{ $service }}
image: "{{ $.Values.server.image.repository }}:{{ $.Values.server.image.tag }}"
image: "{{ $.Values.server.image.repository }}:{{ default $.Chart.AppVersion $.Values.server.image.tag }}"
imagePullPolicy: {{ $.Values.server.image.pullPolicy }}
env:
- name: POD_IP
Expand Down
12 changes: 6 additions & 6 deletions charts/temporal/templates/server-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
{{- $storeConfig := index $.Values.server.config.persistence $store }}
{{- if eq (include "temporal.persistence.driver" (list $ $store)) "cassandra" }}
- name: create-{{ $store }}-store
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
image: "{{ $.Values.admintools.image.repository }}:{{ default $.Chart.AppVersion $.Values.admintools.image.tag }}"
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
command: ['temporal-cassandra-tool', 'create', '-k', '{{ $storeConfig.cassandra.keyspace }}', '--replication-factor', '{{ $storeConfig.cassandra.replicationFactor }}']
env:
Expand Down Expand Up @@ -85,7 +85,7 @@ spec:
{{- $storeConfig := index $.Values.server.config.persistence $store }}
{{- if eq (include "temporal.persistence.driver" (list $ $store)) "sql" }}
- name: create-{{ $store }}-store
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
image: "{{ $.Values.admintools.image.repository }}:{{ default $.Chart.AppVersion $.Values.admintools.image.tag }}"
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
command: ['temporal-sql-tool', '--database', '{{ include "temporal.persistence.sql.database" (list $ $store) }}', 'create-database']
env:
Expand Down Expand Up @@ -119,7 +119,7 @@ spec:
{{- range $store := (list "default" "visibility") }}
{{- $storeConfig := index $.Values.server.config.persistence $store }}
- name: {{ $store }}-schema
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
image: "{{ $.Values.admintools.image.repository }}:{{ default $.Chart.AppVersion $.Values.admintools.image.tag }}"
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
command: ['temporal-{{ include "temporal.persistence.driver" (list $ $store) }}-tool', 'setup-schema', '-v', '0.0']
env:
Expand Down Expand Up @@ -257,7 +257,7 @@ spec:
{{- if or (eq $store "default") (eq (include "temporal.persistence.driver" (list $ $store)) "sql") }}
{{- $storeConfig := index $.Values.server.config.persistence $store }}
- name: {{ $store }}-schema
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
image: "{{ $.Values.admintools.image.repository }}:{{ default $.Chart.AppVersion $.Values.admintools.image.tag }}"
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
{{- if eq (include "temporal.persistence.driver" (list $ $store)) "cassandra" }}
command: ['temporal-{{ include "temporal.persistence.driver" (list $ $store) }}-tool', 'update-schema', '--schema-dir', '/etc/temporal/schema/cassandra/{{ include "temporal.persistence.schema" $store }}/versioned']
Expand Down Expand Up @@ -383,12 +383,12 @@ spec:
restartPolicy: "OnFailure"
initContainers:
- name: check-elasticsearch
image: "{{ .Values.admintools.image.repository }}:{{ .Values.admintools.image.tag }}"
image: "{{ .Values.admintools.image.repository }}:{{ default $.Chart.AppVersion $.Values.admintools.image.tag }}"
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
command: ['sh', '-c', 'until curl --silent --fail {{- if and .Values.elasticsearch.username .Values.elasticsearch.password }} --user {{ .Values.elasticsearch.username }}:{{ .Values.elasticsearch.password }} {{- end }} {{ .Values.elasticsearch.scheme }}://{{ .Values.elasticsearch.host }}:{{ .Values.elasticsearch.port }} 2>&1 > /dev/null; do echo waiting for elasticsearch to start; sleep 1; done;']
containers:
- name: create-elasticsearch-index
image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}"
image: "{{ $.Values.admintools.image.repository }}:{{ default $.Chart.AppVersion $.Values.admintools.image.tag }}"
imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }}
command: ['sh', '-c']
args:
Expand Down
4 changes: 2 additions & 2 deletions charts/temporal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ server:
sidecarContainers: {}
image:
repository: temporalio/server
tag: 1.22.4
tag: {}
pullPolicy: IfNotPresent

# Global default settings (can be overridden per service)
Expand Down Expand Up @@ -286,7 +286,7 @@ admintools:
enabled: true
image:
repository: temporalio/admin-tools
tag: 1.22.4
tag: {}
pullPolicy: IfNotPresent

service:
Expand Down

0 comments on commit 50566e1

Please sign in to comment.