Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proxysql] improve poddisruptionbudgets for core and satellites #294

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dysnix/proxysql/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
appVersion: "2.5.5"
description: ProxySQL Helm chart for Kubernetes
name: proxysql
version: 0.11.2
version: 0.12.0
home: https://www.proxysql.com/
sources:
- https://github.com/dysnix/charts
Expand Down
26 changes: 0 additions & 26 deletions dysnix/proxysql/templates/pdb.yaml

This file was deleted.

48 changes: 48 additions & 0 deletions dysnix/proxysql/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
{{- if .Values.proxysql_cluster.satellite.enabled }}
{{- if or .Values.proxysql_cluster.satellite.podDisruptionBudget .Values.podDisruptionBudget }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "proxysql.fullname" . }}-satellite
labels:
{{- include "proxysql.labels" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- toYaml .Values.commonLabels | nindent 4 }}
{{- end }}
annotations:
helm.sh/hook-weight: "-10"
{{- if .Values.commonAnnotations }}
{{- toYaml .Values.commonAnnotations | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "proxysql.satellite.selectorLabels" . | nindent 6 }}
{{- toYaml (.Values.proxysql_cluster.satellite.podDisruptionBudget | default .Values.podDisruptionBudget) | nindent 2 }}
{{- end }}
{{- end }}
---
{{- if and .Values.proxysql_cluster.core.enabled .Values.proxysql_cluster.enabled }}
{{- if or .Values.proxysql_cluster.core.podDisruptionBudget .Values.podDisruptionBudget }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "proxysql.fullname" . }}-core
labels:
{{- include "proxysql.labels" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- toYaml .Values.commonLabels | nindent 4 }}
{{- end }}
annotations:
helm.sh/hook-weight: "-10"
{{- if .Values.commonAnnotations }}
{{- toYaml .Values.commonAnnotations | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "proxysql.core.selectorLabels" . | nindent 6 }}
{{- toYaml (.Values.proxysql_cluster.core.podDisruptionBudget | default .Values.podDisruptionBudget) | nindent 2 }}
{{- end }}
{{- end }}
15 changes: 11 additions & 4 deletions dysnix/proxysql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ podLabels: {}
## Specify pod disruption budget
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
##
podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1
podDisruptionBudget: {}
# minAvailable: 0 # required count of pods to remain available, even without the evicted pod.
# maxUnavailable: 0 # Count of pods that may be unavailable after eviction.

startupProbe:
enabled: false
Expand Down Expand Up @@ -278,6 +277,10 @@ proxysql_cluster:
# Restart ProxySQL if crashes
exit_on_error: false

podDisruptionBudget: {}
# minAvailable: 0 # required count of pods to remain available, even without the evicted pod.
# maxUnavailable: 0 # Count of pods that may be unavailable after eviction.

statefullset:
nodeSelector: {}
tolerations: []
Expand Down Expand Up @@ -309,6 +312,10 @@ proxysql_cluster:
# Restart ProxySQL if crashes
exit_on_error: false

podDisruptionBudget: {}
# minAvailable: 0 # required count of pods to remain available, even without the evicted pod.
# maxUnavailable: 0 # Count of pods that may be unavailable after eviction.

daemonset:
nodeSelector: {}
tolerations: []
Expand Down
Loading