Skip to content

Commit 01a1940

Browse files
committed
Add toleration support for agent, controller, and webhook configurations
1 parent c11762f commit 01a1940

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

deployment/helm/templates/agent.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ spec:
2929
{{- if .Values.rbac.enabled }}
3030
serviceAccountName: 'akri-agent-sa'
3131
{{- end }}
32+
{{- with .Values.agent.tolerations }}
33+
tolerations:
34+
{{- toYaml . | nindent 8 }}
35+
{{- end }}
3236
containers:
3337
- name: akri-agent
3438
{{- $repository := ternary .Values.agent.image.fullRepository .Values.agent.image.repository .Values.agent.full -}}
@@ -107,5 +111,7 @@ spec:
107111
- name: devices
108112
hostPath:
109113
path: "{{ .Values.agent.host.udev }}"
110-
{{- end }}
114+
115+
/Users/marcelauge/workspace/k3s/ts464/einsatzimporter/templates/cronjob:
116+
yaml: {{- end }}
111117
{{- end }}

deployment/helm/templates/controller.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,16 @@ spec:
5858
imagePullSecrets:
5959
{{- toYaml . | nindent 8 }}
6060
{{- end }}
61-
{{- if .Values.controller.allowOnControlPlane }}
61+
{{- if or .Values.controller.allowOnControlPlane .Values.controller.tolerations }}
6262
tolerations:
63+
{{- if .Values.controller.allowOnControlPlane }}
6364
{{- /* Allow this pod to run on the master. */}}
6465
- key: node-role.kubernetes.io/master
6566
effect: NoSchedule
67+
{{- end }}
68+
{{- if .Values.controller.tolerations }}
69+
{{- toYaml .Values.controller.tolerations | nindent 2 }}
70+
{{- end }}
6671
{{- end }}
6772
nodeSelector:
6873
{{- if .Values.controller.onlyOnControlPlane }}

deployment/helm/templates/webhook-configuration.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,16 @@ items:
101101
imagePullSecrets:
102102
{{- toYaml . | nindent 12 }}
103103
{{- end }}
104-
{{- if .Values.webhookConfiguration.allowOnControlPlane }}
104+
{{- if or .Values.webhookConfiguration.allowOnControlPlane .Values.webhookConfiguration.tolerations }}
105105
tolerations:
106+
{{- if .Values.webhookConfiguration.allowOnControlPlane }}
106107
{{- /* Allow this pod to run on the master. */}}
107108
- key: node-role.kubernetes.io/master
108109
effect: NoSchedule
110+
{{- end }}
111+
{{- if .Values.webhookConfiguration.tolerations }}
112+
{{- toYaml .Values.controller.tolerations | nindent 2 }}
113+
{{- end }}
109114
{{- end }}
110115
nodeSelector:
111116
{{- if .Values.webhookConfiguration.nodeSelectors }}

deployment/helm/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ controller:
6969
# allowOnControlPlane dictates whether a toleration will be added to allow to Akri Controller
7070
# to run on the control plane node
7171
allowOnControlPlane: true
72+
tolerations: { }
7273
# nodeSelectors is the array of nodeSelectors used to target nodes for the Akri Controller to run on
7374
# This can be set from the helm command line using `--set controller.nodeSelectors.label="value"`
7475
nodeSelectors: {}
@@ -119,6 +120,7 @@ agent:
119120
# nodeSelectors is the array of nodeSelectors used to target nodes for the Akri Agent to run on
120121
# This can be set from the helm command line using `--set agent.nodeSelectors.label="value"`
121122
nodeSelectors: {}
123+
tolerations: { }
122124
resources:
123125
# memoryRequest defines the minimum amount of RAM that must be available to this Pod
124126
# for it to be scheduled by the Kubernetes Scheduler
@@ -878,6 +880,7 @@ webhookConfiguration:
878880
# nodeSelectors is the array of nodeSelectors used to target nodes for the Akri Webhook to run on
879881
# This can be set from the helm command line using `--set webhookConfiguration.nodeSelectors.label="value"`
880882
nodeSelectors: {}
883+
tolerations: { }
881884
resources:
882885
# memoryRequest defines the minimum amount of RAM that must be available to this Pod
883886
# for it to be scheduled by the Kubernetes Scheduler

0 commit comments

Comments
 (0)