Skip to content

Commit

Permalink
fix: resolve conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
vie-serendipity committed May 10, 2024
1 parent 9617220 commit 7a3ed37
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 42 deletions.
79 changes: 40 additions & 39 deletions deploy/chart/templates/plugin.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -159,12 +160,12 @@ 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"
- "--driver={{ include "enabledPlugins" $csi }}"
{{- if not $.Values.deploy.ecs }}
- "--driver={{ include "enabledPlugins" $nodepool.csi }}"
{{- if not $nodepool.deploy.ecs }}
- --nodeid=$(KUBE_NODE_NAME)
{{- end }}
env:
Expand All @@ -178,27 +179,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:
Expand Down Expand Up @@ -244,24 +245,24 @@ 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 }}
- mountPath: /host/run/csi-tool
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
Expand All @@ -272,13 +273,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
Expand All @@ -288,7 +289,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
Expand Down Expand Up @@ -334,7 +335,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ deploy:

nodepools:
default:
name: csi-plugin
pluginname: csi-plugin
csi: {}
affinity:
key: alibabacloud.com/is-edge-worker
operator: NotIn
values:
val1: "true"
edge:
name: csi-plugin-edge
pluginname: csi-plugin-edge
csi:
disk:
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion deploy/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ csi:

nodepools:
default:
name: csi-plugin
pluginname: csi-plugin
csi: {}

defaultStorageClass:
Expand Down

0 comments on commit 7a3ed37

Please sign in to comment.