From d2d74b5bb338ed1c8e7aa504c1bbc84de79fde26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20K=C3=A4mmerling?=
 <lukas.kaemmerling@hetzner-cloud.de>
Date: Mon, 19 Oct 2020 11:56:38 +0200
Subject: [PATCH] Prepare Release v1.5.0 (#158)

---
 CHANGES.md                            |  10 +-
 README.md                             |   5 +-
 deploy/kubernetes/hcloud-csi-1.13.yml | 236 --------------------------
 deploy/kubernetes/hcloud-csi.yml      |  14 +-
 driver/driver.go                      |   2 +-
 5 files changed, 23 insertions(+), 244 deletions(-)
 delete mode 100644 deploy/kubernetes/hcloud-csi-1.13.yml

diff --git a/CHANGES.md b/CHANGES.md
index df1917c..ccb2fbc 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,10 +1,16 @@
 # Changes
 
-## master
+## v1.5.0
 
 - Allow using the node name as node indicator instead of using the
   metadata service
-- Allow to tune the log level using the `LOG_LEVEL` environment variable.
+- Allow to tune the log level using the `LOG_LEVEL` environment variable
+- Update k8s dependencies to v1.17.12
+- Update Go to 1.15
+- Update hcloud-go to 1.22.0
+- Update csi driver container to alpine linux v3.12
+- Note: As of this release all versions are end-to-end tested against the 
+  official Kubernetes testsuite, as a result a few smaller issues where fixed
 
 ## v1.4.0
 
diff --git a/README.md b/README.md
index 08fb9e3..eb82593 100644
--- a/README.md
+++ b/README.md
@@ -78,9 +78,8 @@ enabling you to use Volumes within Kubernetes. Please note that this driver **re
 
 | Kubernetes    | CSI Driver   | Deployment File |
 | ------------- | -----:| ------------------------------------------------------------------------------------------------------:|
-| 1.16-1.18     | 1.4.0 | https://raw.githubusercontent.com/hetznercloud/csi-driver/v1.4.0/deploy/kubernetes/hcloud-csi.yml      |
-| 1.14-1.15     | 1.1.5 | https://raw.githubusercontent.com/hetznercloud/csi-driver/v1.1.5/deploy/kubernetes/hcloud-csi.yml      |
-| 1.13          | 1.1.5 | https://raw.githubusercontent.com/hetznercloud/csi-driver/v1.1.5/deploy/kubernetes/hcloud-csi-1.13.yml |
+| 1.17-1.19     | 1.5.0 | https://raw.githubusercontent.com/hetznercloud/csi-driver/v1.5.0/deploy/kubernetes/hcloud-csi.yml      |
+| 1.16          | 1.4.0 | https://raw.githubusercontent.com/hetznercloud/csi-driver/v1.4.0/deploy/kubernetes/hcloud-csi.yml      |
 
 
 ## E2E Tests
diff --git a/deploy/kubernetes/hcloud-csi-1.13.yml b/deploy/kubernetes/hcloud-csi-1.13.yml
deleted file mode 100644
index 9e0095b..0000000
--- a/deploy/kubernetes/hcloud-csi-1.13.yml
+++ /dev/null
@@ -1,236 +0,0 @@
----
-kind: StorageClass
-apiVersion: storage.k8s.io/v1
-metadata:
-  namespace: kube-system
-  name: hcloud-volumes
-  annotations:
-    storageclass.kubernetes.io/is-default-class: "true"
-provisioner: csi.hetzner.cloud
-volumeBindingMode: WaitForFirstConsumer
----
-apiVersion: v1
-kind: ServiceAccount
-metadata:
-  name: hcloud-csi
-  namespace: kube-system
----
-kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
-  name: hcloud-csi
-rules:
-  # attacher
-  - apiGroups: [""]
-    resources: ["persistentvolumes"]
-    verbs: ["get", "list", "watch", "update"]
-  - apiGroups: [""]
-    resources: ["nodes"]
-    verbs: ["get", "list", "watch"]
-  - apiGroups: ["csi.storage.k8s.io"]
-    resources: ["csinodeinfos"]
-    verbs: ["get", "list", "watch"]
-  - apiGroups: ["storage.k8s.io"]
-    resources: ["volumeattachments"]
-    verbs: ["get", "list", "watch", "update"]
-  # provisioner
-  - 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"]
-  # cluster registrar
-  - apiGroups: ["apiextensions.k8s.io"]
-    resources: ["customresourcedefinitions"]
-    verbs: ["create", "list", "watch", "delete"]
-  - apiGroups: ["csi.storage.k8s.io"]
-    resources: ["csidrivers"]
-    verbs: ["create", "list", "watch", "delete"]
-  # node
-  - apiGroups: [""]
-    resources: ["events"]
-    verbs: ["get", "list", "watch", "create", "update", "patch"]
----
-kind: ClusterRoleBinding
-apiVersion: rbac.authorization.k8s.io/v1
-metadata:
-  name: hcloud-csi
-subjects:
-  - kind: ServiceAccount
-    name: hcloud-csi
-    namespace: kube-system
-roleRef:
-  kind: ClusterRole
-  name: hcloud-csi
-  apiGroup: rbac.authorization.k8s.io
----
-kind: StatefulSet
-apiVersion: apps/v1
-metadata:
-  name: hcloud-csi-controller
-  namespace: kube-system
-spec:
-  selector:
-    matchLabels:
-      app: hcloud-csi-controller
-  serviceName: hcloud-csi-controller
-  replicas: 1
-  template:
-    metadata:
-      labels:
-        app: hcloud-csi-controller
-    spec:
-      serviceAccount: hcloud-csi
-      containers:
-        - name: csi-attacher
-          image: quay.io/k8scsi/csi-attacher:v1.0.1
-          args:
-            - --csi-address=/var/lib/csi/sockets/pluginproxy/csi.sock
-            - --v=5
-          volumeMounts:
-            - name: socket-dir
-              mountPath: /var/lib/csi/sockets/pluginproxy/
-          securityContext:
-            privileged: true
-            capabilities:
-              add: ["SYS_ADMIN"]
-            allowPrivilegeEscalation: true
-        - name: csi-provisioner
-          image: quay.io/k8scsi/csi-provisioner:v1.0.1
-          args:
-            - --provisioner=csi.hetzner.cloud
-            - --csi-address=/var/lib/csi/sockets/pluginproxy/csi.sock
-            - --feature-gates=Topology=true
-            - --v=5
-          volumeMounts:
-            - name: socket-dir
-              mountPath: /var/lib/csi/sockets/pluginproxy/
-          securityContext:
-            privileged: true
-            capabilities:
-              add: ["SYS_ADMIN"]
-            allowPrivilegeEscalation: true
-        - name: csi-cluster-driver-registrar
-          image: quay.io/k8scsi/csi-cluster-driver-registrar:v1.0.1
-          args:
-            - --pod-info-mount-version="v1"
-            - --csi-address=/var/lib/csi/sockets/pluginproxy/csi.sock
-            - --v=5
-          volumeMounts:
-            - name: socket-dir
-              mountPath: /var/lib/csi/sockets/pluginproxy/
-        - name: hcloud-csi-driver
-          image: hetznercloud/hcloud-csi-driver:1.1.5
-          imagePullPolicy: Always
-          env:
-            - name: CSI_ENDPOINT
-              value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
-            - name: HCLOUD_TOKEN
-              valueFrom:
-                secretKeyRef:
-                  name: hcloud-csi
-                  key: token
-          volumeMounts:
-            - name: socket-dir
-              mountPath: /var/lib/csi/sockets/pluginproxy/
-          securityContext:
-            privileged: true
-            capabilities:
-              add: ["SYS_ADMIN"]
-            allowPrivilegeEscalation: true
-      volumes:
-        - name: socket-dir
-          emptyDir: {}
----
-kind: DaemonSet
-apiVersion: apps/v1
-metadata:
-  name: hcloud-csi-node
-  namespace: kube-system
-  labels:
-    app: hcloud-csi
-spec:
-  selector:
-    matchLabels:
-      app: hcloud-csi
-  template:
-    metadata:
-      labels:
-        app: hcloud-csi
-    spec:
-      serviceAccount: hcloud-csi
-      hostNetwork: true
-      containers:
-        - name: csi-node-driver-registrar
-          image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.1
-          args:
-            - --v=5
-            - --csi-address=/csi/csi.sock
-            - --kubelet-registration-path=/var/lib/kubelet/plugins/csi.hetzner.cloud/csi.sock
-          env:
-            - name: KUBE_NODE_NAME
-              valueFrom:
-                fieldRef:
-                  apiVersion: v1
-                  fieldPath: spec.nodeName
-          volumeMounts:
-            - name: plugin-dir
-              mountPath: /csi
-            - name: registration-dir
-              mountPath: /registration
-          securityContext:
-            privileged: true
-        - name: hcloud-csi-driver
-          image: hetznercloud/hcloud-csi-driver:1.1.5
-          imagePullPolicy: Always
-          env:
-            - name: CSI_ENDPOINT
-              value: unix:///csi/csi.sock
-            - name: HCLOUD_TOKEN
-              valueFrom:
-                secretKeyRef:
-                  name: hcloud-csi
-                  key: token
-          volumeMounts:
-            - name: kubelet-dir
-              mountPath: /var/lib/kubelet
-              mountPropagation: "Bidirectional"
-            - name: plugin-dir
-              mountPath: /csi
-            - name: device-dir
-              mountPath: /dev
-          securityContext:
-            privileged: true
-      volumes:
-        - name: kubelet-dir
-          hostPath:
-            path: /var/lib/kubelet
-            type: Directory
-        - name: plugin-dir
-          hostPath:
-            path: /var/lib/kubelet/plugins/csi.hetzner.cloud/
-            type: DirectoryOrCreate
-        - name: registration-dir
-          hostPath:
-            path: /var/lib/kubelet/plugins_registry/
-            type: Directory
-        - name: device-dir
-          hostPath:
-            path: /dev
-            type: Directory
diff --git a/deploy/kubernetes/hcloud-csi.yml b/deploy/kubernetes/hcloud-csi.yml
index a53c316..24e43d2 100644
--- a/deploy/kubernetes/hcloud-csi.yml
+++ b/deploy/kubernetes/hcloud-csi.yml
@@ -147,13 +147,18 @@ spec:
               add: ["SYS_ADMIN"]
             allowPrivilegeEscalation: true
         - name: hcloud-csi-driver
-          image: hetznercloud/hcloud-csi-driver:1.4.0
+          image: hetznercloud/hcloud-csi-driver:v1.5.0
           imagePullPolicy: Always
           env:
             - name: CSI_ENDPOINT
               value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
             - name: METRICS_ENDPOINT
               value: 0.0.0.0:9189
+            - name: KUBE_NODE_NAME
+              valueFrom:
+                fieldRef:
+                  apiVersion: v1
+                  fieldPath: spec.nodeName
             - name: HCLOUD_TOKEN
               valueFrom:
                 secretKeyRef:
@@ -238,7 +243,7 @@ spec:
           securityContext:
             privileged: true
         - name: hcloud-csi-driver
-          image: hetznercloud/hcloud-csi-driver:1.4.0
+          image: hetznercloud/hcloud-csi-driver:v1.5.0
           imagePullPolicy: Always
           env:
             - name: CSI_ENDPOINT
@@ -250,6 +255,11 @@ spec:
                 secretKeyRef:
                   name: hcloud-csi
                   key: token
+            - name: KUBE_NODE_NAME
+              valueFrom:
+                fieldRef:
+                  apiVersion: v1
+                  fieldPath: spec.nodeName
           volumeMounts:
             - name: kubelet-dir
               mountPath: /var/lib/kubelet
diff --git a/driver/driver.go b/driver/driver.go
index 4396737..67128ad 100644
--- a/driver/driver.go
+++ b/driver/driver.go
@@ -2,7 +2,7 @@ package driver
 
 const (
 	PluginName    = "csi.hetzner.cloud"
-	PluginVersion = "1.4.0"
+	PluginVersion = "1.5.0"
 
 	MaxVolumesPerNode = 16
 	MinVolumeSize     = 10 // GB
-- 
GitLab