Merge "Use kpt for rook"

This commit is contained in:
Zuul 2021-06-17 09:24:36 +00:00 committed by Gerrit Code Review
commit cd70a7e813
42 changed files with 252 additions and 99 deletions

View File

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

View File

@ -1,19 +1,19 @@
In-place edits to the local copies of upstream Rook Custom Resource # Rook Ceph CephCluster
examples are not recommended. The upstream examples can be considered
an immutable starting point.
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 To update the upstream manifests in this function:
Local: cluster.yaml
Tag: v1.6.3
Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/toolbox.yaml 1. Update the git references in `Kptfile`
Local: toolbox.yaml
Tag: v1.6.3
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
```

View File

@ -3,8 +3,8 @@ kind: Kustomization
namespace: rook-ceph namespace: rook-ceph
resources: resources:
- ceph-conf.yaml - ceph-conf.yaml
- cluster.yaml - upstream/cluster.yaml
- toolbox.yaml - upstream/toolbox.yaml
# Below is the functions section. You are free to comment out or in oppsite to remove comments # 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. # enabling or disabling any function in the list.
# All functions are independent, and can be deployed simultaneously at any moment. # All functions are independent, and can be deployed simultaneously at any moment.
@ -26,7 +26,7 @@ patchesJSON6902:
- op: replace - op: replace
path: /spec/dashboard/ssl path: /spec/dashboard/ssl
value: true 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 # to enable the patch below
- target: - target:
kind: Service kind: Service
@ -39,7 +39,7 @@ patchesJSON6902:
port: 8443 port: 8443
protocol: TCP protocol: TCP
targetPort: 8443 targetPort: 8443
patchesStrategicMerge: patches:
- |- - |-
apiVersion: ceph.rook.io/v1 apiVersion: ceph.rook.io/v1
kind: CephCluster kind: CephCluster

View File

@ -0,0 +1,4 @@
*
!Kptfile
!cluster.yaml
!toolbox.yaml

View File

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

View File

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

View File

@ -1,31 +1,23 @@
In-place edits to the local copies of upstream Rook Custom Resource # Rook Ceph Custom Resources
examples are not recommended. The upstream examples can be considered
an immutable starting point.
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 To update the upstream manifests in this function:
Local: cephfs/base/filesystem.yaml
Tag: v1.6.3
Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/dashboard-external-http.yaml 1. Update the git references in `Kptfile`
Local: dashboard/base/dashboard-external-http.yaml
Tag: v1.6.3
Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/pool.yaml 2. Run `kpt pkg sync .` from this directory.
Local: pools/base/pool.yaml
Tag: v1.6.3
Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml 3. Update any `Rook` container image references defined in version catalogs.
Local: storageclasses/block/storageclass.yaml
Tag: v1.6.3
Upstream: https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/csi/cephfs/storageclass.yaml 4. If you plan on committing your changes restore the .gitignore file(s)
Local: storageclasses/file/storageclass.yaml
Tag: v1.6.3
Kustomize Doc: ```
# git restore cephfs/base/upstream/.gitignore
https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization # git restore dashboard/base/upstream/.gitignore
# git restore pools/base/upstream/.gitignore
# git restore storageclasses/block/upstream/.gitignore
# git restore storageclasses/file/upstream/.gitignore
```

View File

@ -1,5 +1,5 @@
resources: resources:
- filesystem.yaml - upstream/filesystem.yaml
patchesJSON6902: patchesJSON6902:
- target: - target:
kind: CephFilesystem kind: CephFilesystem

View File

@ -0,0 +1,3 @@
*
!Kptfile
!filesystem.yaml

View File

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

View File

@ -1,5 +1,5 @@
resources: resources:
- ./base - base
patchesStrategicMerge: patches:
- cephfs-mds.yaml - cephfs-mds.yaml
- cephfs-pool.yaml - cephfs-pool.yaml

View File

@ -1,5 +1,5 @@
resources: resources:
- dashboard-external-http.yaml - upstream/dashboard-external-http.yaml
patchesJSON6902: patchesJSON6902:
- target: - target:
kind: Service kind: Service

View File

@ -0,0 +1,3 @@
*
!Kptfile
!dashboard-external-http.yaml

View File

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

View File

@ -1,6 +1,6 @@
resources: resources:
- pool.yaml - upstream/pool.yaml
patchesJSON6902: patches:
- target: - target:
kind: CephBlockPool kind: CephBlockPool
name: replicapool name: replicapool
@ -8,5 +8,3 @@ patchesJSON6902:
- op: replace - op: replace
path: /metadata/name path: /metadata/name
value: pool value: pool
- op: remove
path: /spec/annotations

View File

@ -0,0 +1,3 @@
*
!Kptfile
!pool.yaml

View File

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

View File

@ -1,2 +1,2 @@
resources: resources:
- ./rbd - rbd

View File

@ -4,9 +4,9 @@ metadata:
name: pool name: pool
namespace: rook-ceph # namespace:cluster namespace: rook-ceph # namespace:cluster
spec: spec:
failureDomain: host failureDomain: host
replicated: replicated:
size: 3 size: 3
quotas: quotas:
maxSize: "0" # e.g. "10Gi" - valid suffixes include k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi, Ei 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 maxObjects: 0 # 1000000000 = billion objects, 0 means no quotas

View File

@ -1,5 +1,5 @@
resources: resources:
- storageclass.yaml - upstream/storageclass.yaml
patchesJSON6902: patchesJSON6902:
- target: - target:
kind: StorageClass kind: StorageClass
@ -8,6 +8,6 @@ patchesJSON6902:
- op: replace - op: replace
path: /metadata/name path: /metadata/name
value: block-storage-sc value: block-storage-sc
patchesStrategicMerge: patches:
- patches/delete-pool.yaml - patches/delete-pool.yaml
- patches/rook-ceph-block.yaml - patches/rook-ceph-block.yaml

View File

@ -0,0 +1,3 @@
*
!Kptfile
!storageclass.yaml

View File

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

View File

@ -1,5 +1,5 @@
resources: resources:
- storageclass.yaml - upstream/storageclass.yaml
patchesJSON6902: patchesJSON6902:
- target: - target:
kind: StorageClass kind: StorageClass
@ -14,5 +14,5 @@ patchesJSON6902:
- op: replace - op: replace
path: /parameters/pool path: /parameters/pool
value: cephfs-data0 value: cephfs-data0
patchesStrategicMerge: patches:
- patches/rook-ceph-cephfs.yaml - patches/rook-ceph-cephfs.yaml

View File

@ -0,0 +1,3 @@
*
!Kptfile
!storageclass.yaml

View File

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

View File

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

View File

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

View File

@ -1,4 +1,20 @@
resources: resources:
- upstream - upstream/common.yaml
patchesStrategicMerge: - upstream/crds.yaml
- upstream/operator.yaml
patches:
- rook-operator-patch-tolerations.yaml - 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"

View File

@ -0,0 +1,5 @@
*
!Kptfile
!common.yaml
!crds.yaml
!operator.yaml

View File

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

View File

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

View File

@ -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) # 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 kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:

View File

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

View File

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

View File

@ -69,12 +69,12 @@ data:
# The default version of CSI supported by Rook will be started. To change the version # 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 # of the CSI driver to something other than what is officially supported, change
# these images to the desired release of the CSI driver. # these images to the desired release of the CSI driver.
ROOK_CSI_CEPH_IMAGE: "quay.io/cephcsi/cephcsi:v3.3.1" # 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_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_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_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_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_ATTACHER_IMAGE: "k8s.gcr.io/sig-storage/csi-attacher:v3.0.2"
# (Optional) set user created priorityclassName for csi plugin pods. # (Optional) set user created priorityclassName for csi plugin pods.
# CSI_PLUGIN_PRIORITY_CLASSNAME: "system-node-critical" # CSI_PLUGIN_PRIORITY_CLASSNAME: "system-node-critical"