Skip to content

Commit

Permalink
Update VCD CSI driver to 1.6.0 (#3094)
Browse files Browse the repository at this point in the history
Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>
  • Loading branch information
ahmedwaleedmalik committed Mar 21, 2024
1 parent e3c4d18 commit 89863c5
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 40 deletions.
19 changes: 12 additions & 7 deletions addons/csi-vmware-cloud-director/Kustomization
Expand Up @@ -4,13 +4,10 @@ namespace: kube-system

resources:
- base/vcloud-csi-config.yaml
- https://raw.githubusercontent.com/vmware/cloud-director-named-disk-csi-driver/1.5.0/manifests/csi-controller.yaml
- https://raw.githubusercontent.com/vmware/cloud-director-named-disk-csi-driver/1.5.0/manifests/csi-driver.yaml
- https://raw.githubusercontent.com/vmware/cloud-director-named-disk-csi-driver/1.5.0/manifests/csi-node.yaml
- https://raw.githubusercontent.com/vmware/cloud-director-named-disk-csi-driver/1.6.0/manifests/csi-controller.yaml
- https://raw.githubusercontent.com/vmware/cloud-director-named-disk-csi-driver/1.6.0/manifests/csi-driver.yaml
- https://raw.githubusercontent.com/vmware/cloud-director-named-disk-csi-driver/1.6.0/manifests/csi-node.yaml
# following manifests are slightly modifined versions of the above, augmented with the CLUSTER_ID referece
# TODO: investigate if we need to use those
# - https://raw.githubusercontent.com/vmware/cloud-director-named-disk-csi-driver/1.5.0/manifests/csi-controller-crs.yaml
# - https://raw.githubusercontent.com/vmware/cloud-director-named-disk-csi-driver/1.5.0/manifests/csi-node-crs.yaml

patches:
- target:
Expand All @@ -33,10 +30,14 @@ patches:
{{ .InternalImages.Get "VMwareCloudDirectorCSIProvisioner" }}
- op: replace
path: /spec/template/spec/containers/2/image
value: |-
{{ .InternalImages.Get "VMwareCloudDirectorCSIResizer" }}
- op: replace
path: /spec/template/spec/containers/3/image
value: |-
{{ .InternalImages.Get "VMwareCloudDirectorCSI" }}
- op: remove
path: /spec/template/spec/containers/2/command/3
path: /spec/template/spec/containers/3/command/3
- target:
group: apps
version: v1
Expand All @@ -53,5 +54,9 @@ patches:
{{ .InternalImages.Get "VMwareCloudDirectorCSINodeDriverRegistrar" }}
- op: replace
path: /spec/template/spec/containers/1/image
value: |-
{{ .InternalImages.Get "VMwareCloudDirectorCSIResizer" }}
- op: replace
path: /spec/template/spec/containers/2/image
value: |-
{{ .InternalImages.Get "VMwareCloudDirectorCSI" }}
100 changes: 88 additions & 12 deletions addons/csi-vmware-cloud-director/driver.yaml
Expand Up @@ -149,6 +149,55 @@ rules:
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: csi-resizer-role
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- update
- patch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims/status
verbs:
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- list
- watch
- create
- update
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: csi-attacher-binding
Expand Down Expand Up @@ -187,6 +236,19 @@ subjects:
name: csi-vcd-controller-sa
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: csi-resizer-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: csi-resizer-role
subjects:
- kind: ServiceAccount
name: csi-vcd-controller-sa
namespace: kube-system
---
apiVersion: v1
data:
vcloud-csi-config.yaml: |
Expand All @@ -201,16 +263,6 @@ metadata:
name: vcloud-csi-configmap
namespace: kube-system
---
apiVersion: v1
data:
password: '{{ with .Credentials.VCD_PASSWORD }}{{ . | b64enc }}{{ end }}'
refreshToken: '{{ with .Credentials.VCD_API_TOKEN }}{{ . | b64enc }}{{ end }}'
username: '{{ with .Credentials.VCD_USER }}{{ . | b64enc }}{{ end }}'
kind: Secret
metadata:
name: vcloud-basic-auth
namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -264,11 +316,23 @@ spec:
volumeMounts:
- mountPath: /var/lib/csi/sockets/pluginproxy/
name: socket-dir
- args:
- --csi-address=$(ADDRESS)
- --timeout=30s
- --v=5
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
image: '{{ .InternalImages.Get "VMwareCloudDirectorCSIResizer" }}'
imagePullPolicy: IfNotPresent
name: csi-resizer
volumeMounts:
- mountPath: /var/lib/csi/sockets/pluginproxy/
name: socket-dir
- command:
- /opt/vcloud/bin/cloud-director-named-disk-csi-driver
- --cloud-config=/etc/kubernetes/vcloud/vcloud-csi-config.yaml
- --endpoint=$(CSI_ENDPOINT)
- --v=5
env:
- name: NODE_ID
valueFrom:
Expand Down Expand Up @@ -370,12 +434,24 @@ spec:
name: socket-dir
- mountPath: /registration
name: registration-dir
- args:
- --csi-address=$(ADDRESS)
- --timeout=30s
- --v=5
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
image: '{{ .InternalImages.Get "VMwareCloudDirectorCSIResizer" }}'
imagePullPolicy: IfNotPresent
name: csi-resizer
volumeMounts:
- mountPath: /var/lib/csi/sockets/pluginproxy/
name: socket-dir
- command:
- /opt/vcloud/bin/cloud-director-named-disk-csi-driver
- --nodeid=$(NODE_ID)
- --endpoint=$(CSI_ENDPOINT)
- --cloud-config=/etc/kubernetes/vcloud/vcloud-csi-config.yaml
- --v=5
env:
- name: NODE_ID
valueFrom:
Expand Down
4 changes: 3 additions & 1 deletion pkg/templates/images/images.go
Expand Up @@ -168,6 +168,7 @@ const (
VMwareCloudDirectorCSI
VMwareCloudDirectorCSIAttacher
VMwareCloudDirectorCSIProvisioner
VMwareCloudDirectorCSIResizer
VMwareCloudDirectorCSINodeDriverRegistrar

// vSphere CSI
Expand Down Expand Up @@ -318,9 +319,10 @@ func optionalResources() map[Resource]map[string]string {
EquinixMetalCCM: {"*": "quay.io/equinix-oss/cloud-provider-equinix-metal:v3.8.0"},

// VMware Cloud Director CSI
VMwareCloudDirectorCSI: {"*": "projects.registry.vmware.com/vmware-cloud-director/cloud-director-named-disk-csi-driver:1.5.0"},
VMwareCloudDirectorCSI: {"*": "projects.registry.vmware.com/vmware-cloud-director/cloud-director-named-disk-csi-driver:1.6.0"},
VMwareCloudDirectorCSIAttacher: {"*": "registry.k8s.io/sig-storage/csi-attacher:v3.2.1"},
VMwareCloudDirectorCSIProvisioner: {"*": "registry.k8s.io/sig-storage/csi-provisioner:v2.2.2"},
VMwareCloudDirectorCSIResizer: {"*": "registry.k8s.io/sig-storage/csi-resizer:v1.4.0"},
VMwareCloudDirectorCSINodeDriverRegistrar: {"*": "registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.2.0"},

// vSphere CPI (A.K.A. CCM)
Expand Down
41 changes: 21 additions & 20 deletions pkg/templates/images/resource_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 89863c5

Please sign in to comment.