diff --git a/charts/hybridnet/Chart.yaml b/charts/hybridnet/Chart.yaml index de6fc608..5f9e08e0 100644 --- a/charts/hybridnet/Chart.yaml +++ b/charts/hybridnet/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: hybridnet # When the version is modified, make sure the artifacthub.io/changes list is updated # Also update CHANGELOG.md -version: 0.5.10 +version: 0.5.11 appVersion: 0.7.7 home: https://github.com/alibaba/hybridnet description: A container networking solution aiming at hybrid clouds. @@ -22,4 +22,5 @@ annotations: artifacthub.io/prerelease: "false" # List of changes for the release in artifacthub.io artifacthub.io/changes: | - - "Update image to v0.7.7" + - "remove useless host var directory volume" + - "add nodeSelector parameters" diff --git a/charts/hybridnet/templates/daemonsets.yaml b/charts/hybridnet/templates/daemonsets.yaml index 6765d27a..35ca35b0 100644 --- a/charts/hybridnet/templates/daemonsets.yaml +++ b/charts/hybridnet/templates/daemonsets.yaml @@ -111,9 +111,6 @@ spec: name: host-modules - mountPath: /run/xtables.lock name: xtables-lock - - mountPath: /var/run/ - name: host-var-run - mountPropagation: Bidirectional {{ if .Values.daemon.enableFelixPolicy }} - name: felix image: "{{ .Values.images.registryURL }}/{{ .Values.images.hybridnet.image }}:{{ .Values.images.hybridnet.tag }}" @@ -179,8 +176,4 @@ spec: items: - key: cni-config path: cni-config - - name: host-var-run - hostPath: - path: /var/run/ - type: "Directory" diff --git a/charts/hybridnet/templates/deployments.yaml b/charts/hybridnet/templates/deployments.yaml index 67687456..26e1c006 100644 --- a/charts/hybridnet/templates/deployments.yaml +++ b/charts/hybridnet/templates/deployments.yaml @@ -75,8 +75,14 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + {{- if and .Values.manager .Values.manager.nodeSelector }} + nodeSelector: + {{- toYaml .Values.manager.nodeSelector | trim | nindent 8 }} + {{- else }} + # This will bring problems after k8s 1.24 nodeSelector: node-role.kubernetes.io/master: "" + {{- end }} --- apiVersion: apps/v1 @@ -107,8 +113,14 @@ spec: tolerations: - operator: Exists effect: NoSchedule + {{- if and .Values.webhook .Values.webhook.nodeSelector }} + nodeSelector: + {{- toYaml .Values.webhook.nodeSelector | trim | nindent 8 }} + {{- else }} + # This will bring problems after k8s 1.24 nodeSelector: node-role.kubernetes.io/master: "" + {{- end }} priorityClassName: system-cluster-critical serviceAccountName: hybridnet hostNetwork: true @@ -169,13 +181,20 @@ spec: scheduler.alpha.kubernetes.io/critical-pod: '' cluster-autoscaler.kubernetes.io/safe-to-evict: 'true' spec: + {{- if and .Values.typha .Values.typha.nodeSelector }} + nodeSelector: + {{- toYaml .Values.typha.nodeSelector | trim | nindent 8 }} + {{- else }} nodeSelector: beta.kubernetes.io/os: linux + {{- end }} hostNetwork: true tolerations: # Mark the pod as a critical add-on for rescheduling. - key: CriticalAddonsOnly operator: Exists + - effect: NoSchedule + operator: Exists # Since Calico can't network a pod until Typha is up, we need to run Typha itself # as a host-networked pod. serviceAccountName: hybridnet @@ -224,7 +243,7 @@ spec: value: "{{ .Values.typha.serverPort }}" {{- if and .Values.typha .Values.typha.resources }} resources: - {{- toYaml .Values.typha.resources | trim | nindent 12 }} + {{- toYaml .Values.typha.resources | trim | nindent 12 }} {{- end }} livenessProbe: httpGet: diff --git a/charts/hybridnet/values.yaml b/charts/hybridnet/values.yaml index bb354773..64d655cd 100644 --- a/charts/hybridnet/values.yaml +++ b/charts/hybridnet/values.yaml @@ -41,6 +41,8 @@ manager: # -- The port of manager to listen on for prometheus metrics metricsPort: 9899 + nodeSelector: {} + webhook: # -- Only the pods match the additionalPodMatchExpressions will be validate by hybridnet webhook. @@ -61,6 +63,8 @@ webhook: # cpu: 100m # memory: 512Mi + nodeSelector: {} + daemon: # -- Whether enable the felix components for NetworkPolicy. enableFelixPolicy: true @@ -147,6 +151,8 @@ typha: # cpu: 100m # memory: 128Mi + nodeSelector: {} + # -- Whether pod IP of stateful workloads will be retained by default. true or false ## Ref: https://github.com/alibaba/hybridnet/wiki/Static-pod-ip-addresses-for-StatefulSet defaultIPRetain: true