Skip to content

Commit

Permalink
chore(helm-charts): 优化 helm-charts #1359
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 committed Oct 24, 2023
1 parent 3e74e3a commit a6fe4b6
Show file tree
Hide file tree
Showing 50 changed files with 566 additions and 331 deletions.
4 changes: 2 additions & 2 deletions dbm-services/mysql/slow-query-parser-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM mirrors.tencent.com/sccmsp/tmysqlparse:3.0.7
FROM mirrors.tencent.com/sccmsp/tmysqlparse:latest

ADD build/slow-query-parser-service /

WORKDIR /
ENTRYPOINT ["/slow-query-parser-service", "run"]
ENTRYPOINT ["/slow-query-parser-service", "run", "--address=0.0.0.0:80", "--tmysqlparse-bin=/tmysqlparse"]
36 changes: 21 additions & 15 deletions helm-charts/bk-dbm/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,57 @@ dependencies:
version: 1.13.0
- name: mysql
repository: https://charts.bitnami.com/bitnami
version: 9.12.4
version: 9.12.5
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 16.13.2
- name: etcd
repository: https://charts.bitnami.com/bitnami
version: 9.5.5
version: 9.5.6
- name: reloader
repository: https://stakater.github.io/stakater-charts
version: 1.0.46
- name: grafana
repository: file://./charts/grafana
version: 7.9.8
- name: dbm
repository: file://charts/dbm
version: 0.1.20
version: 0.1.21
- name: dbconfig
repository: file://charts/dbconfig
version: 0.1.6
version: 0.1.7
- name: dbpriv
repository: file://charts/dbpriv
version: 0.1.28
version: 0.1.29
- name: dbpartition
repository: file://charts/dbpartition
version: 0.1.4
version: 0.1.5
- name: db-simulation
repository: file://charts/db-simulation
version: 0.1.7
version: 0.1.8
- name: db-remote-service
repository: file://charts/db-remote-service
version: 0.9.5
- name: db-dns-api
repository: file://charts/db-dns-api
version: 0.1.3
version: 0.1.4
- name: hadb-api
repository: file://charts/hadb-api
version: 0.0.10
version: 0.0.11
- name: db-resource
repository: file://charts/db-resource
version: 0.0.7
version: 0.0.8
- name: db-celery-service
repository: file://charts/db-celery-service
version: 0.0.4
version: 0.0.5
- name: slow-query-parser-service
repository: file://charts/slow-query-parser-service
version: 0.0.1
- name: backup-server
repository: file://charts/backup-server
version: 0.0.2
version: 0.0.3
- name: backup-consumer
repository: file://charts/backup-consumer
version: 0.0.2
digest: sha256:bca62d6538530facd8b271d761816f51bf547f767d6757f238b00c9e6469565e
generated: "2023-10-12T10:20:26.956839+08:00"
version: 0.0.3
digest: sha256:2441eb65d88a908703d8d83b392ad5472d9469ef532aecc8e0b12c112e80b114
generated: "2023-10-23T21:16:42.422636+08:00"
35 changes: 22 additions & 13 deletions helm-charts/bk-dbm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,69 @@ dependencies:
name: etcd
version: 9.x.x
repository: https://charts.bitnami.com/bitnami
- name: reloader
repository: https://stakater.github.io/stakater-charts
version: 1.0.x
condition: stakater.enabled
alias: stakater
- name: grafana
repository: file://./charts/grafana
version: 7.x.x
condition: grafana.enabled
- condition: dbm.enabled
name: dbm
repository: file://charts/dbm
version: 0.1.20
version: 0.1.21
- condition: dbconfig.enabled
name: dbconfig
repository: file://charts/dbconfig
version: 0.1.6
version: 0.1.7
- condition: dbpriv.enabled
name: dbpriv
repository: file://charts/dbpriv
version: 0.1.28
version: 0.1.29
- condition: dbpartition.enabled
name: dbpartition
repository: file://charts/dbpartition
version: 0.1.4
version: 0.1.5
- condition: db-simulation.enabled
name: db-simulation
repository: file://charts/db-simulation
version: 0.1.7
version: 0.1.8
- condition: dbRemoteService.enabled
name: db-remote-service
repository: file://charts/db-remote-service
version: 0.9.5
- condition: db-dns-api.enabled
name: db-dns-api
repository: file://charts/db-dns-api
version: 0.1.3
version: 0.1.4
- condition: hadb-api.enabled
name: hadb-api
repository: file://charts/hadb-api
version: 0.0.10
version: 0.0.11
- condition: db-resource.enabled
name: db-resource
repository: file://charts/db-resource
version: 0.0.7
version: 0.0.8
- condition: db-celery-service.enabled
name: db-celery-service
repository: file://charts/db-celery-service
version: 0.0.4
version: 0.0.5
- condition: slow-query-parser-service.enabled
name: slow-query-parser-service
repository: file://charts/slow-query-parser-service
version: 0.0.1
- condition: backup-server.enabled
name: backup-server
repository: file://charts/backup-server
version: 0.0.2
version: 0.0.3
- condition: backup-consumer.enabled
name: backup-consumer
repository: file://charts/backup-consumer
version: 0.0.2
version: 0.0.3
description: A Helm chart for bkdbm
name: bk-dbm
type: application
version: 1.2.0-alpha.58
appVersion: 1.2.0-alpha.58
version: 1.2.0-alpha.60
appVersion: 1.2.0-alpha.60
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/backup-consumer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: 0.0.1-alpha.4
description: A Helm chart for backup-consumer
name: backup-consumer
type: application
version: 0.0.2
version: 0.0.3
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ spec:
{{- include "backup-consumer.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
reloader.stakater.com/auto: "true"
labels:
{{- include "backup-consumer.selectorLabels" . | nindent 8 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/backup-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: 0.0.1-alpha.6
description: A Helm chart for backup-server
name: backup-server
type: application
version: 0.0.2
version: 0.0.3
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ spec:
{{- include "backup-server.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
reloader.stakater.com/auto: "true"
labels:
{{- include "backup-server.selectorLabels" . | nindent 8 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/db-celery-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: 0.0.1-alpha.8
description: A Helm chart for Kubernetes
name: db-celery-service
type: application
version: 0.0.4
version: 0.0.5
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ spec:
{{- include "db-celery-service.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
reloader.stakater.com/auto: "true"
labels:
{{- include "db-celery-service.selectorLabels" . | nindent 8 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/db-dns-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: 0.0.1-alpha.2
description: A Helm chart for Kubernetes
name: db-dns-api
version: 0.1.3
version: 0.1.4
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
annotations:
reloader.stakater.com/auto: "true"
labels:
app.kubernetes.io/name: {{ include "db-dns-api.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/db-resource/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: 0.0.1-alpha.47
description: A Helm chart for Kubernetes
name: db-resource
type: application
version: 0.0.7
version: 0.0.8
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ spec:
{{- include "db-resource.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
reloader.stakater.com/auto: "true"
labels:
{{- include "db-resource.selectorLabels" . | nindent 8 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/db-simulation/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: 0.0.1-alpha.39
description: A Helm chart for Kubernetes
name: db-simulation
type: application
version: 0.1.7
version: 0.1.8
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ spec:
{{- include "db-simulation.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
reloader.stakater.com/auto: "true"
labels:
{{- include "db-simulation.selectorLabels" . | nindent 8 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbconfig/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: 0.0.1-alpha.50
description: A Helm chart for dbconfig
name: dbconfig
type: application
version: 0.1.6
version: 0.1.7
4 changes: 1 addition & 3 deletions helm-charts/bk-dbm/charts/dbconfig/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ spec:
{{- include "dbconfig.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
reloader.stakater.com/auto: "true"
labels:
{{- include "dbconfig.selectorLabels" . | nindent 8 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ appVersion: 1.2.0-alpha.405
description: A Helm chart for dbm
name: dbm
type: application
version: 0.1.20
version: 0.1.21
30 changes: 30 additions & 0 deletions helm-charts/bk-dbm/charts/dbm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,33 @@ environment variables
{{- define "dbm.celery-worker.fullname" -}}
{{- printf "%s-%s" (include "dbm.fullname" .) "celery-worker" -}}
{{- end -}}

{{- define "dbm.initContainersWaitForSaaS" -}}
initContainers:
- name: check-saas-api
image: {{ include "dbm.migration.k8sWaitFor.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- pod
- -lapp.kubernetes.io/component={{ include "dbm.saas-api.fullname" .}}
{{- end }}

{{- define "dbm.initContainersWaitForMigrate" -}}
initContainers:
- name: check-migrate-job
image: {{ include "dbm.migration.k8sWaitFor.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- job
- {{ include "dbm.migrateJobName" . }}
{{- end }}

{{- define "dbm.container_env" -}}
env:
{{- include "dbm.envs" . | trim | nindent 2 }}
envFrom:
{{- if .Values.extraEnvVarsCM }}
- configMapRef:
name: {{ .Values.extraEnvVarsCM }}
{{- end }}
{{- end }}
20 changes: 3 additions & 17 deletions helm-charts/bk-dbm/charts/dbm/templates/apigw-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,8 @@ spec:
- -c
args:
- "python manage.py sync_saas_apigw"
env:
{{- include "dbm.envs" . | trim | nindent 12 }}
envFrom:
{{- if .Values.extraEnvVarsCM }}
- configMapRef:
name: {{ .Values.extraEnvVarsCM }}
{{- end }}
{{- include "dbm.container_env" . | nindent 10 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
initContainers:
- name: check-saas-api
image: {{ include "dbm.migration.k8sWaitFor.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- pod
- -lapp.kubernetes.io/component={{ include "dbm.saas-api.fullname" .}}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- toYaml .Values.initJob.resources | nindent 12 }}
{{- include "dbm.initContainersWaitForMigrate" . | nindent 6 }}
{{- end }}
20 changes: 3 additions & 17 deletions helm-charts/bk-dbm/charts/dbm/templates/bkcc-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,8 @@ spec:
- -c
args:
- "python manage.py services_init bkcc"
env:
{{- include "dbm.envs" . | trim | nindent 12 }}
envFrom:
{{- if .Values.extraEnvVarsCM }}
- configMapRef:
name: {{ .Values.extraEnvVarsCM }}
{{- end }}
{{- include "dbm.container_env" . | nindent 10 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
initContainers:
- name: check-saas-api
image: {{ include "dbm.migration.k8sWaitFor.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- pod
- -lapp.kubernetes.io/component={{ include "dbm.saas-api.fullname" .}}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- toYaml .Values.initJob.resources | nindent 12 }}
{{- include "dbm.initContainersWaitForMigrate" . | nindent 6 }}
{{- end }}
Loading

0 comments on commit a6fe4b6

Please sign in to comment.