Skip to content

Commit

Permalink
feat(chart): use nodeSelector instead of affinity, support replicaCou…
Browse files Browse the repository at this point in the history
…nt and affinity
  • Loading branch information
acobaugh committed Sep 13, 2022
1 parent 8e61536 commit 1b803ed
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/gmsa/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ name: gmsa
sources:
- https://github.com/kubernetes-sigs/windows-gmsa
type: application
version: 0.4.4
version: 0.5.0
18 changes: 9 additions & 9 deletions charts/gmsa/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: {{.Release.Namespace}}
labels: {{ include "gmsa.chartref" . | nindent 4 }}
spec:
replicas: 1
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}
Expand All @@ -18,19 +18,19 @@ spec:
securityContext: {{ toYaml .Values.podSecurityContext | nindent 8 }}
{{- end }}
serviceAccountName: {{ .Release.Name }}
{{- with .Values.affinity }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
nodeSelector:
kubernetes.io/os: linux
{{- with .Values.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Release.Name }}
image: '{{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }}'
Expand Down
19 changes: 19 additions & 0 deletions charts/gmsa/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.podDisruptionBudget.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels: {{ include "gmsa.chartref" . | nindent 4 }}

spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app: {{ .Release.Name }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/gmsa/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ setPodOs: ture
global:
systemDefaultRegistry: ""

affinity: {}
nodeselector: {}
podDisruptionBudget:
enabled: false
# minAvailable: 1
# maxUnavailable: 1

podSecurityContext: {}
replicaCount: 2
securityContext: {}
tolerations: []

Expand Down

0 comments on commit 1b803ed

Please sign in to comment.