Skip to content

Commit

Permalink
optimization: Helm Charts InitContainers 容器名称去除 revision 后缀 (closed T…
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuoZhuoCrayon committed Dec 22, 2022
1 parent 60fcfee commit addc828
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions dev_log/2.2.32/crayon_202211211735.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
optimization:
- "Helm Charts InitContainers 容器名称去除 revision 后缀 (closed #1253)"
10 changes: 9 additions & 1 deletion support-files/kubernetes/helm/bk-nodeman/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ Ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations
{{- printf "%s-%s-%d" (include "bk-nodeman.fullname" .) "migrate-file-sync" .Release.Revision }}
{{- end -}}

{{- define "bk-nodeman.migrate-job.db.pure" -}}
{{- printf "%s-%s" (include "bk-nodeman.fullname" .) "migrate-db" }}
{{- end -}}

{{- define "bk-nodeman.migrate-job.file-sync.pure" -}}
{{- printf "%s-%s" (include "bk-nodeman.fullname" .) "migrate-file-sync" }}
{{- end -}}

{{/*用于标记或匹配需要采集 metrics 指标的 svc*/}}
{{- define "bk-nodeman.labels.serviceMonitor" -}}
processType: "metrics"
Expand Down Expand Up @@ -212,7 +220,7 @@ envFrom:

{{- define "bk-nodeman.backend.initContainers" -}}
initContainers:
- name: "{{ include "bk-nodeman.migrate-job.file-sync" . }}"
- name: "{{ include "bk-nodeman.migrate-job.file-sync.pure" . }}"
image: "{{ .Values.global.imageRegistry | default .Values.images.k8sWaitFor.registry }}/{{ .Values.images.k8sWaitFor.repository }}:{{ .Values.images.k8sWaitFor.tag }}"
imagePullPolicy: "{{ .Values.images.k8sWaitFor.pullPolicy }}"
args: ["job", "{{ include "bk-nodeman.migrate-job.file-sync" . }}"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
echo Start check redis: $(REDIS_HOST):$(REDIS_PORT); until telnet $(REDIS_HOST) $(REDIS_PORT); do echo waiting for redis $(REDIS_HOST):$(REDIS_PORT); sleep 2; done;
echo Start check rabbitmq: $(RABBITMQ_HOST):$(RABBITMQ_PORT); until telnet $(RABBITMQ_HOST) $(RABBITMQ_PORT); do echo waiting for rabbitmq $(RABBITMQ_HOST):$(RABBITMQ_PORT); sleep 2; done;
{{- include "bk-nodeman.backend.env" . | nindent 10 }}
- name: "{{ include "bk-nodeman.migrate-job.db" . }}"
- name: "{{ include "bk-nodeman.migrate-job.db.pure" . }}"
image: "{{ .Values.global.imageRegistry | default .Values.images.k8sWaitFor.registry }}/{{ .Values.images.k8sWaitFor.repository }}:{{ .Values.images.k8sWaitFor.tag }}"
imagePullPolicy: "{{ .Values.images.k8sWaitFor.pullPolicy }}"
args: ["job", "{{ include "bk-nodeman.migrate-job.db" . }}"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: "{{ include "bk-nodeman.migrate-job.db" . }}"
- name: "{{ include "bk-nodeman.migrate-job.db.pure" . }}"
image: "{{ .Values.global.imageRegistry | default .Values.images.k8sWaitFor.registry }}/{{ .Values.images.k8sWaitFor.repository }}:{{ .Values.images.k8sWaitFor.tag }}"
imagePullPolicy: "{{ .Values.images.k8sWaitFor.pullPolicy }}"
args: ["job", "{{ include "bk-nodeman.migrate-job.db" . }}"]
Expand Down

0 comments on commit addc828

Please sign in to comment.