Skip to content

Commit

Permalink
Merge pull request #2307 from jsonwan/github_perf/k8s
Browse files Browse the repository at this point in the history
perf: 优化K8s健康检测探针参数 #2270
  • Loading branch information
wangyu096 authored Aug 4, 2023
2 parents 1c816b8 + 1412787 commit 41c8d3c
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 180 deletions.
33 changes: 33 additions & 0 deletions support-files/kubernetes/charts/bk-job/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -620,3 +620,36 @@ tls:
{{- end -}}
{{- end -}}


{{/*
Return the Job Service Probes Config
*/}}
{{- define "job.service.probes" -}}
startupProbe:
httpGet:
path: /actuator/health/liveness
port: {{ .port }}
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: {{ .port }}
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 2
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: {{ .port }}
initialDelaySeconds: 10
periodSeconds: 3
timeoutSeconds: 3
failureThreshold: 1
successThreshold: 1
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,7 @@ spec:
value: /etc/secrets
- name: spring.cloud.kubernetes.configuration.watcher.refreshDelay
value: "1000"
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 200
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 200
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
{{- include "job.service.probes" ( dict "port" "http" "context" . ) | nindent 10 }}
resources:
{{- toYaml .Values.k8sConfigWatcherConfig.resources | nindent 12 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,7 @@ spec:
- name: http
containerPort: {{ .Values.analysisConfig.containerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
{{- include "job.service.probes" ( dict "port" "http" "context" . ) | nindent 10 }}
resources:
{{- toYaml .Values.analysisConfig.resources | nindent 12 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,7 @@ spec:
- name: http
containerPort: {{ .Values.backupConfig.containerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
{{- include "job.service.probes" ( dict "port" "http" "context" . ) | nindent 10 }}
resources:
{{- toYaml .Values.backupConfig.resources | nindent 12 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,7 @@ spec:
- name: http
containerPort: {{ .Values.crontabConfig.containerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
{{- include "job.service.probes" ( dict "port" "http" "context" . ) | nindent 10 }}
resources:
{{- toYaml .Values.crontabConfig.resources | nindent 12 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,7 @@ spec:
- name: http
containerPort: {{ .Values.executeConfig.containerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
{{- include "job.service.probes" ( dict "port" "http" "context" . ) | nindent 10 }}
resources:
{{- toYaml .Values.executeConfig.resources | nindent 12 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,7 @@ spec:
- name: http
containerPort: {{ .Values.fileGatewayConfig.containerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
{{- include "job.service.probes" ( dict "port" "http" "context" . ) | nindent 10 }}
resources:
{{- toYaml .Values.fileGatewayConfig.resources | nindent 12 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,7 @@ spec:
- name: http
containerPort: {{ .Values.fileWorkerConfig.containerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
{{- include "job.service.probes" ( dict "port" "http" "context" . ) | nindent 10 }}
resources:
{{- toYaml .Values.fileWorkerConfig.resources | nindent 12 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,7 @@ spec:
- name: management
containerPort: {{ .Values.gatewayConfig.containerPort.management }}
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: management
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: management
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
{{- include "job.service.probes" ( dict "port" "management" "context" . ) | nindent 10 }}
resources:
{{- toYaml .Values.gatewayConfig.resources | nindent 12 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,7 @@ spec:
- name: http
containerPort: {{ .Values.logsvrConfig.containerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
{{- include "job.service.probes" ( dict "port" "http" "context" . ) | nindent 10 }}
resources:
{{- toYaml .Values.logsvrConfig.resources | nindent 12 }}
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,7 @@ spec:
- name: http
containerPort: {{ .Values.manageConfig.containerPort }}
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
readinessProbe:
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
{{- include "job.service.probes" ( dict "port" "http" "context" . ) | nindent 10 }}
resources:
{{- toYaml .Values.manageConfig.resources | nindent 12 }}
volumeMounts:
Expand Down

0 comments on commit 41c8d3c

Please sign in to comment.