From 6a70eac9a79681e019930fa65a34cb10324f4265 Mon Sep 17 00:00:00 2001 From: Fatih Arslan Date: Wed, 31 Oct 2018 18:49:05 +0300 Subject: [PATCH 1/2] csi: fix driver name Driver name should match the StorageClass, CSIDriver and the name inside our driver, which is returned via GetNodeInfo() --- .../releases/csi-digitalocean-dev.yaml | 121 +++++++++++++++--- driver/driver.go | 2 +- 2 files changed, 107 insertions(+), 16 deletions(-) diff --git a/deploy/kubernetes/releases/csi-digitalocean-dev.yaml b/deploy/kubernetes/releases/csi-digitalocean-dev.yaml index c2633b3c..0c2ab5ff 100644 --- a/deploy/kubernetes/releases/csi-digitalocean-dev.yaml +++ b/deploy/kubernetes/releases/csi-digitalocean-dev.yaml @@ -14,12 +14,99 @@ # Configuration to deploy release version of the CSI DigitalOcean # plugin (https://github.com/digitalocean/csi-digitalocean) compatible with -# Kubernetes >=v1.10.5 +# Kubernetes >=v1.12.1 # # example usage: kubectl create -f --- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: csinodeinfos.csi.storage.k8s.io +spec: + group: csi.storage.k8s.io + names: + kind: CSINodeInfo + plural: csinodeinfos + scope: Cluster + validation: + openAPIV3Schema: + properties: + csiDrivers: + description: List of CSI drivers running on the node and their properties. + items: + properties: + driver: + description: The CSI driver that this object refers to. + type: string + nodeID: + description: The node from the driver point of view. + type: string + topologyKeys: + description: List of keys supported by the driver. + items: + type: string + type: array + type: array + version: v1alpha1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- + +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: csidrivers.csi.storage.k8s.io +spec: + group: csi.storage.k8s.io + names: + kind: CSIDriver + plural: csidrivers + scope: Cluster + validation: + openAPIV3Schema: + properties: + spec: + description: Specification of the CSI Driver. + properties: + attachRequired: + description: Indicates this CSI volume driver requires an attach operation, + and that Kubernetes should call attach and wait for any attach operation + to complete before proceeding to mount. + type: boolean + podInfoOnMountVersion: + description: Indicates this CSI volume driver requires additional pod + information (like podName, podUID, etc.) during mount operations. + type: string + version: v1alpha1 +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] + +--- + +# CSIDriverRegistry feature gate needs to be enabled +apiVersion: csi.storage.k8s.io/v1alpha1 +kind: CSIDriver +metadata: + name: dobs.csi.digitalocean.com +spec: + attachRequired: true + podInfoOnMountVersion: "v1" + +--- + kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: @@ -27,7 +114,7 @@ metadata: namespace: kube-system annotations: storageclass.kubernetes.io/is-default-class: "true" -provisioner: com.digitalocean.csi.dobs +provisioner: dobs.csi.digitalocean.com --- @@ -54,9 +141,9 @@ spec: serviceAccount: csi-do-controller-sa containers: - name: csi-provisioner - image: quay.io/k8scsi/csi-provisioner:v0.3.0 + image: quay.io/k8scsi/csi-provisioner:v0.4.1 args: - - "--provisioner=com.digitalocean.csi.dobs" + - "--provisioner=dobs.csi.digitalocean.com" - "--csi-address=$(ADDRESS)" - "--v=5" env: @@ -67,7 +154,7 @@ spec: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ - name: csi-attacher - image: quay.io/k8scsi/csi-attacher:v0.3.0 + image: quay.io/k8scsi/csi-attacher:v0.4.1 args: - "--v=5" - "--csi-address=$(ADDRESS)" @@ -169,13 +256,19 @@ spec: hostNetwork: true containers: - name: driver-registrar - image: quay.io/k8scsi/driver-registrar:v0.3.0 + image: quay.io/k8scsi/driver-registrar:v0.4.1 args: - "--v=5" - "--csi-address=$(ADDRESS)" + - "--mode=node-register" + - "--driver-requires-attachment=true" + - "--pod-info-mount-version=\"v1\"" + - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)" env: - name: ADDRESS value: /csi/csi.sock + - name: DRIVER_REG_SOCK_PATH + value: /var/lib/kubelet/plugins/dobs.csi.digitalocean.com/csi.sock - name: KUBE_NODE_NAME valueFrom: fieldRef: @@ -183,9 +276,8 @@ spec: volumeMounts: - name: plugin-dir mountPath: /csi/ - # TODO(arslan): the registrar is not implemented yet - # - name: registrar-socket-dir - # mountPath: /var/lib/csi/sockets/ + - name: registration-dir + mountPath: /registration/ - name: csi-do-plugin image: digitalocean/do-csi-plugin:dev args : @@ -219,14 +311,13 @@ spec: - name: device-dir mountPath: /dev volumes: - # TODO(arslan): the registar is not implemented yet - #- name: registrar-socket-dir - # hostPath: - # path: /var/lib/kubelet/device-plugins/ - # type: DirectoryOrCreate + - name: registration-dir + hostPath: + path: /var/lib/kubelet/plugins/ + type: DirectoryOrCreate - name: plugin-dir hostPath: - path: /var/lib/kubelet/plugins/com.digitalocean.csi.dobs + path: /var/lib/kubelet/plugins/dobs.csi.digitalocean.com type: DirectoryOrCreate - name: pods-mount-dir hostPath: diff --git a/driver/driver.go b/driver/driver.go index 730b1ff2..b3d3b82a 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -36,7 +36,7 @@ import ( ) const ( - driverName = "com.digitalocean.csi.dobs" + driverName = "dobs.csi.digitalocean.com" ) var ( From 312962f5b246a5edade16f969ca304c31351e792 Mon Sep 17 00:00:00 2001 From: Fatih Arslan Date: Wed, 31 Oct 2018 19:01:15 +0300 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71b5c16b..5ce86957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## unreleased +* Fix driver name in CSIDriver, StorageClass and GetNodeInfo() + [[GH-96]](https://github.com/digitalocean/csi-digitalocean/pull/96) + ## v0.3.0 - 2018.10.29 * This release is intended to be used with Kubernetes `v1.12.x` and is not compatible with older versions of Kubernetes. The latest CSI changes in v1.12.x are not compatible with older version unfortunately, therefore going forward we will not support older version anymore. The requirements also has changed, please make sure to read the README.md to see what kubelet and kube-apiserver flags needs to be enabled.