From 0802d19711c42543c0421dcfa3162f0bfe3143c9 Mon Sep 17 00:00:00 2001 From: Jason Taylor Date: Wed, 29 Apr 2020 15:27:21 -0400 Subject: [PATCH] Doc updates for controller namespace Make all namespace settings explicit and add more documentation around setting appropriate namespace when installing. --- README.md | 3 ++- .../rbac-snapshot-controller.yaml | 16 +++++++++++----- .../setup-snapshot-controller.yaml | 6 ++++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9b4d98ba..b8e30f96 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ The Volume Snapshot feature now depends on a new, volume snapshot controller in 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). -If your cluster does not come pre-installed with the correct components, you may manually install these components by executing the following steps. +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. Install Snapshot Beta CRDs: * kubectl create -f config/crd @@ -68,6 +68,7 @@ Install Snapshot Beta CRDs: * Do this once per cluster Install Common Snapshot Controller: +* Update the namespace to an appropriate value for your environment (e.g. kube-system) * kubectl create -f deploy/kubernetes/snapshot-controller * https://github.com/kubernetes-csi/external-snapshotter/tree/master/deploy/kubernetes/snapshot-controller * Do this once per cluster diff --git a/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml b/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml index fee85af7..bffde0de 100644 --- a/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml +++ b/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml @@ -1,8 +1,15 @@ # RBAC file for the snapshot controller. +# +# The snapshot controller implements the control loop for CSI snapshot functionality. +# It should be installed as part of the base Kubernetes distribution in an appropriate +# namespace for components implementing base system functionality. For installing with +# Vanilla Kubernetes, kube-system makes sense for the namespace. + apiVersion: v1 kind: ServiceAccount metadata: name: snapshot-controller + namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system --- kind: ClusterRole @@ -44,8 +51,7 @@ metadata: subjects: - kind: ServiceAccount name: snapshot-controller - # replace with non-default namespace name - namespace: default + namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system roleRef: kind: ClusterRole # change the name also here if the ClusterRole gets renamed @@ -56,7 +62,7 @@ roleRef: kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: - namespace: default # TODO: replace with the namespace you want for your controller + namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system name: snapshot-controller-leaderelection rules: - apiGroups: ["coordination.k8s.io"] @@ -68,11 +74,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 + namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system subjects: - kind: ServiceAccount name: snapshot-controller - namespace: default # TODO: replace with the namespace you want for your controller + namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system roleRef: kind: Role name: snapshot-controller-leaderelection diff --git a/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml b/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml index 6d000f68..92a99cf8 100644 --- a/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml +++ b/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml @@ -1,10 +1,16 @@ # This YAML file shows how to deploy the snapshot controller +# The snapshot controller implements the control loop for CSI snapshot functionality. +# It should be installed as part of the base Kubernetes distribution in an appropriate +# namespace for components implementing base system functionality. For installing with +# Vanilla Kubernetes, kube-system makes sense for the namespace. + --- kind: StatefulSet apiVersion: apps/v1 metadata: name: snapshot-controller + namespace: default # TODO: replace with the namespace you want for your controller, e.g. kube-system spec: serviceName: "snapshot-controller" replicas: 1