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 17, 2024
1 parent e125733 commit 8d744a3
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 84 deletions.
94 changes: 41 additions & 53 deletions deploy/chart/templates/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,31 @@
{{- 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) }}
---
{{- $values := deepCopy $.Values }}
{{- $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
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: NotIn
values:
- virtual-kubelet
{{- if .affinity }}
- matchExpressions:
- key: {{ .affinity.key }}
operator: {{ .affinity.operator }}
values:
{{- range .affinity.values }}
- {{ . | quote }}
{{- end -}}
{{- end }}
{{- toYaml $nodepool.nodeSelectorTerms | nindent 12 }}
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: alicloud-csi-node
Expand All @@ -46,9 +36,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 +59,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 +79,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 +99,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 +119,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,16 +149,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 }}"
{{- if .Values.deploy.featureGates }}
- "--feature-gates={{ .Values.deploy.featureGates }}"
- "--driver={{ include "enabledPlugins" $nodepool.csi }}"
{{- if $nodepool.deploy.featureGates }}
- "--feature-gates={{ $nodepool.deploy.featureGates }}"
{{- end -}}
{{- if not $.Values.deploy.ecs }}
{{- if not $nodepool.deploy.ecs }}
- --nodeid=$(KUBE_NODE_NAME)
{{- end }}
env:
Expand All @@ -182,27 +171,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 @@ -248,24 +237,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 @@ -276,13 +265,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 @@ -292,7 +281,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 @@ -338,7 +327,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 All @@ -352,6 +341,5 @@ spec:
rollingUpdate:
maxUnavailable: 20%
type: RollingUpdate
---
{{- end -}}
{{- end -}}
34 changes: 34 additions & 0 deletions deploy/chart/values-edge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# deployment
csi:
local:
enabled: true
oss:
controller:
enabled: false

# daemonset
nodepools:
default:
pluginname: csi-plugin-cloud
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: NotIn
values:
- virtual-kubelet
- key: alibabacloud.com/is-edge-worker
operator: In
values:
- "false"
edge:
pluginname: csi-plugin
csi:
disk:
enabled: false
nodeSelectorTerms:
- matchExpressions:
- key: alibabacloud.com/is-edge-worker
operator: In
values:
- "true"
# other nodepools
29 changes: 0 additions & 29 deletions deploy/chart/values-nodepools.yaml

This file was deleted.

9 changes: 7 additions & 2 deletions deploy/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ csi:

nodepools:
default:
name: csi-plugin
csi: {}
pluginname: csi-plugin
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: NotIn
values:
- virtual-kubelet

defaultStorageClass:
enabled: true
Expand Down

0 comments on commit 8d744a3

Please sign in to comment.