From 4afe00e05a4416f513475322f31449c4b2d928b8 Mon Sep 17 00:00:00 2001 From: yu lin <735122171@qq.com> Date: Tue, 5 Sep 2023 17:39:41 +0800 Subject: [PATCH] Fix install.sh to support control-plane label. (#989) Signed-off-by: Syulin7 <735122171@qq.com> --- .../templates/binary-install-job.yaml | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/arena-artifacts/templates/binary-install-job.yaml b/arena-artifacts/templates/binary-install-job.yaml index 5ca44859b..39957c6ce 100644 --- a/arena-artifacts/templates/binary-install-job.yaml +++ b/arena-artifacts/templates/binary-install-job.yaml @@ -15,13 +15,16 @@ spec: template: metadata: labels: - app: binary-installer + app: binary-installer name: binary-installer-{{ include "arena.version" . }} {{- include "arena.labels" . | nindent 8 }} spec: hostNetwork: true hostPID: true tolerations: + - effect: NoSchedule + operator: Exists + key: node-role.kubernetes.io/control-plane - effect: NoSchedule operator: Exists key: node-role.kubernetes.io/master @@ -31,16 +34,6 @@ spec: - key: node-role.alibabacloud.com/addon operator: Exists effect: NoSchedule - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: Exists - - matchExpressions: - - key: node-role.kubernetes.io/master - operator: Exists restartPolicy: Never containers: - name: installer @@ -48,7 +41,7 @@ spec: imagePullPolicy: {{ .Values.binary.imagePullPolicy }} securityContext: privileged: true - command: + command: - sh - -c - | @@ -61,7 +54,7 @@ spec: {{- if .Values.binary.rdma }} options="$options --rdma" {{- end }} - nsenter -t 1 -i -p -n -u -m -- /usr/local/arena-installer/arena-installer/install.sh $options + nsenter -t 1 -i -p -n -u -m -- /usr/local/arena-installer/arena-installer/install.sh $options env: volumeMounts: - name: arena-installer @@ -87,5 +80,14 @@ spec: values: - binary-installer-{{ include "arena.version" . }} topologyKey: "kubernetes.io/hostname" + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: Exists + - matchExpressions: + - key: node-role.kubernetes.io/master + operator: Exists {{- end }} -{{- end }} +{{- end }} \ No newline at end of file