Upgrade upcloud csi driver to v1.1.0 and add snapshot features (#11303)

pull/11258/head
Elias-elastisys 2024-06-26 11:26:21 +02:00 committed by GitHub
parent 15b62cc7ce
commit cae266a045
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 80 additions and 5 deletions

View File

@ -3,7 +3,7 @@ upcloud_csi_controller_replicas: 1
upcloud_csi_provisioner_image_tag: "v3.1.0" upcloud_csi_provisioner_image_tag: "v3.1.0"
upcloud_csi_attacher_image_tag: "v3.4.0" upcloud_csi_attacher_image_tag: "v3.4.0"
upcloud_csi_resizer_image_tag: "v1.4.0" upcloud_csi_resizer_image_tag: "v1.4.0"
upcloud_csi_plugin_image_tag: "v0.3.3" upcloud_csi_plugin_image_tag: "v1.1.0"
upcloud_csi_node_image_tag: "v2.5.0" upcloud_csi_node_image_tag: "v2.5.0"
upcloud_username: "{{ lookup('env', 'UPCLOUD_USERNAME') }}" upcloud_username: "{{ lookup('env', 'UPCLOUD_USERNAME') }}"
upcloud_password: "{{ lookup('env', 'UPCLOUD_PASSWORD') }}" upcloud_password: "{{ lookup('env', 'UPCLOUD_PASSWORD') }}"

View File

@ -58,13 +58,26 @@ spec:
volumeMounts: volumeMounts:
- name: socket-dir - name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/ mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-snapshotter
image: k8s.gcr.io/sig-storage/csi-snapshotter:{{ upcloud_csi_snapshotter_image_tag }}
args:
- "--csi-address=$(ADDRESS)"
- "--v=5"
- "--timeout=600s"
- "--leader-election=false"
env:
- name: ADDRESS
value: /var/lib/csi/sockets/pluginproxy/csi.sock
imagePullPolicy: "Always"
volumeMounts:
- name: socket-dir
mountPath: /var/lib/csi/sockets/pluginproxy/
- name: csi-upcloud-plugin - name: csi-upcloud-plugin
image: ghcr.io/upcloudltd/upcloud-csi:{{ upcloud_csi_plugin_image_tag }} image: ghcr.io/upcloudltd/upcloud-csi:{{ upcloud_csi_plugin_image_tag }}
args: args:
- "--endpoint=$(CSI_ENDPOINT)" - "--endpoint=$(CSI_ENDPOINT)"
- "--nodehost=$(NODE_ID)" - "--nodehost=$(NODE_ID)"
- "--username=$(UPCLOUD_USERNAME)" - "--mode=monolith"
- "--password=$(UPCLOUD_PASSWORD)"
env: env:
- name: CSI_ENDPOINT - name: CSI_ENDPOINT
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock

View File

@ -42,8 +42,7 @@ spec:
args: args:
- "--endpoint=$(CSI_ENDPOINT)" - "--endpoint=$(CSI_ENDPOINT)"
- "--nodehost=$(NODE_ID)" - "--nodehost=$(NODE_ID)"
- "--username=$(UPCLOUD_USERNAME)" - "--mode=monolith"
- "--password=$(UPCLOUD_PASSWORD)"
env: env:
- name: CSI_ENDPOINT - name: CSI_ENDPOINT
value: unix:///csi/csi.sock value: unix:///csi/csi.sock

View File

@ -62,6 +62,18 @@ rules:
- apiGroups: [ "" ] - apiGroups: [ "" ]
resources: [ "events" ] resources: [ "events" ]
verbs: [ "list", "watch", "create", "update", "patch" ] verbs: [ "list", "watch", "create", "update", "patch" ]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents/status"]
verbs: ["update"]
- apiGroups: [ "snapshot.storage.k8s.io" ]
resources: [ "volumesnapshots" ]
verbs: [ "get", "list" ]
- apiGroups: [ "" ] - apiGroups: [ "" ]
resources: [ "nodes" ] resources: [ "nodes" ]
verbs: [ "get", "list", "watch" ] verbs: [ "get", "list", "watch" ]
@ -183,3 +195,54 @@ roleRef:
kind: ClusterRole kind: ClusterRole
name: csi-upcloud-resizer-role name: csi-upcloud-resizer-role
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-upcloud-snapshotter-role
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["get", "list"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["get", "list"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: csi-upcloud-snapshotter-binding
subjects:
- kind: ServiceAccount
name: csi-upcloud-controller-sa
namespace: kube-system
roleRef:
kind: ClusterRole
name: csi-upcloud-snapshotter-role
apiGroup: rbac.authorization.k8s.io