Skip to content

Commit

Permalink
Add code executor pdb + prestop hook for backend
Browse files Browse the repository at this point in the history
  • Loading branch information
june-xu committed Dec 16, 2024
1 parent 43bd3c7 commit cbba1d6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/retool/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: retool
description: A Helm chart for Kubernetes
type: application
version: 6.2.15
version: 6.2.16
maintainers:
- name: Retool Engineering
email: [email protected]
Expand Down
6 changes: 6 additions & 0 deletions charts/retool/templates/deployment_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ spec:
successThreshold: {{ .Values.readinessProbe.successThreshold }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
{{- end }}
{{- if .Values.preStopHook.enabled }}
lifecycle:
preStop:
exec:
command: ["sleep", "30"]
{{- end }}
{{- if .Values.startupProbe.enabled }}
startupProbe:
httpGet:
Expand Down
16 changes: 16 additions & 0 deletions charts/retool/templates/deployment_code_executor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,19 @@ spec:
targetPort: 3004
name: http-server
{{- end }}
---
{{- if .Values.podDisruptionBudget }}
{{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.Version -}}
apiVersion: policy/v1
{{- else -}}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ template "retool.codeExecutor.name" . }}
spec:
{{ toYaml .Values.podDisruptionBudget }}
selector:
matchLabels:
{{- include "retool.codeExecutor.selectorLabels" . | nindent 6 }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/retool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ readinessProbe:
periodSeconds: 10
successThreshold: 5

preStopHook:
enabled: true

# To avoid increasing livenessProbe initialDelaySeconds the good practice is to use a startupProbe.
startupProbe:
enabled: false
Expand Down
3 changes: 3 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ readinessProbe:
periodSeconds: 10
successThreshold: 5

preStopHook:
enabled: true

# To avoid increasing livenessProbe initialDelaySeconds the good practice is to use a startupProbe.
startupProbe:
enabled: false
Expand Down

0 comments on commit cbba1d6

Please sign in to comment.