Merge pull request #459 from kvaps/common-example

Provide better defaults for external-snapshotter
This commit is contained in:
Kubernetes Prow Robot
2021-01-28 20:21:41 -08:00
committed by GitHub
2 changed files with 8 additions and 13 deletions

View File

@@ -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

View File

@@ -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