improve k8s probes templating in helm chart (#4805)

This commit is contained in:
fibbanachi 2023-09-02 23:26:27 +03:00 committed by GitHub
parent e6385e5e8b
commit 7374ceecda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 175 additions and 56 deletions

View file

@ -224,26 +224,30 @@ spec:
name: metrics name: metrics
- containerPort: {{ .Values.filer.grpcPort }} - containerPort: {{ .Values.filer.grpcPort }}
#name: swfs-filer-grpc #name: swfs-filer-grpc
{{- if .Values.filer.readinessProbe.enabled }}
readinessProbe: readinessProbe:
httpGet: httpGet:
path: / path: {{ .Values.filer.readinessProbe.httpGet.path }}
port: {{ .Values.filer.port }} port: {{ .Values.filer.port }}
scheme: HTTP scheme: {{ .Values.filer.readinessProbe.scheme }}
initialDelaySeconds: 10 initialDelaySeconds: {{ .Values.filer.readinessProbe.initialDelaySeconds }}
periodSeconds: 15 periodSeconds: {{ .Values.filer.readinessProbe.periodSeconds }}
successThreshold: 1 successThreshold: {{ .Values.filer.readinessProbe.successThreshold }}
failureThreshold: 100 failureThreshold: {{ .Values.filer.readinessProbe.failureThreshold }}
timeoutSeconds: 10 timeoutSeconds: {{ .Values.filer.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.filer.livenessProbe.enabled }}
livenessProbe: livenessProbe:
httpGet: httpGet:
path: / path: {{ .Values.filer.livenessProbe.httpGet.path }}
port: {{ .Values.filer.port }} port: {{ .Values.filer.port }}
scheme: HTTP scheme: {{ .Values.filer.livenessProbe.scheme }}
initialDelaySeconds: 20 initialDelaySeconds: {{ .Values.filer.livenessProbe.initialDelaySeconds }}
periodSeconds: 30 periodSeconds: {{ .Values.filer.livenessProbe.periodSeconds }}
successThreshold: 1 successThreshold: {{ .Values.filer.livenessProbe.successThreshold }}
failureThreshold: 5 failureThreshold: {{ .Values.filer.livenessProbe.failureThreshold }}
timeoutSeconds: 10 timeoutSeconds: {{ .Values.filer.livenessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.filer.resources }} {{- if .Values.filer.resources }}
resources: resources:
{{ tpl .Values.filer.resources . | nindent 12 | trim }} {{ tpl .Values.filer.resources . | nindent 12 | trim }}

View file

@ -177,26 +177,30 @@ spec:
{{- end }} {{- end }}
- containerPort: {{ .Values.master.grpcPort }} - containerPort: {{ .Values.master.grpcPort }}
#name: swfs-master-grpc #name: swfs-master-grpc
{{- if .Values.master.readinessProbe.enabled }}
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /cluster/status path: {{ .Values.master.readinessProbe.httpGet.path }}
port: {{ .Values.master.port }} port: {{ .Values.master.port }}
scheme: HTTP scheme: {{ .Values.master.readinessProbe.scheme }}
initialDelaySeconds: 10 initialDelaySeconds: {{ .Values.master.readinessProbe.initialDelaySeconds }}
periodSeconds: 45 periodSeconds: {{ .Values.master.readinessProbe.periodSeconds }}
successThreshold: 2 successThreshold: {{ .Values.master.readinessProbe.successThreshold }}
failureThreshold: 100 failureThreshold: {{ .Values.master.readinessProbe.failureThreshold }}
timeoutSeconds: 10 timeoutSeconds: {{ .Values.master.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.master.livenessProbe.enabled }}
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /cluster/status path: {{ .Values.master.livenessProbe.httpGet.path }}
port: {{ .Values.master.port }} port: {{ .Values.master.port }}
scheme: HTTP scheme: {{ .Values.master.livenessProbe.scheme }}
initialDelaySeconds: 20 initialDelaySeconds: {{ .Values.master.livenessProbe.initialDelaySeconds }}
periodSeconds: 30 periodSeconds: {{ .Values.master.livenessProbe.periodSeconds }}
successThreshold: 1 successThreshold: {{ .Values.master.livenessProbe.successThreshold }}
failureThreshold: 4 failureThreshold: {{ .Values.master.livenessProbe.failureThreshold }}
timeoutSeconds: 10 timeoutSeconds: {{ .Values.master.livenessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.master.resources }} {{- if .Values.master.resources }}
resources: resources:
{{ tpl .Values.master.resources . | nindent 12 | trim }} {{ tpl .Values.master.resources . | nindent 12 | trim }}

View file

@ -146,26 +146,30 @@ spec:
- containerPort: {{ .Values.s3.metricsPort }} - containerPort: {{ .Values.s3.metricsPort }}
name: "metrics" name: "metrics"
{{- end }} {{- end }}
{{- if .Values.s3.readinessProbe.enabled }}
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /status path: {{ .Values.s3.readinessProbe.httpGet.path }}
port: {{ .Values.s3.port }} port: {{ .Values.s3.port }}
scheme: HTTP scheme: {{ .Values.s3.readinessProbe.scheme }}
initialDelaySeconds: 15 initialDelaySeconds: {{ .Values.s3.readinessProbe.initialDelaySeconds }}
periodSeconds: 15 periodSeconds: {{ .Values.s3.readinessProbe.periodSeconds }}
successThreshold: 1 successThreshold: {{ .Values.s3.readinessProbe.successThreshold }}
failureThreshold: 100 failureThreshold: {{ .Values.s3.readinessProbe.failureThreshold }}
timeoutSeconds: 10 timeoutSeconds: {{ .Values.s3.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.s3.livenessProbe.enabled }}
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /status path: {{ .Values.s3.livenessProbe.httpGet.path }}
port: {{ .Values.s3.port }} port: {{ .Values.s3.port }}
scheme: HTTP scheme: {{ .Values.s3.livenessProbe.scheme }}
initialDelaySeconds: 20 initialDelaySeconds: {{ .Values.s3.livenessProbe.initialDelaySeconds }}
periodSeconds: 60 periodSeconds: {{ .Values.s3.livenessProbe.periodSeconds }}
successThreshold: 1 successThreshold: {{ .Values.s3.livenessProbe.successThreshold }}
failureThreshold: 20 failureThreshold: {{ .Values.s3.livenessProbe.failureThreshold }}
timeoutSeconds: 10 timeoutSeconds: {{ .Values.s3.livenessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.s3.resources }} {{- if .Values.s3.resources }}
resources: resources:
{{ tpl .Values.s3.resources . | nindent 12 | trim }} {{ tpl .Values.s3.resources . | nindent 12 | trim }}

View file

@ -183,26 +183,30 @@ spec:
{{- end }} {{- end }}
- containerPort: {{ .Values.volume.grpcPort }} - containerPort: {{ .Values.volume.grpcPort }}
name: swfs-vol-grpc name: swfs-vol-grpc
{{- if .Values.volume.readinessProbe.enabled }}
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /status path: {{ .Values.volume.readinessProbe.httpGet.path }}
port: {{ .Values.volume.port }} port: {{ .Values.volume.port }}
scheme: HTTP scheme: {{ .Values.volume.readinessProbe.scheme }}
initialDelaySeconds: 15 initialDelaySeconds: {{ .Values.volume.readinessProbe.initialDelaySeconds }}
periodSeconds: 15 periodSeconds: {{ .Values.volume.readinessProbe.periodSeconds }}
successThreshold: 1 successThreshold: {{ .Values.volume.readinessProbe.successThreshold }}
failureThreshold: 100 failureThreshold: {{ .Values.volume.readinessProbe.failureThreshold }}
timeoutSeconds: 30 timeoutSeconds: {{ .Values.volume.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.volume.livenessProbe.enabled }}
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /status path: {{ .Values.volume.livenessProbe.httpGet.path }}
port: {{ .Values.volume.port }} port: {{ .Values.volume.port }}
scheme: HTTP scheme: {{ .Values.volume.livenessProbe.scheme }}
initialDelaySeconds: 20 initialDelaySeconds: {{ .Values.volume.livenessProbe.initialDelaySeconds }}
periodSeconds: 90 periodSeconds: {{ .Values.volume.livenessProbe.periodSeconds }}
successThreshold: 1 successThreshold: {{ .Values.volume.livenessProbe.successThreshold }}
failureThreshold: 4 failureThreshold: {{ .Values.volume.livenessProbe.failureThreshold }}
timeoutSeconds: 30 timeoutSeconds: {{ .Values.volume.livenessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.volume.resources }} {{- if .Values.volume.resources }}
resources: resources:
{{ tpl .Values.volume.resources . | nindent 12 | trim }} {{ tpl .Values.volume.resources . | nindent 12 | trim }}

View file

@ -160,6 +160,32 @@ master:
WEED_MASTER_VOLUME_GROWTH_COPY_3: 3 WEED_MASTER_VOLUME_GROWTH_COPY_3: 3
WEED_MASTER_VOLUME_GROWTH_COPY_OTHER: 1 WEED_MASTER_VOLUME_GROWTH_COPY_OTHER: 1
# used to configure livenessProbe on master-server containers
#
livenessProbe:
enabled: true
httpGet:
path: /cluster/status
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 30
successThreshold: 1
failureThreshold: 4
timeoutSeconds: 10
# used to configure readinessProbe on master-server containers
#
readinessProbe:
enabled: true
httpGet:
path: /cluster/status
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 45
successThreshold: 2
failureThreshold: 100
timeoutSeconds: 10
volume: volume:
enabled: true enabled: true
repository: null repository: null
@ -277,6 +303,32 @@ volume:
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
serviceAccountName: "" serviceAccountName: ""
# used to configure livenessProbe on volume-server containers
#
livenessProbe:
enabled: true
httpGet:
path: /status
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 90
successThreshold: 1
failureThreshold: 4
timeoutSeconds: 30
# used to configure readinessProbe on volume-server containers
#
readinessProbe:
enabled: true
httpGet:
path: /status
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
timeoutSeconds: 30
filer: filer:
enabled: true enabled: true
repository: null repository: null
@ -431,6 +483,31 @@ filer:
# directories under this folder will be automatically creating a separate bucket # directories under this folder will be automatically creating a separate bucket
WEED_FILER_BUCKETS_FOLDER: "/buckets" WEED_FILER_BUCKETS_FOLDER: "/buckets"
# used to configure livenessProbe on filer containers
#
livenessProbe:
enabled: true
httpGet:
path: /
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 30
successThreshold: 1
failureThreshold: 5
timeoutSeconds: 10
# used to configure readinessProbe on filer containers
#
readinessProbe:
enabled: true
httpGet:
path: /
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
timeoutSeconds: 10
# secret env variables # secret env variables
secretExtraEnvironmentVars: [] secretExtraEnvironmentVars: []
@ -518,6 +595,32 @@ s3:
storageClass: "" storageClass: ""
hostPathPrefix: /storage hostPathPrefix: /storage
# used to configure livenessProbe on s3 containers
#
livenessProbe:
enabled: true
httpGet:
path: /status
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 60
successThreshold: 1
failureThreshold: 20
timeoutSeconds: 10
# used to configure readinessProbe on s3 containers
#
readinessProbe:
enabled: true
httpGet:
path: /status
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
timeoutSeconds: 10
certificates: certificates:
commonName: "SeaweedFS CA" commonName: "SeaweedFS CA"
ipAddresses: [] ipAddresses: []