Skip to content

Commit

Permalink
perf: 容器化-Job、InitContainer等资源增加resources限制参数 TencentBlueKing#1551
Browse files Browse the repository at this point in the history
给所有workload添加resources limit
  • Loading branch information
jsonwan committed Dec 2, 2022
1 parent f0e3793 commit 4e53556
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions support-files/kubernetes/charts/bk-job/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,8 @@ Return the Job InitContainer WaitForMigration Content
- name: "migration-init"
image: {{ include "common.images.image" (dict "imageRoot" .Values.waitForMigration.image "global" .Values.global) }}
imagePullPolicy: {{ .Values.waitForMigration.image.pullPolicy }}
resources:
{{- toYaml .Values.waitForMigration.resources | nindent 4 }}
args:
- "job-wr"
- {{ printf "%s-migration-%d" (include "common.names.fullname" .) .Release.Revision | quote }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ spec:
image: {{ include "common.images.image" (dict "imageRoot" .Values.migrationInit.image "global" .Values.global) }}
imagePullPolicy: {{ .Values.migrationInit.image.pullPolicy }}
command: ['sh', '-c', 'until nc -zw3 {{ include "job.mariadb.host" . }} {{ include "job.mariadb.port" . }}; do echo waiting for mariadb; sleep 2; done']
resources:
{{- toYaml .Values.migrationInit.resources | nindent 12 }}
containers:
- name: "job-migration"
image: {{ include "job-migration.image" . }}
Expand Down
18 changes: 18 additions & 0 deletions support-files/kubernetes/charts/bk-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ gatewayConfig:
hostAliases: []
resources:
limits:
cpu: 1024m
memory: 1Gi
requests:
cpu: 125m
Expand Down Expand Up @@ -752,6 +753,7 @@ manageConfig:
hostAliases: []
resources:
limits:
cpu: 1024m
memory: 1Gi
requests:
cpu: 125m
Expand Down Expand Up @@ -810,6 +812,7 @@ executeConfig:
hostAliases: []
resources:
limits:
cpu: 2048m
memory: 2Gi
requests:
cpu: 250m
Expand Down Expand Up @@ -861,6 +864,7 @@ crontabConfig:
hostAliases: []
resources:
limits:
cpu: 1024m
memory: 1Gi
requests:
cpu: 125m
Expand Down Expand Up @@ -921,6 +925,7 @@ logsvrConfig:
hostAliases: []
resources:
limits:
cpu: 1024m
memory: 1Gi
requests:
cpu: 125m
Expand Down Expand Up @@ -976,6 +981,7 @@ backupConfig:
hostAliases: []
resources:
limits:
cpu: 1024m
memory: 1Gi
requests:
cpu: 125m
Expand Down Expand Up @@ -1026,6 +1032,7 @@ analysisConfig:
hostAliases: []
resources:
limits:
cpu: 1024m
memory: 1Gi
requests:
cpu: 125m
Expand Down Expand Up @@ -1076,6 +1083,7 @@ fileGatewayConfig:
hostAliases: []
resources:
limits:
cpu: 1024m
memory: 1Gi
requests:
cpu: 125m
Expand Down Expand Up @@ -1132,6 +1140,7 @@ fileWorkerConfig:
hostAliases: []
resources:
limits:
cpu: 1024m
memory: 1Gi
requests:
cpu: 125m
Expand Down Expand Up @@ -1207,6 +1216,7 @@ frontendConfig:
hostAliases: []
resources:
limits:
cpu: 1024m
memory: 1Gi
requests:
cpu: 125m
Expand Down Expand Up @@ -1276,6 +1286,10 @@ migrationInit:
tag: 1.34.0
# 镜像拉取策略
pullPolicy: IfNotPresent
resources:
limits:
cpu: 1024m
memory: 1Gi

## 其他服务Pod等待migration完成的init任务配置
waitForMigration:
Expand All @@ -1288,3 +1302,7 @@ waitForMigration:
tag: v1.5.1
# 镜像拉取策略
pullPolicy: IfNotPresent
resources:
limits:
cpu: 1024m
memory: 1Gi

0 comments on commit 4e53556

Please sign in to comment.