From 1c3d8e1a7f31210d14f94677bb5c8b216c840668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=9C=E6=9D=BE?= Date: Fri, 10 May 2024 16:49:33 +0800 Subject: [PATCH] fix: resolve conversations --- deploy/chart/templates/plugin.yaml | 80 +++++++++---------- ...values-nodepools.yaml => values-edge.yaml} | 4 +- deploy/chart/values.yaml | 2 +- 3 files changed, 43 insertions(+), 43 deletions(-) rename deploy/chart/{values-nodepools.yaml => values-edge.yaml} (88%) diff --git a/deploy/chart/templates/plugin.yaml b/deploy/chart/templates/plugin.yaml index 5822729d5..e0e616260 100644 --- a/deploy/chart/templates/plugin.yaml +++ b/deploy/chart/templates/plugin.yaml @@ -1,20 +1,21 @@ -{{- range .Values.nodepools -}} -{{- if $.Values.plugin.enabled }} -{{- $copy := deepCopy .csi }} -{{- $csi := mergeOverwrite $.Values.csi $copy }} +{{- range $key, $nodepool := .Values.nodepools -}} +{{- if and $.Values.plugin.enabled (ne $nodepool nil) }} +{{- $nodepool := mergeOverwrite $.Values $nodepool }} kind: DaemonSet apiVersion: apps/v1 metadata: - name: {{ .name }} + name: {{ $nodepool.pluginname }} namespace: {{ $.Release.Namespace }} spec: selector: matchLabels: - app: {{ .name }} + app: csi-plugin + nodepool: {{ $key }} template: metadata: labels: - app: {{ .name }} + app: csi-plugin + nodepool: {{ $key }} spec: tolerations: - operator: Exists @@ -27,12 +28,12 @@ spec: operator: NotIn values: - virtual-kubelet -{{- if .affinity }} +{{- if $nodepool.affinity }} - matchExpressions: - - key: {{ .affinity.key }} - operator: {{ .affinity.operator }} + - key: {{ $nodepool.affinity.key }} + operator: {{ $nodepool.affinity.operator }} values: - {{- range .affinity.values }} + {{- range $nodepool.affinity.values }} - {{ . | quote }} {{- end -}} {{- end }} @@ -46,9 +47,9 @@ spec: dnsPolicy: ClusterFirst initContainers: - name: init - image: {{ include "workerImageSpec" (list $.Values.images "pluginInit") }} + image: {{ include "workerImageSpec" (list $nodepool.images "pluginInit") }} args: - - "--driver={{ include "enabledPlugins" $csi }}" + - "--driver={{ include "enabledPlugins" $nodepool.csi }}" securityContext: privileged: true allowPrivilegeEscalation: true @@ -69,9 +70,9 @@ spec: - name: ossconnectordir mountPath: /host/usr/ containers: -{{- if $csi.disk.enabled }} +{{- if $nodepool.csi.disk.enabled }} - name: disk-driver-registrar - image: {{ include "workerImageSpec" (list $.Values.images "pluginRegistrar") }} + image: {{ include "workerImageSpec" (list $nodepool.images "pluginRegistrar") }} resources: requests: cpu: 10m @@ -89,9 +90,9 @@ spec: - name: registration-dir mountPath: /registration {{- end -}} -{{- if $csi.nas.enabled }} +{{- if $nodepool.csi.nas.enabled }} - name: nas-driver-registrar - image: {{ include "workerImageSpec" (list $.Values.images "pluginRegistrar") }} + image: {{ include "workerImageSpec" (list $nodepool.images "pluginRegistrar") }} resources: requests: cpu: 10m @@ -109,9 +110,9 @@ spec: - name: registration-dir mountPath: /registration {{- end -}} -{{- if $csi.oss.enabled }} +{{- if $nodepool.csi.oss.enabled }} - name: oss-driver-registrar - image: {{ include "workerImageSpec" (list $.Values.images "pluginRegistrar") }} + image: {{ include "workerImageSpec" (list $nodepool.images "pluginRegistrar") }} resources: requests: cpu: 10m @@ -129,9 +130,9 @@ spec: - name: registration-dir mountPath: /registration {{- end -}} -{{- if $csi.local.enabled }} +{{- if $nodepool.csi.local.enabled }} - name: local-driver-registrar - image: {{ include "workerImageSpec" (list $.Values.images "pluginRegistrar") }} + image: {{ include "workerImageSpec" (list $nodepool.images "pluginRegistrar") }} resources: requests: cpu: 10m @@ -159,16 +160,15 @@ spec: securityContext: privileged: true allowPrivilegeEscalation: true - image: {{ include "workerImageSpec" (list $.Values.images "plugin") }} + image: {{ include "workerImageSpec" (list $nodepool.images "plugin") }} args: - "--endpoint=$(CSI_ENDPOINT)" - "--v=2" -<<<<<<< HEAD - - "--driver={{ include "enabledPlugins" $csi }}" + - "--driver={{ include "enabledPlugins" $nodepool.csi }}" {{- if .Values.deploy.featureGates }} - "--feature-gates={{ .Values.deploy.featureGates }}" {{- end -}} -{{- if not $.Values.deploy.ecs }} +{{- if not $nodepool.deploy.ecs }} - --nodeid=$(KUBE_NODE_NAME) {{- end }} env: @@ -182,27 +182,27 @@ spec: - name: SERVICE_TYPE value: "plugin" - name: "DEFAULT_REGISTRY" - value: {{ $.Values.images.workerRegistry | default $.Values.images.registry | quote }} -{{- if $.Values.deploy.ecsEndpoint }} + value: {{ $nodepool.images.workerRegistry | default $nodepool.images.registry | quote }} +{{- if $nodepool.deploy.ecsEndpoint }} - name: ECS_ENDPOINT - value: {{ $.Values.deploy.ecsEndpoint | quote }} + value: {{ $nodepool.deploy.ecsEndpoint | quote }} {{- end -}} -{{- if $.Values.deploy.privateCloud }} +{{- if $nodepool.deploy.privateCloud }} - name: ALICLOUD_CLIENT_SCHEME value: HTTP - name: PRIVATE_CLOUD_TAG value: "true" {{- end -}} -{{- if $.Values.deploy.accessKey.enabled }} +{{- if $nodepool.deploy.accessKey.enabled }} - name: ACCESS_KEY_ID valueFrom: secretKeyRef: - name: {{ $.Values.deploy.accessKey.secretName }} + name: {{ $nodepool.deploy.accessKey.secretName }} key: id - name: ACCESS_KEY_SECRET valueFrom: secretKeyRef: - name: {{ $.Values.deploy.accessKey.secretName }} + name: {{ $nodepool.deploy.accessKey.secretName }} key: secret {{- end }} resources: @@ -248,16 +248,16 @@ spec: mountPropagation: "HostToContainer" - mountPath: /run/kata-containers/shared/direct-volumes name: kata-direct-volumes -{{- if $.Values.deploy.ack }} +{{- if $nodepool.deploy.ack }} - mountPath: /var/addon name: addon-token readOnly: true {{- end -}} -{{- if $csi.oss.enabled }} +{{- if $nodepool.csi.oss.enabled }} - mountPath: /host/var/run/ossfs name: ossfs-metrics-dir {{- end -}} -{{- if $csi.nas.enabled }} +{{- if $nodepool.csi.nas.enabled }} - mountPath: /host/var/run/efc name: efc-metrics-dir {{- end }} @@ -265,7 +265,7 @@ spec: name: run-csi - mountPath: /host/sys/fs/cgroup/blkio/kubepods.slice name: cgroupv1-blkio -{{- if $csi.local.enabled }} +{{- if $nodepool.csi.local.enabled }} - mountPath: /tls/local/grpc name: tls-token-dir readOnly: true @@ -276,13 +276,13 @@ spec: mountPath: /mnt mountPropagation: "Bidirectional" volumes: -{{- if $csi.oss.enabled }} +{{- if $nodepool.csi.oss.enabled }} - name: ossfs-metrics-dir hostPath: path: /var/run/ossfs type: DirectoryOrCreate {{- end -}} -{{- if $csi.nas.enabled }} +{{- if $nodepool.csi.nas.enabled }} - name: efc-metrics-dir hostPath: path: /var/run/efc @@ -292,7 +292,7 @@ spec: hostPath: path: /run/csi-tool type: DirectoryOrCreate -{{- if $csi.local.enabled }} +{{- if $nodepool.csi.local.enabled }} - name: tls-token-dir secret: defaultMode: 420 @@ -338,7 +338,7 @@ spec: path: /run/kata-containers/shared/direct-volumes type: DirectoryOrCreate name: kata-direct-volumes -{{- if $.Values.deploy.ack }} +{{- if $nodepool.deploy.ack }} - name: addon-token secret: defaultMode: 420 diff --git a/deploy/chart/values-nodepools.yaml b/deploy/chart/values-edge.yaml similarity index 88% rename from deploy/chart/values-nodepools.yaml rename to deploy/chart/values-edge.yaml index 70eb3324b..27e0223ed 100644 --- a/deploy/chart/values-nodepools.yaml +++ b/deploy/chart/values-edge.yaml @@ -3,7 +3,7 @@ deploy: nodepools: default: - name: csi-plugin + pluginname: csi-plugin csi: {} affinity: key: alibabacloud.com/is-edge-worker @@ -11,7 +11,7 @@ nodepools: values: val1: "true" edge: - name: csi-plugin-edge + pluginname: csi-plugin-edge csi: disk: enabled: false diff --git a/deploy/chart/values.yaml b/deploy/chart/values.yaml index d7343953c..47491aa3c 100644 --- a/deploy/chart/values.yaml +++ b/deploy/chart/values.yaml @@ -25,7 +25,7 @@ csi: nodepools: default: - name: csi-plugin + pluginname: csi-plugin csi: {} defaultStorageClass: