From db09e58c4eb8cd4ba88efae448088f26f1a90fbf Mon Sep 17 00:00:00 2001 From: Blaine Gardner Date: Wed, 10 Jul 2019 11:03:00 -0600 Subject: [PATCH] ceph manifests: update upgrade-from yaml files Update the upgrade-from-*.yaml files to be appropriate for upgrade from v1.0 to master. Currently no creations or deletions are necessary, but the files are kept as a placeholder for the upcoming v1.1 upgrade docs. Signed-off-by: Blaine Gardner --- .../ceph/upgrade-from-v0.9-create.yaml | 223 ------------------ .../ceph/upgrade-from-v0.9-delete.yaml | 53 ----- .../ceph/upgrade-from-v1.0-create.yaml | 41 ++++ .../ceph/upgrade-from-v1.0-delete.yaml | 1 + 4 files changed, 42 insertions(+), 276 deletions(-) delete mode 100644 cluster/examples/kubernetes/ceph/upgrade-from-v0.9-create.yaml delete mode 100644 cluster/examples/kubernetes/ceph/upgrade-from-v0.9-delete.yaml create mode 100644 cluster/examples/kubernetes/ceph/upgrade-from-v1.0-create.yaml create mode 100644 cluster/examples/kubernetes/ceph/upgrade-from-v1.0-delete.yaml diff --git a/cluster/examples/kubernetes/ceph/upgrade-from-v0.9-create.yaml b/cluster/examples/kubernetes/ceph/upgrade-from-v0.9-create.yaml deleted file mode 100644 index edf1ad4e1..000000000 --- a/cluster/examples/kubernetes/ceph/upgrade-from-v0.9-create.yaml +++ /dev/null @@ -1,223 +0,0 @@ ---- - -# The cluster role for managing all the cluster-specific resources in a namespace -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRole -metadata: - name: rook-ceph-cluster-mgmt - labels: - operator: rook - storage-backend: ceph -rules: -- apiGroups: - - "" - resources: - - secrets - - pods - - pods/log - - services - - configmaps - verbs: - - get - - list - - watch - - patch - - create - - update - - delete -- apiGroups: - - apps # upgrade note: changed from 'extensions' to 'apps' in Rook 1.0 - resources: - - deployments - - daemonsets - # - replicasets - # upgrade note: 'replicasets' removed in Rook 1.0 - verbs: - - get - - list - - watch - - create - - update - - delete - ---- - -# The role for the operator to manage resources in its own namespace -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: Role -metadata: - name: rook-ceph-system - namespace: rook-ceph-system - labels: - operator: rook - storage-backend: ceph -rules: -- apiGroups: - - "" - resources: - - pods - - configmaps - - services - verbs: - - get - - list - - watch - - patch - - create - - update - - delete -- apiGroups: - - apps # upgrade note: changed from 'extensions' to 'apps' in Rook 1.0 - resources: - - daemonsets - - statefulsets # upgrade note: added in Rook 1.0 to support CSI - verbs: - - get - - list - - watch - - create - - update - - delete - ---- - -# The cluster role for managing the Rook CRDs -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRole -metadata: - name: rook-ceph-global - labels: - operator: rook - storage-backend: ceph -rules: -- apiGroups: - - "" - resources: - # Pod access is needed for fencing - - pods - # Node access is needed for determining nodes where mons should run - - nodes - - nodes/proxy - verbs: - - get - - list - - watch -- apiGroups: - - "" - resources: - - events - # PVs and PVCs are managed by the Rook provisioner - - persistentvolumes - - persistentvolumeclaims - - endpoints # upgrade note: added in Rook 1.0 - verbs: - - get - - list - - watch - - patch - - create - - update - - delete -- apiGroups: - - storage.k8s.io - resources: - - storageclasses - verbs: - - get - - list - - watch -- apiGroups: - - batch - resources: - - jobs - verbs: - - get - - list - - watch - - create - - update - - delete -- apiGroups: - - ceph.rook.io - resources: - - "*" - verbs: - - "*" -- apiGroups: - - rook.io - resources: - - "*" - verbs: - - "*" - ---- - -# Aspects of ceph-mgr that require access to the system namespace -kind: ClusterRole # upgrade note: changed from a Role to a ClusterRole in 1.0 -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: rook-ceph-mgr-system - namespace: rook-ceph-system -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - ---- - -# Allow the ceph mgr to access the rook system resources necessary for the mgr modules -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: rook-ceph-mgr-system - namespace: rook-ceph -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole # upgrade note: changed from a Role to a ClusterRole in 1.0 - name: rook-ceph-mgr-system -subjects: -- kind: ServiceAccount - name: rook-ceph-mgr - namespace: rook-ceph - ---- - -# Allow the ceph mgr to access cluster-wide resources necessary for the mgr modules -kind: ClusterRoleBinding # upgrade note: changed from a RoleBinding to a ClusterRoleBinding in 1.0 -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: rook-ceph-mgr-cluster -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: rook-ceph-mgr-cluster -subjects: -- kind: ServiceAccount - name: rook-ceph-mgr - namespace: rook-ceph - ---- - -# NFS CRD added in Rook v1.0 -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: cephnfses.ceph.rook.io -spec: - group: ceph.rook.io - names: - kind: CephNFS - listKind: CephNFSList - plural: cephnfses - singular: cephnfs - shortNames: - - nfs - scope: Namespaced - version: v1 - ---- diff --git a/cluster/examples/kubernetes/ceph/upgrade-from-v0.9-delete.yaml b/cluster/examples/kubernetes/ceph/upgrade-from-v0.9-delete.yaml deleted file mode 100644 index 91dc2e6e8..000000000 --- a/cluster/examples/kubernetes/ceph/upgrade-from-v0.9-delete.yaml +++ /dev/null @@ -1,53 +0,0 @@ ---- - -# The cluster role for managing all the cluster-specific resources in a namespace -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRole -metadata: - name: rook-ceph-cluster-mgmt - ---- - -# The role for the operator to manage resources in the system namespace -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: Role -metadata: - name: rook-ceph-system - namespace: rook-ceph-system - ---- - -# The cluster role for managing the Rook CRDs -apiVersion: rbac.authorization.k8s.io/v1beta1 -kind: ClusterRole -metadata: - name: rook-ceph-global - ---- - -# Aspects of ceph-mgr that require access to the system namespace -kind: Role -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: rook-ceph-mgr-system - namespace: rook-ceph - ---- - -# Allow the ceph mgr to access the rook system resources necessary for the mgr modules -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: rook-ceph-mgr-system - namespace: rook-ceph-system - ---- - -# Allow the ceph mgr to access cluster-wide resources necessary for the mgr modules -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1beta1 -metadata: - name: rook-ceph-mgr-cluster - namespace: rook-ceph - ---- diff --git a/cluster/examples/kubernetes/ceph/upgrade-from-v1.0-create.yaml b/cluster/examples/kubernetes/ceph/upgrade-from-v1.0-create.yaml new file mode 100644 index 000000000..517307076 --- /dev/null +++ b/cluster/examples/kubernetes/ceph/upgrade-from-v1.0-create.yaml @@ -0,0 +1,41 @@ +# Service account, role, and role binding to allow cmd-reporter job to run in ceph cluster namespace +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: rook-ceph-cmd-reporter + namespace: rook-ceph +--- +kind: Role +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: rook-ceph-cmd-reporter + namespace: rook-ceph +rules: +- apiGroups: + - "" + resources: + - pods + - configmaps + verbs: + - get + - list + - watch + - create + - update + - delete +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: rook-ceph-cmd-reporter + namespace: rook-ceph +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: rook-ceph-cmd-reporter +subjects: +- kind: ServiceAccount + name: rook-ceph-cmd-reporter + namespace: rook-ceph +--- diff --git a/cluster/examples/kubernetes/ceph/upgrade-from-v1.0-delete.yaml b/cluster/examples/kubernetes/ceph/upgrade-from-v1.0-delete.yaml new file mode 100644 index 000000000..ed97d539c --- /dev/null +++ b/cluster/examples/kubernetes/ceph/upgrade-from-v1.0-delete.yaml @@ -0,0 +1 @@ +---