Skip to content

Commit

Permalink
Helm node selector, tolerations support and affinity
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharathmk99 authored and adamjensenbot committed Apr 11, 2023
1 parent bee1415 commit 7afdc63
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 5 deletions.
3 changes: 3 additions & 0 deletions deployments/liqo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
| awsConfig.clusterName | string | `""` | name of the EKS cluster |
| awsConfig.region | string | `""` | AWS region where the clsuter is runnnig |
| awsConfig.secretAccessKey | string | `""` | secretAccessKey for the Liqo user |
| common.affinity | object | `{}` | |
| common.nodeSelector | object | `{}` | nodeSelector for all liqo services, excluding virtual kubelet deployment |
| common.tolerations | list | `[]` | tolerations for all liqo services, excluding virtual kubelet deployment |
| 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 |
| 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). |
| controllerManager.config.offerUpdateThresholdPercentage | string | `""` | the threshold (in percentage) of resources quantity variation which triggers a ResourceOffer update. |
Expand Down
12 changes: 12 additions & 0 deletions deployments/liqo/templates/liqo-auth-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,15 @@ spec:
volumes:
- name: certs
emptyDir: {}
{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 8 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 8 }}
{{- end }}
12 changes: 12 additions & 0 deletions deployments/liqo/templates/liqo-controller-manager-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,15 @@ spec:
secret:
secretName: {{ include "liqo.prefixedName" $webhookConfig }}-certs
defaultMode: 420
{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 8 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 8 }}
{{- end }}
12 changes: 12 additions & 0 deletions deployments/liqo/templates/liqo-crd-replicator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,16 @@ spec:
name: {{ include "liqo.clusterIdConfig" . }}
key: CLUSTER_NAME
resources: {{- toYaml .Values.crdReplicator.pod.resources | nindent 12 }}
{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 8 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 8 }}
{{- end }}
---
13 changes: 12 additions & 1 deletion deployments/liqo/templates/liqo-discovery-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,16 @@ spec:
fieldPath: metadata.namespace
resources: {{- toYaml .Values.discovery.pod.resources | nindent 12 }}
hostNetwork: true

{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 8 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 8 }}
{{- end }}
{{- end }}
13 changes: 12 additions & 1 deletion deployments/liqo/templates/liqo-gateway-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,16 @@ spec:
- name: WIREGUARD_IMPLEMENTATION
value: {{ .Values.gateway.config.wireguardImplementation }}
hostNetwork: true

{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 8 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 8 }}
{{- end }}
{{- end }}
13 changes: 12 additions & 1 deletion deployments/liqo/templates/liqo-metric-agent-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,16 @@ spec:
volumes:
- name: certs
emptyDir: {}

{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 8 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 8 }}
{{- end }}
{{- end }}
13 changes: 12 additions & 1 deletion deployments/liqo/templates/liqo-network-manager-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,16 @@ spec:
fieldRef:
fieldPath: metadata.namespace
resources: {{- toYaml .Values.networkManager.pod.resources | nindent 12 }}

{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 8 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 8 }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions deployments/liqo/templates/liqo-proxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ spec:
- name: config-volume
configMap:
name: {{ include "liqo.prefixedName" $proxyConfig }}
{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 8 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 8 }}
{{- end }}
13 changes: 12 additions & 1 deletion deployments/liqo/templates/liqo-telemetry-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,16 @@ spec:
{{- include "liqo.concatenateMap" $d | nindent 14 }}
{{- end }}
resources: {{- toYaml .Values.telemetry.pod.resources | nindent 14 }}

{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 12 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 12 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 12 }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions deployments/liqo/templates/pre-delete-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,15 @@ spec:
fieldRef:
fieldPath: metadata.namespace
resources: {{- toYaml .Values.uninstaller.pod.resources | nindent 10 }}
{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 8 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 8 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ spec:
serviceAccountName: {{ include "liqo.prefixedName" $rbacConfig }}
securityContext:
{{- include "liqo.podSecurityContext" . | nindent 8 }}
{{- if ((.Values.common).nodeSelector) }}
nodeSelector:
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
{{- end }}
{{- if ((.Values.common).tolerations) }}
tolerations:
{{- toYaml .Values.common.tolerations | nindent 8 }}
{{- end }}
{{- if ((.Values.common).affinity) }}
affinity:
{{- toYaml .Values.common.affinity | nindent 8 }}
{{- end }}
8 changes: 8 additions & 0 deletions deployments/liqo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,11 @@ networkConfig:
# The default value is configured to ensure correct functioning regardless of the combination of the underlying environments
# (e.g., cloud providers). This guarantees improved compatibility at the cost of possible limited performance drops.
mtu: 1340

common:
# -- nodeSelector for all liqo services, excluding virtual kubelet deployment
nodeSelector: {}
# -- tolerations for all liqo services, excluding virtual kubelet deployment
tolerations: []
# affinity for all liqo services, excluding virtual kubelet deployment
affinity: {}

0 comments on commit 7afdc63

Please sign in to comment.