Skip to content

Commit

Permalink
feat(helm-charts): init job 添加 resources #1534
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 authored and iSecloud committed Oct 26, 2023
1 parent c4c58a7 commit a88b88b
Show file tree
Hide file tree
Showing 29 changed files with 250 additions and 49 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/commit_message_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Commit Message Check

on: [workflow_dispatch, push, pull_request]

jobs:
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- name: Check Commit Message
uses: gsactions/commit-message-checker@v2
with:
pattern: '^(feat|fix|refactor|docs|test|style|chore)(\(.+\))?: .{1,100} #\d+$'
error: 'Commit message is not standard.'

27 changes: 27 additions & 0 deletions .github/workflows/helm_template_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Helm Template Check

on:
workflow_dispatch:
push:
paths:
- "helm-charts/**"
pull_request:
paths:
- "helm-charts/**"

jobs:
helm-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: helm-check
run: |-
cd ./helm-charts/bk-dbm
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add stakater-charts https://stakater.github.io/stakater-charts
helm dependency build
helm template . -f values.yaml
exit $?
24 changes: 12 additions & 12 deletions helm-charts/bk-dbm/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies:
version: 1.13.0
- name: mysql
repository: https://charts.bitnami.com/bitnami
version: 9.14.0
version: 9.14.1
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 16.13.2
Expand All @@ -13,25 +13,25 @@ dependencies:
version: 9.5.6
- name: reloader
repository: https://stakater.github.io/stakater-charts
version: 1.0.46
version: 1.0.48
- name: grafana
repository: file://./charts/grafana
version: 7.9.8
- name: dbm
repository: file://charts/dbm
version: 0.1.22
version: 0.1.23
- name: dbconfig
repository: file://charts/dbconfig
version: 0.1.7
version: 0.1.8
- name: dbpriv
repository: file://charts/dbpriv
version: 0.1.29
version: 0.1.30
- name: dbpartition
repository: file://charts/dbpartition
version: 0.1.5
version: 0.1.6
- name: db-simulation
repository: file://charts/db-simulation
version: 0.1.8
version: 0.1.9
- name: db-remote-service
repository: file://charts/db-remote-service
version: 0.9.5
Expand All @@ -43,18 +43,18 @@ dependencies:
version: 0.0.11
- name: db-resource
repository: file://charts/db-resource
version: 0.0.8
version: 0.0.9
- name: db-celery-service
repository: file://charts/db-celery-service
version: 0.0.5
version: 0.0.6
- name: slow-query-parser-service
repository: file://charts/slow-query-parser-service
version: 0.0.1
version: 0.0.2
- name: backup-server
repository: file://charts/backup-server
version: 0.0.3
- name: backup-consumer
repository: file://charts/backup-consumer
version: 0.0.3
digest: sha256:fc6656e9c319a982cb14882ecb6dd68d6516569b5882eb79c9033e1c2050c73a
generated: "2023-10-25T15:54:18.652012+08:00"
digest: sha256:2ea68d751cc7a6cd16d67e194850ad831687cc31c334b5a78bf603cef7751503
generated: "2023-10-26T11:47:16.130137+08:00"
22 changes: 11 additions & 11 deletions helm-charts/bk-dbm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ dependencies:
- condition: dbm.enabled
name: dbm
repository: file://charts/dbm
version: 0.1.22
version: 0.1.23
- condition: dbconfig.enabled
name: dbconfig
repository: file://charts/dbconfig
version: 0.1.7
version: 0.1.8
- condition: dbpriv.enabled
name: dbpriv
repository: file://charts/dbpriv
version: 0.1.29
version: 0.1.30
- condition: dbpartition.enabled
name: dbpartition
repository: file://charts/dbpartition
version: 0.1.5
version: 0.1.6
- condition: db-simulation.enabled
name: db-simulation
repository: file://charts/db-simulation
version: 0.1.8
- condition: dbRemoteService.enabled
version: 0.1.9
- condition: db-remote-service.enabled
name: db-remote-service
repository: file://charts/db-remote-service
version: 0.9.5
Expand All @@ -59,15 +59,15 @@ dependencies:
- condition: db-resource.enabled
name: db-resource
repository: file://charts/db-resource
version: 0.0.8
version: 0.0.9
- condition: db-celery-service.enabled
name: db-celery-service
repository: file://charts/db-celery-service
version: 0.0.5
version: 0.0.6
- condition: slow-query-parser-service.enabled
name: slow-query-parser-service
repository: file://charts/slow-query-parser-service
version: 0.0.1
version: 0.0.2
- condition: backup-server.enabled
name: backup-server
repository: file://charts/backup-server
Expand All @@ -79,5 +79,5 @@ dependencies:
description: A Helm chart for bkdbm
name: bk-dbm
type: application
version: 1.2.0-alpha.62
appVersion: 1.2.0-alpha.62
version: 1.2.0-alpha.63
appVersion: 1.2.0-alpha.63
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.5
version: 0.0.6
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ spec:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path | default "/ping"}}
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 30}}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5}}
successThreshold: {{ .Values.livenessProbe.successThreshold | default 6}}
failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 1}}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.path | default "/ping"}}
port: http
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.readinessProbe.periodSeconds | default 30}}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 5}}
successThreshold: {{ .Values.readinessProbe.successThreshold | default 6}}
failureThreshold: {{ .Values.readinessProbe.failureThreshold | default 1}}
envFrom:
{{- if .Values.extraEnvVarsCM }}
- configMapRef:
Expand Down
4 changes: 4 additions & 0 deletions helm-charts/bk-dbm/charts/db-celery-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ nodeSelector: {}
tolerations: []

affinity: {}

livenessProbe: {}

readinessProbe: {}
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.8
version: 0.0.9
18 changes: 18 additions & 0 deletions helm-charts/bk-dbm/charts/db-resource/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ spec:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path | default "/ping"}}
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 30}}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5}}
successThreshold: {{ .Values.livenessProbe.successThreshold | default 6}}
failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 1}}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.path | default "/ping"}}
port: http
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.readinessProbe.periodSeconds | default 30}}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 5}}
successThreshold: {{ .Values.readinessProbe.successThreshold | default 6}}
failureThreshold: {{ .Values.readinessProbe.failureThreshold | default 1}}
volumeMounts:
-
name: config-volume
Expand Down
4 changes: 4 additions & 0 deletions helm-charts/bk-dbm/charts/db-resource/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ nodeSelector: {}
tolerations: []

affinity: {}

livenessProbe: {}

readinessProbe: {}
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.8
version: 0.1.9
18 changes: 18 additions & 0 deletions helm-charts/bk-dbm/charts/db-simulation/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ spec:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path | default "/ping"}}
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 30}}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5}}
successThreshold: {{ .Values.livenessProbe.successThreshold | default 6}}
failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 1}}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.path | default "/ping"}}
port: http
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.readinessProbe.periodSeconds | default 30}}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 5}}
successThreshold: {{ .Values.readinessProbe.successThreshold | default 6}}
failureThreshold: {{ .Values.readinessProbe.failureThreshold | default 1}}
envFrom:
{{- if .Values.extraEnvVarsCM }}
- configMapRef:
Expand Down
4 changes: 4 additions & 0 deletions helm-charts/bk-dbm/charts/db-simulation/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ nodeSelector: {}
tolerations: []

affinity: {}

livenessProbe: {}

readinessProbe: {}
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.7
version: 0.1.8
18 changes: 18 additions & 0 deletions helm-charts/bk-dbm/charts/dbconfig/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ spec:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path | default "/ping"}}
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 30}}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5}}
successThreshold: {{ .Values.livenessProbe.successThreshold | default 6}}
failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 1}}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.path | default "/ping"}}
port: http
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.readinessProbe.periodSeconds | default 30}}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 5}}
successThreshold: {{ .Values.readinessProbe.successThreshold | default 6}}
failureThreshold: {{ .Values.readinessProbe.failureThreshold | default 1}}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
Expand Down
4 changes: 4 additions & 0 deletions helm-charts/bk-dbm/charts/dbconfig/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ nodeSelector: {}
tolerations: []

affinity: {}

livenessProbe: {}

readinessProbe: {}
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.412
description: A Helm chart for dbm
name: dbm
type: application
version: 0.1.22
version: 0.1.23
2 changes: 2 additions & 0 deletions helm-charts/bk-dbm/charts/dbm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ initContainers:
args:
- job
- {{ include "dbm.migrateJobName" . }}
resources:
{{- toYaml .Values.initJob.resources | nindent 6 }}
{{- end }}

{{- define "dbm.container_env" -}}
Expand Down
24 changes: 15 additions & 9 deletions helm-charts/bk-dbm/charts/dbm/templates/deployments/saas-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,24 @@ spec:
- name: http
containerPort: 8000
protocol: TCP

{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path }}
path: {{ .Values.livenessProbe.path | default "/ping"}}
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 30}}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5}}
successThreshold: {{ .Values.livenessProbe.successThreshold | default 6}}
failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 1}}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.path | default "/ping"}}
port: http
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.readinessProbe.periodSeconds | default 30}}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 5}}
successThreshold: {{ .Values.readinessProbe.successThreshold | default 6}}
failureThreshold: {{ .Values.readinessProbe.failureThreshold | default 1}}
{{- include "dbm.container_env" . | nindent 10 }}
resources:
{{- toYaml .Values.saas.api.resources | nindent 12 }}
Expand Down
11 changes: 3 additions & 8 deletions helm-charts/bk-dbm/charts/dbm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@ affinity: {}

securityContext: {}

livenessProbe:
enabled: true
path: /ping
initialDelaySeconds: 5
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1
livenessProbe: {}

readinessProbe: {}

initJob:
resources: {}
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbpartition/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: dbpartition
description: A Helm chart for db partition service
type: application
version: 0.1.5
version: 0.1.6
appVersion: 0.0.1-alpha.116
Loading

0 comments on commit a88b88b

Please sign in to comment.