From 9f99f4cc8801c6c835f302e157d79913dc414688 Mon Sep 17 00:00:00 2001
From: Toby Yan <me@tobyan.com>
Date: Fri, 5 Feb 2021 11:42:49 +0800
Subject: [PATCH 1/2] feat: make it compatible to k3s v1.19.5+k3s2

Signed-off-by: Toby Yan <me@tobyan.com>
---
 deploy/kubernetes/attacher.yaml      | 5 ++++-
 deploy/kubernetes/csi-s3.yaml        | 2 +-
 deploy/kubernetes/provisioner.yaml   | 5 ++++-
 deploy/kubernetes/secret.yaml.sample | 1 +
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/deploy/kubernetes/attacher.yaml b/deploy/kubernetes/attacher.yaml
index e944f85..46c3aa2 100644
--- a/deploy/kubernetes/attacher.yaml
+++ b/deploy/kubernetes/attacher.yaml
@@ -54,11 +54,14 @@ spec:
       port: 12345
 ---
 kind: StatefulSet
-apiVersion: apps/v1beta1
+apiVersion: apps/v1
 metadata:
   name: csi-attacher-s3
   namespace: kube-system
 spec:
+  selector:
+    matchLabels:
+      app: "csi-attacher-s3"
   serviceName: "csi-attacher-s3"
   replicas: 1
   template:
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..55f7ff6 100644
--- a/deploy/kubernetes/provisioner.yaml
+++ b/deploy/kubernetes/provisioner.yaml
@@ -53,11 +53,14 @@ spec:
       port: 12345
 ---
 kind: StatefulSet
-apiVersion: apps/v1beta1
+apiVersion: apps/v1
 metadata:
   name: csi-provisioner-s3
   namespace: kube-system
 spec:
+  selector:
+    matchLabels:
+      app: "csi-provisioner-s3"
   serviceName: "csi-provisioner-s3"
   replicas: 1
   template:
diff --git a/deploy/kubernetes/secret.yaml.sample b/deploy/kubernetes/secret.yaml.sample
index 52d03f7..e3e82c8 100644
--- a/deploy/kubernetes/secret.yaml.sample
+++ b/deploy/kubernetes/secret.yaml.sample
@@ -1,6 +1,7 @@
 apiVersion: v1
 kind: Secret
 metadata:
+  namespace: kube-system
   name: csi-s3-secret
 stringData:
   accessKeyID: <YOUR_ACCESS_KEY_ID>

From 6fc0f7e3877e24127c3863fbc1c82edc6f2762ff Mon Sep 17 00:00:00 2001
From: Toby Yan <me@tobyan.com>
Date: Fri, 5 Feb 2021 11:55:35 +0800
Subject: [PATCH 2/2] feat: make secret yaml created at namespace: kube-system
 by default

Signed-off-by: Toby Yan <me@tobyan.com>
---
 README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.md b/README.md
index 80add03..2639887 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,7 @@ This is still very experimental and should not be used in any production environ
 apiVersion: v1
 kind: Secret
 metadata:
+  namespace: kube-system
   name: csi-s3-secret
 stringData:
   accessKeyID: <YOUR_ACCESS_KEY_ID>