Skip to content

Commit 790068f

Browse files
authored
Merge pull request #309 from jasonltaylor/namespace
Update docs for controller namespace
2 parents 509aa5f + 0802d19 commit 790068f

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ The Volume Snapshot feature now depends on a new, volume snapshot controller in
6060

6161
Therefore, it is strongly recommended that Kubernetes distributors bundle and deploy the controller and CRDs as part of their Kubernetes cluster management process (independent of any CSI Driver).
6262

63-
If your cluster does not come pre-installed with the correct components, you may manually install these components by executing the following steps.
63+
If your Kubernetes distribution does not bundle the snapshot controller, you may manually install these components by executing the following steps. Note that the snapshot controller YAML files in the git repository deploy into the default namespace for system testing purposes. For general use, update the snapshot controller YAMLs with an appropriate namespace prior to installing. For example, on a Vanilla Kubernetes cluster update the namespace from 'default' to 'kube-system' prior to issuing the kubectl create command.
6464

6565
Install Snapshot Beta CRDs:
6666
* kubectl create -f config/crd
6767
* https://github.com/kubernetes-csi/external-snapshotter/tree/master/config/crd
6868
* Do this once per cluster
6969

7070
Install Common Snapshot Controller:
71+
* Update the namespace to an appropriate value for your environment (e.g. kube-system)
7172
* kubectl create -f deploy/kubernetes/snapshot-controller
7273
* https://github.com/kubernetes-csi/external-snapshotter/tree/master/deploy/kubernetes/snapshot-controller
7374
* Do this once per cluster

deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
# RBAC file for the snapshot controller.
2+
#
3+
# The snapshot controller implements the control loop for CSI snapshot functionality.
4+
# It should be installed as part of the base Kubernetes distribution in an appropriate
5+
# namespace for components implementing base system functionality. For installing with
6+
# Vanilla Kubernetes, kube-system makes sense for the namespace.
7+
28
apiVersion: v1
39
kind: ServiceAccount
410
metadata:
511
name: snapshot-controller
12+
namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system
613

714
---
815
kind: ClusterRole
@@ -44,8 +51,7 @@ metadata:
4451
subjects:
4552
- kind: ServiceAccount
4653
name: snapshot-controller
47-
# replace with non-default namespace name
48-
namespace: default
54+
namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system
4955
roleRef:
5056
kind: ClusterRole
5157
# change the name also here if the ClusterRole gets renamed
@@ -56,7 +62,7 @@ roleRef:
5662
kind: Role
5763
apiVersion: rbac.authorization.k8s.io/v1
5864
metadata:
59-
namespace: default # TODO: replace with the namespace you want for your controller
65+
namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system
6066
name: snapshot-controller-leaderelection
6167
rules:
6268
- apiGroups: ["coordination.k8s.io"]
@@ -68,11 +74,11 @@ kind: RoleBinding
6874
apiVersion: rbac.authorization.k8s.io/v1
6975
metadata:
7076
name: snapshot-controller-leaderelection
71-
namespace: default # TODO: replace with the namespace you want for your controller
77+
namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system
7278
subjects:
7379
- kind: ServiceAccount
7480
name: snapshot-controller
75-
namespace: default # TODO: replace with the namespace you want for your controller
81+
namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system
7682
roleRef:
7783
kind: Role
7884
name: snapshot-controller-leaderelection

deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# This YAML file shows how to deploy the snapshot controller
22

3+
# The snapshot controller implements the control loop for CSI snapshot functionality.
4+
# It should be installed as part of the base Kubernetes distribution in an appropriate
5+
# namespace for components implementing base system functionality. For installing with
6+
# Vanilla Kubernetes, kube-system makes sense for the namespace.
7+
38
---
49
kind: StatefulSet
510
apiVersion: apps/v1
611
metadata:
712
name: snapshot-controller
13+
namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system
814
spec:
915
serviceName: "snapshot-controller"
1016
replicas: 1

0 commit comments

Comments
 (0)