Skip to content

Commit

Permalink
upd: more common manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed Jan 27, 2021
1 parent 23bb95c commit d138216
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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: [""]
Expand Down Expand Up @@ -51,19 +50,18 @@ 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

---
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"]
Expand All @@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit d138216

Please sign in to comment.