Skip to content

Commit

Permalink
make livenessprobe and readnessprobe configurable (#80)
Browse files Browse the repository at this point in the history
* make livenessprobe and readnessprobe configurable

* Add livenessProbe and readinessProbe configuration to worker deployment
  • Loading branch information
LeoQuote authored Apr 25, 2024
1 parent 45c9bc6 commit dc9b040
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 53 deletions.
2 changes: 1 addition & 1 deletion charts/dify/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.3.3
version: 0.3.4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
78 changes: 26 additions & 52 deletions charts/dify/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,14 @@ spec:
- name: http
containerPort: {{ .Values.api.containerPort }}
protocol: TCP
{{- with .Values.api.livenessProbe }}
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 30
successThreshold: 1
failureThreshold: 2
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.api.readinessProbe }}
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
timeoutSeconds: 5
periodSeconds: 5
successThreshold: 1
failureThreshold: 10
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.api.resources | nindent 12 }}
{{- with .Values.volumes }}
Expand Down Expand Up @@ -166,6 +156,14 @@ spec:
volumeMounts:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.worker.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.worker.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.worker.resources | nindent 12 }}
{{- with .Values.volumes }}
Expand Down Expand Up @@ -237,30 +235,14 @@ spec:
- name: http
containerPort: {{ .Values.frontend.containerPort }}
protocol: TCP
{{- with .Values.frontend.livenessProbe }}
livenessProbe:
httpGet:
path: /apps
port: http
httpHeaders:
- name: accept-language
value: en
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 30
successThreshold: 1
failureThreshold: 2
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.frontend.readinessProbe}}
readinessProbe:
httpGet:
path: /apps
port: http
httpHeaders:
- name: accept-language
value: en
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 5
successThreshold: 1
failureThreshold: 10
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.frontend.resources | nindent 12 }}
{{- with .Values.frontend.nodeSelector }}
Expand Down Expand Up @@ -337,22 +319,14 @@ spec:
- name: http
containerPort: {{ .Values.sandbox.containerPort }}
protocol: TCP
{{- with .Values.sandbox.livenessProbe }}
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 30
successThreshold: 1
failureThreshold: 2
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.sandbox.readinessProbe}}
readinessProbe:
tcpSocket:
port: http
initialDelaySeconds: 1
timeoutSeconds: 5
periodSeconds: 5
successThreshold: 1
failureThreshold: 10
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.sandbox.resources | nindent 12 }}
{{- with .Values.sandbox.nodeSelector }}
Expand Down
66 changes: 66 additions & 0 deletions charts/dify/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,31 @@ frontend:
tolerations: []

affinity: {}
livenessProbe:
httpGet:
path: /apps
port: http
httpHeaders:
- name: accept-language
value: en
initialDelaySeconds: 3
timeoutSeconds: 5
periodSeconds: 30
successThreshold: 1
failureThreshold: 2
readinessProbe:
httpGet:
path: /apps
port: http
httpHeaders:
- name: accept-language
value: en
initialDelaySeconds: 3
timeoutSeconds: 5
periodSeconds: 30
successThreshold: 1
failureThreshold: 2


api:
replicaCount: 1
Expand Down Expand Up @@ -184,6 +209,25 @@ api:

affinity: {}

livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 30
successThreshold: 1
failureThreshold: 2
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 10
timeoutSeconds: 5
periodSeconds: 5
successThreshold: 1
failureThreshold: 10

worker:
replicaCount: 1

Expand Down Expand Up @@ -234,6 +278,10 @@ worker:

affinity: {}

# livenessprobe for worker, default no probe
livenessProbe: {}
readinessProbe: {}

sandbox:
replicaCount: 1
# please change to avoid abuse
Expand Down Expand Up @@ -298,6 +346,24 @@ sandbox:

affinity: {}


readinessProbe:
tcpSocket:
port: http
initialDelaySeconds: 1
timeoutSeconds: 5
periodSeconds: 5
successThreshold: 1
failureThreshold: 10
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 30
successThreshold: 1
failureThreshold: 2

##### dependencies #####

redis:
Expand Down

0 comments on commit dc9b040

Please sign in to comment.