Skip to content

Commit

Permalink
chore(schema-migrator): update init containers and hooks
Browse files Browse the repository at this point in the history
Signed-off-by: Prashant Shahi <[email protected]>
  • Loading branch information
prashant-shahi committed Oct 25, 2024
1 parent 2fb1e18 commit 89399d9
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ spec:
imagePullPolicy: {{ .Values.schemaMigrator.initContainers.wait.image.pullPolicy }}
args:
- "job"
{{- if .Release.IsInstall }}
- "{{ include "schemaMigrator.fullname" . }}-sync-init"
{{- else }}
- "{{ include "schemaMigrator.fullname" . }}-sync"
{{- end }}
{{- end }}
{{- if .Values.otelCollectorMetrics.initContainers.init.enabled }}
- name: {{ include "otelCollectorMetrics.fullname" . }}-init
Expand Down
4 changes: 4 additions & 0 deletions charts/signoz/templates/otel-collector/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ spec:
imagePullPolicy: {{ .Values.schemaMigrator.initContainers.wait.image.pullPolicy }}
args:
- "job"
{{- if .Release.IsInstall }}
- "{{ include "schemaMigrator.fullname" . }}-sync-init"
{{- else }}
- "{{ include "schemaMigrator.fullname" . }}-sync"
{{- end }}
{{- end }}
{{- if .Values.otelCollector.initContainers.init.enabled }}
- name: {{ include "otelCollector.fullname" . }}-init
Expand Down
40 changes: 24 additions & 16 deletions charts/signoz/templates/schema-migrator-async/migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ metadata:
name: {{ include "schemaMigrator.fullname" . }}-async{{ $schemaMigratorSuffix }}
labels:
{{- include "schemaMigrator.selectorLabels" . | nindent 4 }}
{{- if .Values.schemaMigrator.annotations }}
{{- if or .Release.IsUpgrade .Values.schemaMigrator.annotations }}
annotations:
{{- toYaml .Values.schemaMigrator.annotations | nindent 4 }}
{{- with .Values.schemaMigrator.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if and .Release.IsUpgrade .Values.schemaMigrator.upgradeHelmHooks }}
helm.sh/hook: pre-upgrade
helm.sh/hook-delete-policy: before-hook-creation
argocd.argoproj.io/hook: Sync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
{{- end }}
{{- end }}
spec:
template:
Expand All @@ -21,20 +29,8 @@ spec:
spec:
serviceAccountName: {{ include "schemaMigrator.serviceAccountName" . }}-async
initContainers:
{{- if .Values.schemaMigrator.enabled }}
- name: {{ include "schemaMigrator.fullname" . }}-migrate-wait-for-sync
image: {{ include "schemaMigrator.initContainers.wait.image" . }}
imagePullPolicy: {{ .Values.schemaMigrator.initContainers.wait.image.pullPolicy }}
{{- with .Values.schemaMigrator.initContainers.wait.env }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
args:
- "job"
- "{{ include "schemaMigrator.fullname" . }}-sync{{ $schemaMigratorSuffix }}"
{{- end }}
{{- if .Values.schemaMigrator.initContainers.init.enabled }}
- name: {{ include "schemaMigrator.fullname" . }}-init
- name: schema-migrator-async-init
image: {{ include "schemaMigrator.initContainers.init.image" . }}
imagePullPolicy: {{ .Values.schemaMigrator.initContainers.init.image.pullPolicy }}
env:
Expand All @@ -50,7 +46,7 @@ spec:
{{- end }}
# ClickHouse ready check
{{- if and .Values.clickhouse.enabled .Values.schemaMigrator.initContainers.chReady.enabled }}
- name: {{ include "schemaMigrator.fullname" . }}-ch-ready
- name: schema-migrator-async-ch-ready
image: {{ include "schemaMigrator.initContainers.chReady.image" . }}
imagePullPolicy: {{ .Values.schemaMigrator.initContainers.chReady.image.pullPolicy }}
env:
Expand All @@ -68,6 +64,18 @@ spec:
resources:
{{- toYaml .Values.schemaMigrator.initContainers.chReady.resources | nindent 12 }}
{{- end }}
{{- if .Values.schemaMigrator.initContainers.wait.enabled }}
- name: schema-migrator-async-wait-for-sync
image: {{ include "schemaMigrator.initContainers.wait.image" . }}
imagePullPolicy: {{ .Values.schemaMigrator.initContainers.wait.image.pullPolicy }}
{{- with .Values.schemaMigrator.initContainers.wait.env }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
args:
- "job"
- "{{ include "schemaMigrator.fullname" . }}-sync{{ $schemaMigratorSuffix }}"
{{- end }}
containers:
- name: schema-migrator
image: {{ include "schemaMigrator.image" . }}
Expand Down
16 changes: 11 additions & 5 deletions charts/signoz/templates/schema-migrator/migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ metadata:
name: {{ include "schemaMigrator.fullname" . }}-sync{{ $schemaMigratorSuffix }}
labels:
{{- include "schemaMigrator.selectorLabels" . | nindent 4 }}
{{- if .Values.schemaMigrator.annotations }}
annotations:
{{- toYaml .Values.schemaMigrator.annotations | nindent 4 }}
{{- end }}
{{- with .Values.schemaMigrator.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if and .Release.IsUpgrade .Values.schemaMigrator.upgradeHelmHooks }}
helm.sh/hook: pre-upgrade
helm.sh/hook-delete-policy: before-hook-creation
argocd.argoproj.io/hook: Sync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
{{- end }}
spec:
template:
metadata:
Expand All @@ -22,7 +28,7 @@ spec:
serviceAccountName: {{ include "schemaMigrator.serviceAccountName" . }}-sync
initContainers:
{{- if .Values.schemaMigrator.initContainers.init.enabled }}
- name: {{ include "schemaMigrator.fullname" . }}-init
- name: schema-migrator-sync-init
image: {{ include "schemaMigrator.initContainers.init.image" . }}
imagePullPolicy: {{ .Values.schemaMigrator.initContainers.init.image.pullPolicy }}
env:
Expand All @@ -38,7 +44,7 @@ spec:
{{- end }}
# ClickHouse ready check
{{- if and .Values.clickhouse.enabled .Values.schemaMigrator.initContainers.chReady.enabled }}
- name: {{ include "schemaMigrator.fullname" . }}-ch-ready
- name: schema-migrator-sync-ch-ready
image: {{ include "schemaMigrator.initContainers.chReady.image" . }}
imagePullPolicy: {{ .Values.schemaMigrator.initContainers.chReady.image.pullPolicy }}
env:
Expand Down
28 changes: 13 additions & 15 deletions charts/signoz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1264,16 +1264,13 @@ schemaMigrator:
image:
registry: docker.io
repository: signoz/signoz-schema-migrator
tag: 0.111.2
tag: 0.111.3
pullPolicy: IfNotPresent

args:
- "--up="
annotations:
helm.sh/hook: pre-upgrade
helm.sh/hook-delete-policy: before-hook-creation
argocd.argoproj.io/hook: Sync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
annotations: {}
upgradeHelmHooks: true # set to false to disable helm hooks

# -- Whether to enable replication for schemaMigrator
enableReplication: false
Expand All @@ -1288,13 +1285,6 @@ schemaMigrator:
topologySpreadConstraints: []

initContainers:
wait:
image:
registry: docker.io
repository: groundnuty/k8s-wait-for
tag: v2.0
pullPolicy: IfNotPresent
env: []
init:
enabled: true
image:
Expand Down Expand Up @@ -1377,6 +1367,14 @@ schemaMigrator:
# limits:
# cpu: 100m
# memory: 100Mi
wait:
enabled: true
image:
registry: docker.io
repository: groundnuty/k8s-wait-for
tag: v2.0
pullPolicy: IfNotPresent
env: []

# SchemaMigrator Service Account
serviceAccount:
Expand Down Expand Up @@ -1419,7 +1417,7 @@ otelCollector:
image:
registry: docker.io
repository: signoz/signoz-otel-collector
tag: 0.111.2
tag: 0.111.3
pullPolicy: IfNotPresent

# -- Image Registry Secret Names for OtelCollector
Expand Down Expand Up @@ -2047,7 +2045,7 @@ otelCollectorMetrics:
image:
registry: docker.io
repository: signoz/signoz-otel-collector
tag: 0.111.2
tag: 0.111.3
pullPolicy: IfNotPresent

# -- Image Registry Secret Names for OtelCollector
Expand Down

0 comments on commit 89399d9

Please sign in to comment.