Skip to content

Commit b3f71f6

Browse files
authored
Agent: add pod disruption budged and topology spread constraints (#9)
* agent: add pdb and topology spread * agent: bump chart version to 0.4.0
1 parent 4b0663b commit b3f71f6

File tree

4 files changed

+61
-1
lines changed

4 files changed

+61
-1
lines changed

charts/agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.3.2
18+
version: 0.4.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/agent/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,7 @@ spec:
9898
tolerations:
9999
{{- toYaml . | nindent 8 }}
100100
{{- end }}
101+
{{- with .Values.topologySpreadConstraints }}
102+
topologySpreadConstraints:
103+
{{- toYaml . | nindent 8 }}
104+
{{- end }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if .Values.podDisruptionBudget.enabled -}}
2+
apiVersion: policy/v1
3+
kind: PodDisruptionBudget
4+
metadata:
5+
name: {{ include "agent.fullname" . }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "agent.labels" . | nindent 4 }}
9+
spec:
10+
{{- if .Values.podDisruptionBudget.minAvailable }}
11+
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
12+
{{- end }}
13+
{{- if .Values.podDisruptionBudget.maxUnavailable }}
14+
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
15+
{{- end }}
16+
selector:
17+
matchLabels:
18+
{{- include "agent.selectorLabels" . | nindent 6 }}
19+
{{- end }}

charts/agent/values.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,41 @@ nodeSelector: {}
110110

111111
tolerations: []
112112

113+
# https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
113114
affinity: {}
115+
# podAntiAffinity:
116+
# requiredDuringSchedulingIgnoredDuringExecution:
117+
# - labelSelector:
118+
# matchExpressions:
119+
# - key: app.kubernetes.io/name
120+
# operator: In
121+
# values:
122+
# - agent
123+
# - key: app.kubernetes.io/instance
124+
# operator: In
125+
# values:
126+
# - RELEASE-NAME
127+
# topologyKey: kubernetes.io/hostname
128+
129+
# https://kubernetes.io/docs/tasks/run-application/configure-pdb/
130+
podDisruptionBudget:
131+
enabled: false
132+
# minAvailable: 1
133+
# maxUnavailable: 1
134+
# Only one of minAvailable or maxUnavailable can be set
135+
136+
# https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
137+
topologySpreadConstraints: []
138+
# Example configurations:
139+
# - maxSkew: 1
140+
# topologyKey: topology.kubernetes.io/zone
141+
# whenUnsatisfiable: DoNotSchedule
142+
# labelSelector:
143+
# matchLabels:
144+
# app.kubernetes.io/name: agent
145+
# - maxSkew: 1
146+
# topologyKey: kubernetes.io/hostname
147+
# whenUnsatisfiable: ScheduleAnyway
148+
# labelSelector:
149+
# matchLabels:
150+
# app.kubernetes.io/name: agent

0 commit comments

Comments
 (0)