Skip to content

Commit

Permalink
Merge pull request #14 from klicktipp/feature/spread-deployments
Browse files Browse the repository at this point in the history
Feature/spread deployments
  • Loading branch information
noudAndi authored Jun 27, 2024
2 parents 8cdca79 + 621f9ad commit 9df3747
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/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: 1.0.0
version: 1.1.0
home: https://www.proxysql.com/
sources:
- https://github.com/dysnix/charts
Expand Down
1 change: 1 addition & 0 deletions charts/proxysql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ release: {{ .Release.Name }}
helm.sh/chart: {{ include "proxysql.chart" . }}
app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: {{ include "proxysql.fullname" . }}
{{- end -}}

{{/*
Expand Down
20 changes: 19 additions & 1 deletion charts/proxysql/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,21 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- with .Values.affinity }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.podAntiAffinity.enabled }}
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- {{ include "proxysql.fullname" . }}
topologyKey: kubernetes.io/hostname
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand All @@ -177,6 +188,13 @@ spec:
priorityClassName: {{ . }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds | int }}
topologySpreadConstraints:
{{- range $constraint := .Values.topologySpreadConstraints }}
- {{- toYaml $constraint | nindent 10 }}
labelSelector:
matchLabels:
{{- include "proxysql.satellite.selectorLabels" $ | nindent 14 }}
{{- end }}
volumes:
- name: data
emptyDir: {}
Expand Down
9 changes: 9 additions & 0 deletions charts/proxysql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ tolerations: []
# Will be applied if not specified otherwise.
affinity: {}

# Set a pod-to pod anti-affinity rule, to spread proxysql pods evenly across nodes.
podAntiAffinity:
enabled: false

# Common annotations to add to all resources (sub-charts are not considered).
# Evaluated as a template
commonAnnotations: {}
Expand Down Expand Up @@ -412,6 +416,11 @@ debug:

terminationGracePeriodSeconds: 60

topologySpreadConstraints:
# - maxSkew: 1 # allows a node or zone to have up to X pods more or less than any other node or zone.
# topologyKey: kubernetes.io/hostname # at least one Pod per Node
# whenUnsatisfiable: DoNotSchedule

# How long shall the pre-stop-Hook wait k8s to deregister the pod from the service,
# before checking for open connections?
sleep_before_connection_check: 15

0 comments on commit 9df3747

Please sign in to comment.