From d138216421f0304b61fbb4c9b52e445645b336d3 Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Wed, 23 Dec 2020 19:04:27 +0100 Subject: [PATCH] upd: more common manifests --- .../rbac-snapshot-controller.yaml | 12 ++++-------- .../setup-snapshot-controller.yaml | 9 ++++----- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml b/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml index bffde0de2..a6b8c7a9e 100644 --- a/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml +++ b/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml @@ -9,13 +9,12 @@ apiVersion: v1 kind: ServiceAccount metadata: name: snapshot-controller - namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system + namespace: kube-system --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: - # rename if there are conflicts name: snapshot-controller-runner rules: - apiGroups: [""] @@ -51,10 +50,9 @@ metadata: subjects: - kind: ServiceAccount name: snapshot-controller - namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system + namespace: kube-system roleRef: kind: ClusterRole - # change the name also here if the ClusterRole gets renamed name: snapshot-controller-runner apiGroup: rbac.authorization.k8s.io @@ -62,8 +60,8 @@ roleRef: kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: - namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system name: snapshot-controller-leaderelection + namespace: kube-system rules: - apiGroups: ["coordination.k8s.io"] resources: ["leases"] @@ -74,13 +72,11 @@ kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: snapshot-controller-leaderelection - namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system + namespace: kube-system subjects: - kind: ServiceAccount name: snapshot-controller - namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system roleRef: kind: Role name: snapshot-controller-leaderelection apiGroup: rbac.authorization.k8s.io - diff --git a/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml b/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml index b6372cb57..0f60f5953 100644 --- a/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml +++ b/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml @@ -6,14 +6,13 @@ # Vanilla Kubernetes, kube-system makes sense for the namespace. --- -kind: StatefulSet +kind: Deployment apiVersion: apps/v1 metadata: name: snapshot-controller - namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system + namespace: kube-system spec: - serviceName: "snapshot-controller" - replicas: 1 + replicas: 2 selector: matchLabels: app: snapshot-controller @@ -28,5 +27,5 @@ spec: image: k8s.gcr.io/sig-storage/snapshot-controller:v4.0.0 args: - "--v=5" - - "--leader-election=false" + - "--leader-election=true" imagePullPolicy: IfNotPresent