From af2dfeb0d28540c356ba1579a060509e1e33d6fb Mon Sep 17 00:00:00 2001
From: "Ching Yi, Chan" <qrtt1@infuseai.io>
Date: Wed, 3 Jun 2020 11:55:31 +0800
Subject: [PATCH] Migrate to StatefulSet app/v1

Signed-off-by: Ching Yi, Chan <qrtt1@infuseai.io>
---
 deploy/kubernetes/attacher.yaml     | 5 ++++-
 deploy/kubernetes/csi-s3.yaml       | 2 +-
 deploy/kubernetes/provisioner.yaml  | 5 ++++-
 deploy/kubernetes/storageclass.yaml | 2 +-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/deploy/kubernetes/attacher.yaml b/deploy/kubernetes/attacher.yaml
index e944f85..891f037 100644
--- a/deploy/kubernetes/attacher.yaml
+++ b/deploy/kubernetes/attacher.yaml
@@ -54,13 +54,16 @@ spec:
       port: 12345
 ---
 kind: StatefulSet
-apiVersion: apps/v1beta1
+apiVersion: apps/v1
 metadata:
   name: csi-attacher-s3
   namespace: kube-system
 spec:
   serviceName: "csi-attacher-s3"
   replicas: 1
+  selector:
+    matchLabels:
+      app: csi-attacher-s3
   template:
     metadata:
       labels:
diff --git a/deploy/kubernetes/csi-s3.yaml b/deploy/kubernetes/csi-s3.yaml
index 608aee1..b55e581 100644
--- a/deploy/kubernetes/csi-s3.yaml
+++ b/deploy/kubernetes/csi-s3.yaml
@@ -39,7 +39,7 @@ roleRef:
   apiGroup: rbac.authorization.k8s.io
 ---
 kind: DaemonSet
-apiVersion: apps/v1beta2
+apiVersion: apps/v1
 metadata:
   name: csi-s3
   namespace: kube-system
diff --git a/deploy/kubernetes/provisioner.yaml b/deploy/kubernetes/provisioner.yaml
index ea4cacb..711b541 100644
--- a/deploy/kubernetes/provisioner.yaml
+++ b/deploy/kubernetes/provisioner.yaml
@@ -53,13 +53,16 @@ spec:
       port: 12345
 ---
 kind: StatefulSet
-apiVersion: apps/v1beta1
+apiVersion: apps/v1
 metadata:
   name: csi-provisioner-s3
   namespace: kube-system
 spec:
   serviceName: "csi-provisioner-s3"
   replicas: 1
+  selector:
+    matchLabels:
+      app: csi-provisioner-s3
   template:
     metadata:
       labels:
diff --git a/deploy/kubernetes/storageclass.yaml b/deploy/kubernetes/storageclass.yaml
index 1bd02ed..ad6b39c 100644
--- a/deploy/kubernetes/storageclass.yaml
+++ b/deploy/kubernetes/storageclass.yaml
@@ -15,4 +15,4 @@ parameters:
   csi.storage.k8s.io/node-stage-secret-name: csi-s3-secret
   csi.storage.k8s.io/node-stage-secret-namespace: kube-system
   csi.storage.k8s.io/node-publish-secret-name: csi-s3-secret
-  csi.storage.k8s.io/node-publish-secret-namespace: kube-system
\ No newline at end of file
+  csi.storage.k8s.io/node-publish-secret-namespace: kube-system