Skip to content

Commit 7afdc63

Browse files
Sharathmk99adamjensenbot
authored andcommitted
Helm node selector, tolerations support and affinity
1 parent bee1415 commit 7afdc63

13 files changed

+143
-5
lines changed

deployments/liqo/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
| awsConfig.clusterName | string | `""` | name of the EKS cluster |
2525
| awsConfig.region | string | `""` | AWS region where the clsuter is runnnig |
2626
| awsConfig.secretAccessKey | string | `""` | secretAccessKey for the Liqo user |
27+
| common.affinity | object | `{}` | |
28+
| common.nodeSelector | object | `{}` | nodeSelector for all liqo services, excluding virtual kubelet deployment |
29+
| common.tolerations | list | `[]` | tolerations for all liqo services, excluding virtual kubelet deployment |
2730
| controllerManager.config.enableNodeFailureController | bool | `false` | Ensure offloaded pods running on a failed node are evicted and rescheduled on a healthy node, preventing them to remain in a terminating state indefinitely. This feature can be useful in case of remote node failure to guarantee better service continuity and to have the expected pods workload on the remote cluster. However, enabling this feature could produce zombies in the worker node, in case the node returns Ready again without a restart |
2831
| controllerManager.config.enableResourceEnforcement | bool | `false` | It enforces offerer-side that offloaded pods do not exceed offered resources (based on container limits). This feature is suggested to be enabled when consumer-side enforcement is not sufficient. It has the same tradeoffs of resource quotas (i.e, it requires all offloaded pods to have resource limits set). |
2932
| controllerManager.config.offerUpdateThresholdPercentage | string | `""` | the threshold (in percentage) of resources quantity variation which triggers a ResourceOffer update. |

deployments/liqo/templates/liqo-auth-deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,15 @@ spec:
126126
volumes:
127127
- name: certs
128128
emptyDir: {}
129+
{{- if ((.Values.common).nodeSelector) }}
130+
nodeSelector:
131+
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
132+
{{- end }}
133+
{{- if ((.Values.common).tolerations) }}
134+
tolerations:
135+
{{- toYaml .Values.common.tolerations | nindent 8 }}
136+
{{- end }}
137+
{{- if ((.Values.common).affinity) }}
138+
affinity:
139+
{{- toYaml .Values.common.affinity | nindent 8 }}
140+
{{- end }}

deployments/liqo/templates/liqo-controller-manager-deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,15 @@ spec:
187187
secret:
188188
secretName: {{ include "liqo.prefixedName" $webhookConfig }}-certs
189189
defaultMode: 420
190+
{{- if ((.Values.common).nodeSelector) }}
191+
nodeSelector:
192+
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
193+
{{- end }}
194+
{{- if ((.Values.common).tolerations) }}
195+
tolerations:
196+
{{- toYaml .Values.common.tolerations | nindent 8 }}
197+
{{- end }}
198+
{{- if ((.Values.common).affinity) }}
199+
affinity:
200+
{{- toYaml .Values.common.affinity | nindent 8 }}
201+
{{- end }}

deployments/liqo/templates/liqo-crd-replicator-deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,16 @@ spec:
5252
name: {{ include "liqo.clusterIdConfig" . }}
5353
key: CLUSTER_NAME
5454
resources: {{- toYaml .Values.crdReplicator.pod.resources | nindent 12 }}
55+
{{- if ((.Values.common).nodeSelector) }}
56+
nodeSelector:
57+
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
58+
{{- end }}
59+
{{- if ((.Values.common).tolerations) }}
60+
tolerations:
61+
{{- toYaml .Values.common.tolerations | nindent 8 }}
62+
{{- end }}
63+
{{- if ((.Values.common).affinity) }}
64+
affinity:
65+
{{- toYaml .Values.common.affinity | nindent 8 }}
66+
{{- end }}
5567
---

deployments/liqo/templates/liqo-discovery-deployment.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,16 @@ spec:
6060
fieldPath: metadata.namespace
6161
resources: {{- toYaml .Values.discovery.pod.resources | nindent 12 }}
6262
hostNetwork: true
63-
63+
{{- if ((.Values.common).nodeSelector) }}
64+
nodeSelector:
65+
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
66+
{{- end }}
67+
{{- if ((.Values.common).tolerations) }}
68+
tolerations:
69+
{{- toYaml .Values.common.tolerations | nindent 8 }}
70+
{{- end }}
71+
{{- if ((.Values.common).affinity) }}
72+
affinity:
73+
{{- toYaml .Values.common.affinity | nindent 8 }}
74+
{{- end }}
6475
{{- end }}

deployments/liqo/templates/liqo-gateway-deployment.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,16 @@ spec:
7373
- name: WIREGUARD_IMPLEMENTATION
7474
value: {{ .Values.gateway.config.wireguardImplementation }}
7575
hostNetwork: true
76-
76+
{{- if ((.Values.common).nodeSelector) }}
77+
nodeSelector:
78+
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
79+
{{- end }}
80+
{{- if ((.Values.common).tolerations) }}
81+
tolerations:
82+
{{- toYaml .Values.common.tolerations | nindent 8 }}
83+
{{- end }}
84+
{{- if ((.Values.common).affinity) }}
85+
affinity:
86+
{{- toYaml .Values.common.affinity | nindent 8 }}
87+
{{- end }}
7788
{{- end }}

deployments/liqo/templates/liqo-metric-agent-deployment.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,16 @@ spec:
7272
volumes:
7373
- name: certs
7474
emptyDir: {}
75-
75+
{{- if ((.Values.common).nodeSelector) }}
76+
nodeSelector:
77+
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
78+
{{- end }}
79+
{{- if ((.Values.common).tolerations) }}
80+
tolerations:
81+
{{- toYaml .Values.common.tolerations | nindent 8 }}
82+
{{- end }}
83+
{{- if ((.Values.common).affinity) }}
84+
affinity:
85+
{{- toYaml .Values.common.affinity | nindent 8 }}
86+
{{- end }}
7687
{{- end }}

deployments/liqo/templates/liqo-network-manager-deployment.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,16 @@ spec:
5959
fieldRef:
6060
fieldPath: metadata.namespace
6161
resources: {{- toYaml .Values.networkManager.pod.resources | nindent 12 }}
62-
62+
{{- if ((.Values.common).nodeSelector) }}
63+
nodeSelector:
64+
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
65+
{{- end }}
66+
{{- if ((.Values.common).tolerations) }}
67+
tolerations:
68+
{{- toYaml .Values.common.tolerations | nindent 8 }}
69+
{{- end }}
70+
{{- if ((.Values.common).affinity) }}
71+
affinity:
72+
{{- toYaml .Values.common.affinity | nindent 8 }}
73+
{{- end }}
6374
{{- end }}

deployments/liqo/templates/liqo-proxy-deployment.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,15 @@ spec:
4343
- name: config-volume
4444
configMap:
4545
name: {{ include "liqo.prefixedName" $proxyConfig }}
46+
{{- if ((.Values.common).nodeSelector) }}
47+
nodeSelector:
48+
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
49+
{{- end }}
50+
{{- if ((.Values.common).tolerations) }}
51+
tolerations:
52+
{{- toYaml .Values.common.tolerations | nindent 8 }}
53+
{{- end }}
54+
{{- if ((.Values.common).affinity) }}
55+
affinity:
56+
{{- toYaml .Values.common.affinity | nindent 8 }}
57+
{{- end }}

deployments/liqo/templates/liqo-telemetry-cronjob.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,16 @@ spec:
5050
{{- include "liqo.concatenateMap" $d | nindent 14 }}
5151
{{- end }}
5252
resources: {{- toYaml .Values.telemetry.pod.resources | nindent 14 }}
53-
53+
{{- if ((.Values.common).nodeSelector) }}
54+
nodeSelector:
55+
{{- toYaml .Values.common.nodeSelector | nindent 12 }}
56+
{{- end }}
57+
{{- if ((.Values.common).tolerations) }}
58+
tolerations:
59+
{{- toYaml .Values.common.tolerations | nindent 12 }}
60+
{{- end }}
61+
{{- if ((.Values.common).affinity) }}
62+
affinity:
63+
{{- toYaml .Values.common.affinity | nindent 12 }}
64+
{{- end }}
5465
{{- end }}

0 commit comments

Comments
 (0)