From 41eb2a25521a2d66aafb524e87d0db69fba6cf2a Mon Sep 17 00:00:00 2001 From: Frank Ritchie Date: Fri, 11 Jun 2021 21:38:07 -0400 Subject: [PATCH] Use kpt for rook This PS is to enable kpt for rook-ceph. The situation is odd in that we need to use https://github.com/rook/rook/tree/master/cluster/examples/kubernetes/ceph as an upstream for each base directory but only need a single file in each case. The solution here is to clone the entire upstream directory into each base directory. Gitignore files are used to prevent having to commit hundreds of files to the repo. This is obviously not very efficient but it is the best I could come up with. Hopefully kpt will be able to sync single files on the future. Change-Id: I2a5fa63b56749653880be72333a7fce1620bdb6c --- manifests/composite/storage-cluster/Kptfile | 9 +++++ manifests/composite/storage-cluster/README.md | 26 ++++++------- .../storage-cluster/kustomization.yaml | 8 ++-- .../storage-cluster/upstream/.gitignore | 4 ++ .../storage-cluster/upstream/Kptfile | 11 ++++++ .../{ => upstream}/cluster.yaml | 0 .../{ => upstream}/toolbox.yaml | 0 manifests/function/rook-cluster/Kptfile | 33 ++++++++++++++++ manifests/function/rook-cluster/README.md | 38 ++++++++----------- .../cephfs/base/kustomization.yaml | 2 +- .../cephfs/base/upstream/.gitignore | 3 ++ .../rook-cluster/cephfs/base/upstream/Kptfile | 11 ++++++ .../base/{ => upstream}/filesystem.yaml | 0 .../rook-cluster/cephfs/kustomization.yaml | 4 +- .../dashboard/base/kustomization.yaml | 2 +- .../dashboard/base/upstream/.gitignore | 3 ++ .../dashboard/base/upstream/Kptfile | 11 ++++++ .../dashboard-external-http.yaml | 0 .../pools/base/kustomization.yaml | 6 +-- .../pools/base/upstream/.gitignore | 3 ++ .../rook-cluster/pools/base/upstream/Kptfile | 11 ++++++ .../pools/base/{ => upstream}/pool.yaml | 0 .../rook-cluster/pools/kustomization.yaml | 2 +- .../rook-cluster/pools/rbd/rbd-pool.yaml | 12 +++--- .../storageclasses/block/kustomization.yaml | 4 +- .../storageclasses/block/upstream/.gitignore | 3 ++ .../storageclasses/block/upstream/Kptfile | 11 ++++++ .../block/{ => upstream}/storageclass.yaml | 0 .../storageclasses/file/kustomization.yaml | 4 +- .../storageclasses/file/upstream/.gitignore | 3 ++ .../storageclasses/file/upstream/Kptfile | 11 ++++++ .../file/{ => upstream}/storageclass.yaml | 0 manifests/function/rook-operator/Kptfile | 9 +++++ manifests/function/rook-operator/README.md | 19 ++++++++++ .../function/rook-operator/kustomization.yaml | 20 +++++++++- .../rook-operator/upstream/.gitignore | 5 +++ .../function/rook-operator/upstream/Kptfile | 11 ++++++ .../function/rook-operator/upstream/README.md | 11 ------ .../rook-operator/upstream/common.yaml | 8 ++++ .../rook-operator/upstream/kustomization.yaml | 14 ------- .../rook-operator/upstream/namespace.yaml | 7 ---- .../rook-operator/upstream/operator.yaml | 12 +++--- 42 files changed, 252 insertions(+), 99 deletions(-) create mode 100644 manifests/composite/storage-cluster/Kptfile create mode 100644 manifests/composite/storage-cluster/upstream/.gitignore create mode 100644 manifests/composite/storage-cluster/upstream/Kptfile rename manifests/composite/storage-cluster/{ => upstream}/cluster.yaml (100%) rename manifests/composite/storage-cluster/{ => upstream}/toolbox.yaml (100%) create mode 100644 manifests/function/rook-cluster/Kptfile create mode 100644 manifests/function/rook-cluster/cephfs/base/upstream/.gitignore create mode 100644 manifests/function/rook-cluster/cephfs/base/upstream/Kptfile rename manifests/function/rook-cluster/cephfs/base/{ => upstream}/filesystem.yaml (100%) create mode 100644 manifests/function/rook-cluster/dashboard/base/upstream/.gitignore create mode 100644 manifests/function/rook-cluster/dashboard/base/upstream/Kptfile rename manifests/function/rook-cluster/dashboard/base/{ => upstream}/dashboard-external-http.yaml (100%) create mode 100644 manifests/function/rook-cluster/pools/base/upstream/.gitignore create mode 100644 manifests/function/rook-cluster/pools/base/upstream/Kptfile rename manifests/function/rook-cluster/pools/base/{ => upstream}/pool.yaml (100%) create mode 100644 manifests/function/rook-cluster/storageclasses/block/upstream/.gitignore create mode 100644 manifests/function/rook-cluster/storageclasses/block/upstream/Kptfile rename manifests/function/rook-cluster/storageclasses/block/{ => upstream}/storageclass.yaml (100%) create mode 100644 manifests/function/rook-cluster/storageclasses/file/upstream/.gitignore create mode 100644 manifests/function/rook-cluster/storageclasses/file/upstream/Kptfile rename manifests/function/rook-cluster/storageclasses/file/{ => upstream}/storageclass.yaml (100%) create mode 100644 manifests/function/rook-operator/Kptfile create mode 100644 manifests/function/rook-operator/README.md create mode 100644 manifests/function/rook-operator/upstream/.gitignore create mode 100644 manifests/function/rook-operator/upstream/Kptfile delete mode 100644 manifests/function/rook-operator/upstream/README.md delete mode 100644 manifests/function/rook-operator/upstream/kustomization.yaml delete mode 100644 manifests/function/rook-operator/upstream/namespace.yaml diff --git a/manifests/composite/storage-cluster/Kptfile b/manifests/composite/storage-cluster/Kptfile new file mode 100644 index 000000000..7e98c4e13 --- /dev/null +++ b/manifests/composite/storage-cluster/Kptfile @@ -0,0 +1,9 @@ +apiVersion: kpt.dev/v1alpha1 +kind: Kptfile +dependencies: +- name: upstream + git: + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph + ref: v1.6.3 + updateStrategy: force-delete-replace diff --git a/manifests/composite/storage-cluster/README.md b/manifests/composite/storage-cluster/README.md index 0dd301f34..91e4999a8 100644 --- a/manifests/composite/storage-cluster/README.md +++ b/manifests/composite/storage-cluster/README.md @@ -1,19 +1,19 @@ -In-place edits to the local copies of upstream Rook Custom Resource -examples are not recommended. The upstream examples can be considered -an immutable starting point. +# Rook Ceph CephCluster -Changes to the upstream examples should be made via Kustomize. +Kubernetes manifests for deploying a Rook CephCluster Custom Resource. -Rook Custom Resource Examples: +## Update Manifests -Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/cluster.yaml -Local: cluster.yaml -Tag: v1.6.3 +To update the upstream manifests in this function: -Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/toolbox.yaml -Local: toolbox.yaml -Tag: v1.6.3 +1. Update the git references in `Kptfile` -Kustomize Doc: +2. Run `kpt pkg sync .` from this directory. -https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization +3. Update any `Rook` container image references defined in version catalogs. + +4. If you plan on committing your changes restore the .gitignore file(s) + +``` +# git restore upstream/.gitignore +``` diff --git a/manifests/composite/storage-cluster/kustomization.yaml b/manifests/composite/storage-cluster/kustomization.yaml index d011cb564..8d69b500c 100644 --- a/manifests/composite/storage-cluster/kustomization.yaml +++ b/manifests/composite/storage-cluster/kustomization.yaml @@ -3,8 +3,8 @@ kind: Kustomization namespace: rook-ceph resources: - ceph-conf.yaml - - cluster.yaml - - toolbox.yaml + - upstream/cluster.yaml + - upstream/toolbox.yaml # Below is the functions section. You are free to comment out or in oppsite to remove comments # enabling or disabling any function in the list. # All functions are independent, and can be deployed simultaneously at any moment. @@ -26,7 +26,7 @@ patchesJSON6902: - op: replace path: /spec/dashboard/ssl value: true -# If you enabling ssl for the dashboard, do not forget +# If you enable ssl for the dashboard, don't forget # to enable the patch below - target: kind: Service @@ -39,7 +39,7 @@ patchesJSON6902: port: 8443 protocol: TCP targetPort: 8443 -patchesStrategicMerge: +patches: - |- apiVersion: ceph.rook.io/v1 kind: CephCluster diff --git a/manifests/composite/storage-cluster/upstream/.gitignore b/manifests/composite/storage-cluster/upstream/.gitignore new file mode 100644 index 000000000..a102574e4 --- /dev/null +++ b/manifests/composite/storage-cluster/upstream/.gitignore @@ -0,0 +1,4 @@ +* +!Kptfile +!cluster.yaml +!toolbox.yaml diff --git a/manifests/composite/storage-cluster/upstream/Kptfile b/manifests/composite/storage-cluster/upstream/Kptfile new file mode 100644 index 000000000..d3582f987 --- /dev/null +++ b/manifests/composite/storage-cluster/upstream/Kptfile @@ -0,0 +1,11 @@ +apiVersion: kpt.dev/v1alpha1 +kind: Kptfile +metadata: + name: upstream +upstream: + type: git + git: + commit: 69591248f69e23964734f0192944ef2442bc7885 + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph + ref: v1.6.3 diff --git a/manifests/composite/storage-cluster/cluster.yaml b/manifests/composite/storage-cluster/upstream/cluster.yaml similarity index 100% rename from manifests/composite/storage-cluster/cluster.yaml rename to manifests/composite/storage-cluster/upstream/cluster.yaml diff --git a/manifests/composite/storage-cluster/toolbox.yaml b/manifests/composite/storage-cluster/upstream/toolbox.yaml similarity index 100% rename from manifests/composite/storage-cluster/toolbox.yaml rename to manifests/composite/storage-cluster/upstream/toolbox.yaml diff --git a/manifests/function/rook-cluster/Kptfile b/manifests/function/rook-cluster/Kptfile new file mode 100644 index 000000000..2e30906fa --- /dev/null +++ b/manifests/function/rook-cluster/Kptfile @@ -0,0 +1,33 @@ +apiVersion: kpt.dev/v1alpha1 +kind: Kptfile +dependencies: +- name: cephfs/base/upstream + git: + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph + ref: v1.6.3 + updateStrategy: force-delete-replace +- name: dashboard/base/upstream + git: + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph + ref: v1.6.3 + updateStrategy: force-delete-replace +- name: pools/base/upstream + git: + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph + ref: v1.6.3 + updateStrategy: force-delete-replace +- name: storageclasses/block/upstream + git: + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph/csi/rbd + ref: v1.6.3 + updateStrategy: force-delete-replace +- name: storageclasses/file/upstream + git: + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph/csi/cephfs + ref: v1.6.3 + updateStrategy: force-delete-replace diff --git a/manifests/function/rook-cluster/README.md b/manifests/function/rook-cluster/README.md index 95a03631e..36314d2d8 100644 --- a/manifests/function/rook-cluster/README.md +++ b/manifests/function/rook-cluster/README.md @@ -1,31 +1,23 @@ -In-place edits to the local copies of upstream Rook Custom Resource -examples are not recommended. The upstream examples can be considered -an immutable starting point. +# Rook Ceph Custom Resources -Changes to the upstream examples should be made via Kustomize. +Kubernetes manifests for deploying select Rook Ceph Custom Resources. -Rook Custom Resource Examples: +## Update Manifests -Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/filesystem.yaml -Local: cephfs/base/filesystem.yaml -Tag: v1.6.3 +To update the upstream manifests in this function: -Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/dashboard-external-http.yaml -Local: dashboard/base/dashboard-external-http.yaml -Tag: v1.6.3 +1. Update the git references in `Kptfile` -Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/pool.yaml -Local: pools/base/pool.yaml -Tag: v1.6.3 +2. Run `kpt pkg sync .` from this directory. -Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml -Local: storageclasses/block/storageclass.yaml -Tag: v1.6.3 +3. Update any `Rook` container image references defined in version catalogs. -Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/csi/cephfs/storageclass.yaml -Local: storageclasses/file/storageclass.yaml -Tag: v1.6.3 +4. If you plan on committing your changes restore the .gitignore file(s) -Kustomize Doc: - -https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization +``` +# git restore cephfs/base/upstream/.gitignore +# git restore dashboard/base/upstream/.gitignore +# git restore pools/base/upstream/.gitignore +# git restore storageclasses/block/upstream/.gitignore +# git restore storageclasses/file/upstream/.gitignore +``` diff --git a/manifests/function/rook-cluster/cephfs/base/kustomization.yaml b/manifests/function/rook-cluster/cephfs/base/kustomization.yaml index 0e4a8d1f3..9fe030351 100644 --- a/manifests/function/rook-cluster/cephfs/base/kustomization.yaml +++ b/manifests/function/rook-cluster/cephfs/base/kustomization.yaml @@ -1,5 +1,5 @@ resources: -- filesystem.yaml +- upstream/filesystem.yaml patchesJSON6902: - target: kind: CephFilesystem diff --git a/manifests/function/rook-cluster/cephfs/base/upstream/.gitignore b/manifests/function/rook-cluster/cephfs/base/upstream/.gitignore new file mode 100644 index 000000000..e8cfc1660 --- /dev/null +++ b/manifests/function/rook-cluster/cephfs/base/upstream/.gitignore @@ -0,0 +1,3 @@ +* +!Kptfile +!filesystem.yaml diff --git a/manifests/function/rook-cluster/cephfs/base/upstream/Kptfile b/manifests/function/rook-cluster/cephfs/base/upstream/Kptfile new file mode 100644 index 000000000..d3582f987 --- /dev/null +++ b/manifests/function/rook-cluster/cephfs/base/upstream/Kptfile @@ -0,0 +1,11 @@ +apiVersion: kpt.dev/v1alpha1 +kind: Kptfile +metadata: + name: upstream +upstream: + type: git + git: + commit: 69591248f69e23964734f0192944ef2442bc7885 + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph + ref: v1.6.3 diff --git a/manifests/function/rook-cluster/cephfs/base/filesystem.yaml b/manifests/function/rook-cluster/cephfs/base/upstream/filesystem.yaml similarity index 100% rename from manifests/function/rook-cluster/cephfs/base/filesystem.yaml rename to manifests/function/rook-cluster/cephfs/base/upstream/filesystem.yaml diff --git a/manifests/function/rook-cluster/cephfs/kustomization.yaml b/manifests/function/rook-cluster/cephfs/kustomization.yaml index 7a7726287..65075762c 100644 --- a/manifests/function/rook-cluster/cephfs/kustomization.yaml +++ b/manifests/function/rook-cluster/cephfs/kustomization.yaml @@ -1,5 +1,5 @@ resources: -- ./base -patchesStrategicMerge: +- base +patches: - cephfs-mds.yaml - cephfs-pool.yaml diff --git a/manifests/function/rook-cluster/dashboard/base/kustomization.yaml b/manifests/function/rook-cluster/dashboard/base/kustomization.yaml index 55d782cbc..1b0365652 100644 --- a/manifests/function/rook-cluster/dashboard/base/kustomization.yaml +++ b/manifests/function/rook-cluster/dashboard/base/kustomization.yaml @@ -1,5 +1,5 @@ resources: -- dashboard-external-http.yaml +- upstream/dashboard-external-http.yaml patchesJSON6902: - target: kind: Service diff --git a/manifests/function/rook-cluster/dashboard/base/upstream/.gitignore b/manifests/function/rook-cluster/dashboard/base/upstream/.gitignore new file mode 100644 index 000000000..d8843cc75 --- /dev/null +++ b/manifests/function/rook-cluster/dashboard/base/upstream/.gitignore @@ -0,0 +1,3 @@ +* +!Kptfile +!dashboard-external-http.yaml diff --git a/manifests/function/rook-cluster/dashboard/base/upstream/Kptfile b/manifests/function/rook-cluster/dashboard/base/upstream/Kptfile new file mode 100644 index 000000000..d3582f987 --- /dev/null +++ b/manifests/function/rook-cluster/dashboard/base/upstream/Kptfile @@ -0,0 +1,11 @@ +apiVersion: kpt.dev/v1alpha1 +kind: Kptfile +metadata: + name: upstream +upstream: + type: git + git: + commit: 69591248f69e23964734f0192944ef2442bc7885 + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph + ref: v1.6.3 diff --git a/manifests/function/rook-cluster/dashboard/base/dashboard-external-http.yaml b/manifests/function/rook-cluster/dashboard/base/upstream/dashboard-external-http.yaml similarity index 100% rename from manifests/function/rook-cluster/dashboard/base/dashboard-external-http.yaml rename to manifests/function/rook-cluster/dashboard/base/upstream/dashboard-external-http.yaml diff --git a/manifests/function/rook-cluster/pools/base/kustomization.yaml b/manifests/function/rook-cluster/pools/base/kustomization.yaml index 598042757..b791ab6a4 100644 --- a/manifests/function/rook-cluster/pools/base/kustomization.yaml +++ b/manifests/function/rook-cluster/pools/base/kustomization.yaml @@ -1,6 +1,6 @@ resources: -- pool.yaml -patchesJSON6902: +- upstream/pool.yaml +patches: - target: kind: CephBlockPool name: replicapool @@ -8,5 +8,3 @@ patchesJSON6902: - op: replace path: /metadata/name value: pool - - op: remove - path: /spec/annotations diff --git a/manifests/function/rook-cluster/pools/base/upstream/.gitignore b/manifests/function/rook-cluster/pools/base/upstream/.gitignore new file mode 100644 index 000000000..0dbaac28e --- /dev/null +++ b/manifests/function/rook-cluster/pools/base/upstream/.gitignore @@ -0,0 +1,3 @@ +* +!Kptfile +!pool.yaml diff --git a/manifests/function/rook-cluster/pools/base/upstream/Kptfile b/manifests/function/rook-cluster/pools/base/upstream/Kptfile new file mode 100644 index 000000000..d3582f987 --- /dev/null +++ b/manifests/function/rook-cluster/pools/base/upstream/Kptfile @@ -0,0 +1,11 @@ +apiVersion: kpt.dev/v1alpha1 +kind: Kptfile +metadata: + name: upstream +upstream: + type: git + git: + commit: 69591248f69e23964734f0192944ef2442bc7885 + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph + ref: v1.6.3 diff --git a/manifests/function/rook-cluster/pools/base/pool.yaml b/manifests/function/rook-cluster/pools/base/upstream/pool.yaml similarity index 100% rename from manifests/function/rook-cluster/pools/base/pool.yaml rename to manifests/function/rook-cluster/pools/base/upstream/pool.yaml diff --git a/manifests/function/rook-cluster/pools/kustomization.yaml b/manifests/function/rook-cluster/pools/kustomization.yaml index 56bf582bc..813dabdcc 100644 --- a/manifests/function/rook-cluster/pools/kustomization.yaml +++ b/manifests/function/rook-cluster/pools/kustomization.yaml @@ -1,2 +1,2 @@ resources: -- ./rbd +- rbd diff --git a/manifests/function/rook-cluster/pools/rbd/rbd-pool.yaml b/manifests/function/rook-cluster/pools/rbd/rbd-pool.yaml index 12b164530..1b925d3e4 100644 --- a/manifests/function/rook-cluster/pools/rbd/rbd-pool.yaml +++ b/manifests/function/rook-cluster/pools/rbd/rbd-pool.yaml @@ -4,9 +4,9 @@ metadata: name: pool namespace: rook-ceph # namespace:cluster spec: - failureDomain: host - replicated: - size: 3 - quotas: - maxSize: "0" # e.g. "10Gi" - valid suffixes include k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi, Ei - maxObjects: 0 # 1000000000 = billion objects, 0 means no quotas + failureDomain: host + replicated: + size: 3 + quotas: + maxSize: "0" # e.g. "10Gi" - valid suffixes include k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi, Ei + maxObjects: 0 # 1000000000 = billion objects, 0 means no quotas diff --git a/manifests/function/rook-cluster/storageclasses/block/kustomization.yaml b/manifests/function/rook-cluster/storageclasses/block/kustomization.yaml index 5175e6813..47a0537cc 100644 --- a/manifests/function/rook-cluster/storageclasses/block/kustomization.yaml +++ b/manifests/function/rook-cluster/storageclasses/block/kustomization.yaml @@ -1,5 +1,5 @@ resources: -- storageclass.yaml +- upstream/storageclass.yaml patchesJSON6902: - target: kind: StorageClass @@ -8,6 +8,6 @@ patchesJSON6902: - op: replace path: /metadata/name value: block-storage-sc -patchesStrategicMerge: +patches: - patches/delete-pool.yaml - patches/rook-ceph-block.yaml diff --git a/manifests/function/rook-cluster/storageclasses/block/upstream/.gitignore b/manifests/function/rook-cluster/storageclasses/block/upstream/.gitignore new file mode 100644 index 000000000..bf96a2167 --- /dev/null +++ b/manifests/function/rook-cluster/storageclasses/block/upstream/.gitignore @@ -0,0 +1,3 @@ +* +!Kptfile +!storageclass.yaml diff --git a/manifests/function/rook-cluster/storageclasses/block/upstream/Kptfile b/manifests/function/rook-cluster/storageclasses/block/upstream/Kptfile new file mode 100644 index 000000000..4dd1ad3da --- /dev/null +++ b/manifests/function/rook-cluster/storageclasses/block/upstream/Kptfile @@ -0,0 +1,11 @@ +apiVersion: kpt.dev/v1alpha1 +kind: Kptfile +metadata: + name: upstream +upstream: + type: git + git: + commit: 69591248f69e23964734f0192944ef2442bc7885 + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph/csi/rbd + ref: v1.6.3 diff --git a/manifests/function/rook-cluster/storageclasses/block/storageclass.yaml b/manifests/function/rook-cluster/storageclasses/block/upstream/storageclass.yaml similarity index 100% rename from manifests/function/rook-cluster/storageclasses/block/storageclass.yaml rename to manifests/function/rook-cluster/storageclasses/block/upstream/storageclass.yaml diff --git a/manifests/function/rook-cluster/storageclasses/file/kustomization.yaml b/manifests/function/rook-cluster/storageclasses/file/kustomization.yaml index fadc2283d..a6bd11ac6 100644 --- a/manifests/function/rook-cluster/storageclasses/file/kustomization.yaml +++ b/manifests/function/rook-cluster/storageclasses/file/kustomization.yaml @@ -1,5 +1,5 @@ resources: -- storageclass.yaml +- upstream/storageclass.yaml patchesJSON6902: - target: kind: StorageClass @@ -14,5 +14,5 @@ patchesJSON6902: - op: replace path: /parameters/pool value: cephfs-data0 -patchesStrategicMerge: +patches: - patches/rook-ceph-cephfs.yaml diff --git a/manifests/function/rook-cluster/storageclasses/file/upstream/.gitignore b/manifests/function/rook-cluster/storageclasses/file/upstream/.gitignore new file mode 100644 index 000000000..bf96a2167 --- /dev/null +++ b/manifests/function/rook-cluster/storageclasses/file/upstream/.gitignore @@ -0,0 +1,3 @@ +* +!Kptfile +!storageclass.yaml diff --git a/manifests/function/rook-cluster/storageclasses/file/upstream/Kptfile b/manifests/function/rook-cluster/storageclasses/file/upstream/Kptfile new file mode 100644 index 000000000..23c54ce9a --- /dev/null +++ b/manifests/function/rook-cluster/storageclasses/file/upstream/Kptfile @@ -0,0 +1,11 @@ +apiVersion: kpt.dev/v1alpha1 +kind: Kptfile +metadata: + name: upstream +upstream: + type: git + git: + commit: 69591248f69e23964734f0192944ef2442bc7885 + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph/csi/cephfs + ref: v1.6.3 diff --git a/manifests/function/rook-cluster/storageclasses/file/storageclass.yaml b/manifests/function/rook-cluster/storageclasses/file/upstream/storageclass.yaml similarity index 100% rename from manifests/function/rook-cluster/storageclasses/file/storageclass.yaml rename to manifests/function/rook-cluster/storageclasses/file/upstream/storageclass.yaml diff --git a/manifests/function/rook-operator/Kptfile b/manifests/function/rook-operator/Kptfile new file mode 100644 index 000000000..7e98c4e13 --- /dev/null +++ b/manifests/function/rook-operator/Kptfile @@ -0,0 +1,9 @@ +apiVersion: kpt.dev/v1alpha1 +kind: Kptfile +dependencies: +- name: upstream + git: + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph + ref: v1.6.3 + updateStrategy: force-delete-replace diff --git a/manifests/function/rook-operator/README.md b/manifests/function/rook-operator/README.md new file mode 100644 index 000000000..fbf661eb8 --- /dev/null +++ b/manifests/function/rook-operator/README.md @@ -0,0 +1,19 @@ +# Rook Ceph Operator + +Kubernetes manifests for deploying the Rook Ceph Operator. + +## Update Manifests + +To update the upstream manifests in this function: + +1. Update the git references in `Kptfile` + +2. Run `kpt pkg sync .` from this directory. + +3. Update any `Rook` container image references defined in version catalogs. + +4. If you plan on committing your changes restore the .gitignore file(s) + +``` +# git restore upstream/.gitignore +``` diff --git a/manifests/function/rook-operator/kustomization.yaml b/manifests/function/rook-operator/kustomization.yaml index 39d8910a9..7c63bf5a7 100644 --- a/manifests/function/rook-operator/kustomization.yaml +++ b/manifests/function/rook-operator/kustomization.yaml @@ -1,4 +1,20 @@ resources: -- upstream -patchesStrategicMerge: +- upstream/common.yaml +- upstream/crds.yaml +- upstream/operator.yaml +patches: - rook-operator-patch-tolerations.yaml +- |- + kind: ConfigMap + apiVersion: v1 + metadata: + name: rook-ceph-operator-config + namespace: rook-ceph + data: + CSI_ENABLE_HOST_NETWORK: "true" + ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v3.3.1" + ROOK_CSI_REGISTRAR_IMAGE: "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1" + ROOK_CSI_RESIZER_IMAGE: "k8s.gcr.io/sig-storage/csi-resizer:v1.0.1" + ROOK_CSI_PROVISIONER_IMAGE: "k8s.gcr.io/sig-storage/csi-provisioner:v2.0.4" + ROOK_CSI_SNAPSHOTTER_IMAGE: "k8s.gcr.io/sig-storage/csi-snapshotter:v4.0.0" + ROOK_CSI_ATTACHER_IMAGE: "k8s.gcr.io/sig-storage/csi-attacher:v3.0.2" diff --git a/manifests/function/rook-operator/upstream/.gitignore b/manifests/function/rook-operator/upstream/.gitignore new file mode 100644 index 000000000..57db72a22 --- /dev/null +++ b/manifests/function/rook-operator/upstream/.gitignore @@ -0,0 +1,5 @@ +* +!Kptfile +!common.yaml +!crds.yaml +!operator.yaml diff --git a/manifests/function/rook-operator/upstream/Kptfile b/manifests/function/rook-operator/upstream/Kptfile new file mode 100644 index 000000000..d3582f987 --- /dev/null +++ b/manifests/function/rook-operator/upstream/Kptfile @@ -0,0 +1,11 @@ +apiVersion: kpt.dev/v1alpha1 +kind: Kptfile +metadata: + name: upstream +upstream: + type: git + git: + commit: 69591248f69e23964734f0192944ef2442bc7885 + repo: https://github.com/rook/rook + directory: cluster/examples/kubernetes/ceph + ref: v1.6.3 diff --git a/manifests/function/rook-operator/upstream/README.md b/manifests/function/rook-operator/upstream/README.md deleted file mode 100644 index ee122f59a..000000000 --- a/manifests/function/rook-operator/upstream/README.md +++ /dev/null @@ -1,11 +0,0 @@ -Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/common.yaml -Local: common.yaml -Tag: v1.6.3 - -Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/crds.yaml -Local: crds.yaml -Tag: v1.6.3 - -Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/operator.yaml -Local: operator.yaml -Tag: v1.6.3 diff --git a/manifests/function/rook-operator/upstream/common.yaml b/manifests/function/rook-operator/upstream/common.yaml index 95c86e2aa..9142378a9 100644 --- a/manifests/function/rook-operator/upstream/common.yaml +++ b/manifests/function/rook-operator/upstream/common.yaml @@ -9,6 +9,14 @@ # # Most of the sections are prefixed with a 'OLM' keyword which is used to build our CSV for an OLM (Operator Life Cycle manager) ################################################################################################################### + +# Namespace where the operator and other rook resources are created +apiVersion: v1 +kind: Namespace +metadata: + name: rook-ceph # namespace:cluster +# OLM: BEGIN OBJECTBUCKET ROLEBINDING +--- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: diff --git a/manifests/function/rook-operator/upstream/kustomization.yaml b/manifests/function/rook-operator/upstream/kustomization.yaml deleted file mode 100644 index ddf0e0060..000000000 --- a/manifests/function/rook-operator/upstream/kustomization.yaml +++ /dev/null @@ -1,14 +0,0 @@ -resources: -- namespace.yaml -- crds.yaml -- common.yaml -- operator.yaml -patchesStrategicMerge: -- |- - kind: ConfigMap - apiVersion: v1 - metadata: - name: rook-ceph-operator-config - namespace: rook-ceph - data: - CSI_ENABLE_HOST_NETWORK: "true" diff --git a/manifests/function/rook-operator/upstream/namespace.yaml b/manifests/function/rook-operator/upstream/namespace.yaml deleted file mode 100644 index 1f8ac6117..000000000 --- a/manifests/function/rook-operator/upstream/namespace.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# Namespace where the operator and other rook resources are created -apiVersion: v1 -kind: Namespace -metadata: - name: rook-ceph # namespace:cluster -# OLM: BEGIN OBJECTBUCKET ROLEBINDING ---- diff --git a/manifests/function/rook-operator/upstream/operator.yaml b/manifests/function/rook-operator/upstream/operator.yaml index ccc74542b..bc4283e19 100644 --- a/manifests/function/rook-operator/upstream/operator.yaml +++ b/manifests/function/rook-operator/upstream/operator.yaml @@ -69,12 +69,12 @@ data: # The default version of CSI supported by Rook will be started. To change the version # of the CSI driver to something other than what is officially supported, change # these images to the desired release of the CSI driver. - ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v3.3.1" - ROOK_CSI_REGISTRAR_IMAGE: "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1" - ROOK_CSI_RESIZER_IMAGE: "k8s.gcr.io/sig-storage/csi-resizer:v1.0.1" - ROOK_CSI_PROVISIONER_IMAGE: "k8s.gcr.io/sig-storage/csi-provisioner:v2.0.4" - ROOK_CSI_SNAPSHOTTER_IMAGE: "k8s.gcr.io/sig-storage/csi-snapshotter:v4.0.0" - ROOK_CSI_ATTACHER_IMAGE: "k8s.gcr.io/sig-storage/csi-attacher:v3.0.2" + # ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v3.3.1" + # ROOK_CSI_REGISTRAR_IMAGE: "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1" + # ROOK_CSI_RESIZER_IMAGE: "k8s.gcr.io/sig-storage/csi-resizer:v1.0.1" + # ROOK_CSI_PROVISIONER_IMAGE: "k8s.gcr.io/sig-storage/csi-provisioner:v2.0.4" + # ROOK_CSI_SNAPSHOTTER_IMAGE: "k8s.gcr.io/sig-storage/csi-snapshotter:v4.0.0" + # ROOK_CSI_ATTACHER_IMAGE: "k8s.gcr.io/sig-storage/csi-attacher:v3.0.2" # (Optional) set user created priorityclassName for csi plugin pods. # CSI_PLUGIN_PRIORITY_CLASSNAME: "system-node-critical"