From b7c5b38c608460967a9aa450159d33772380620d Mon Sep 17 00:00:00 2001 From: Satoru Takeuchi Date: Wed, 7 Feb 2024 08:38:28 +0000 Subject: [PATCH] update Signed-off-by: Satoru Takeuchi --- .gitignore | 1 + README.md | 15 ++--- config.sh | 3 +- k8s-cluster-fini.sh | 2 +- k8s-cluster-init.sh | 8 +-- samples/cluster-on-host.yaml | 19 +++--- samples/cluster-on-pvc.yaml | 112 ++++++++++++++++++++++++----------- samples/local.yaml | 31 ---------- 8 files changed, 99 insertions(+), 92 deletions(-) create mode 100644 .gitignore delete mode 100644 samples/local.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4f671f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +deploy/* diff --git a/README.md b/README.md index 6f6b123..b05e8e4 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ A helper script to run the integration test of Rook and launch arbitrary Rook cl # supported software versions -- rook: v1.10.7 or later -- kubeadm: v1.25.3 or later +- rook: v1.13.2 or later +- minikube: v1.6.24 or later # Usage @@ -14,17 +14,18 @@ This programs is only tests in Ubuntu 22.04 environment. The following tools should be installed. - kubectl -- kubeadm +- minikube +- containerd There should be scratch devices for OSDs. By default("cluster-test.yaml"), Rook consumes all scratch devices for OSDs. -## installation +## Usage -Copy scripts to the test environment. +Copy manifests from Rook source ```console -cp *.sh ${GOPATH}/src/github.com/rook/rook -cd $_ +cd rook-helper +cp -a /deploy/examples ``` ## Usage diff --git a/config.sh b/config.sh index 09bbb6b..a7e5751 100644 --- a/config.sh +++ b/config.sh @@ -1,3 +1,2 @@ export OPERATOR_DIR=deploy/examples -export CLUSTER_CR=$OPERATOR_DIR/cluster-test.yaml -export KUBECONFIG=~/admin.conf +export CLUSTER_CR=samples/cluster-on-host.yaml diff --git a/k8s-cluster-fini.sh b/k8s-cluster-fini.sh index 30e8247..3f1eca7 100755 --- a/k8s-cluster-fini.sh +++ b/k8s-cluster-fini.sh @@ -2,4 +2,4 @@ . config.sh -sudo kubeadm reset +minikube delete diff --git a/k8s-cluster-init.sh b/k8s-cluster-init.sh index d486c0b..1e91143 100755 --- a/k8s-cluster-init.sh +++ b/k8s-cluster-init.sh @@ -2,10 +2,4 @@ . config.sh -CONFFILE=/etc/kubernetes/admin.conf - -sudo kubeadm init --pod-network-cidr 10.244.0.0/16 -sudo cp $CONFFILE ~/ -sudo chown $(id -u):$(id -g) ~/admin.conf -sudo kubectl --kubeconfig $CONFFILE taint nodes --all node-role.kubernetes.io/control-plane- -sudo kubectl --kubeconfig $CONFFILE apply -f https://raw.githubusercontent.com/flannel-io/flannel/v0.22.2/Documentation/kube-flannel.yml +minikube start --driver=none --container-runtime=containerd diff --git a/samples/cluster-on-host.yaml b/samples/cluster-on-host.yaml index b8fe504..8c8f43d 100644 --- a/samples/cluster-on-host.yaml +++ b/samples/cluster-on-host.yaml @@ -6,7 +6,7 @@ metadata: spec: dataDirHostPath: /var/lib/rook cephVersion: - image: quay.io/ceph/ceph:v17.2.6 + image: quay.io/ceph/ceph:v18.2.1 allowUnsupported: true mon: count: 1 @@ -17,19 +17,18 @@ spec: dashboard: enabled: false crashCollector: - disable: true + disable: false storage: - useAllNodes: true + useAllNodes: false useAllDevices: false - devices: - - name: /dev/sdb + nodes: + - name: coffee + devices: + - name: /dev/sdb + monitoring: + enabled: false healthCheck: daemonHealth: mon: interval: 45s timeout: 600s - priorityClassNames: - all: system-node-critical - mgr: system-cluster-critical - disruptionManagement: - managePodBudgets: true diff --git a/samples/cluster-on-pvc.yaml b/samples/cluster-on-pvc.yaml index 24d6ef8..42e1f77 100644 --- a/samples/cluster-on-pvc.yaml +++ b/samples/cluster-on-pvc.yaml @@ -1,55 +1,99 @@ +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: manual +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: local-osd + labels: + type: local-osd +spec: + storageClassName: manual + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + volumeMode: Block + local: + path: /dev/sdb + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - coffee # Please change this to your node +--- apiVersion: ceph.rook.io/v1 kind: CephCluster metadata: name: rook-ceph - namespace: rook-ceph + namespace: rook-ceph # namespace:cluster spec: dataDirHostPath: /var/lib/rook mon: count: 1 allowMultiplePerNode: false cephVersion: - image: ceph/ceph:v17.2.6 + image: quay.io/ceph/ceph:v18.2.1 allowUnsupported: false skipUpgradeChecks: false continueUpgradeAfterChecksEvenIfNotHealthy: false + mgr: + count: 1 dashboard: enabled: false - network: - hostNetwork: false crashCollector: disable: true storage: storageClassDeviceSets: - - name: set1 - count: 1 - portable: false - tuneSlowDeviceClass: true - placement: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: + - name: set1 + count: 1 + portable: false + encrypted: false + placement: + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: ScheduleAnyway labelSelector: matchExpressions: - - key: app - operator: In - values: - - rook-ceph-osd - - key: app - operator: In - values: - - rook-ceph-osd-prepare - topologyKey: kubernetes.io/hostname - resources: - volumeClaimTemplates: - - metadata: - name: data - spec: - resources: - requests: - storage: 5Gi - storageClassName: manual - volumeMode: Block - accessModes: - - ReadWriteOnce + - key: app + operator: In + values: + - rook-ceph-osd + - rook-ceph-osd-prepare + preparePlacement: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - rook-ceph-osd + - key: app + operator: In + values: + - rook-ceph-osd-prepare + topologyKey: kubernetes.io/hostname + volumeClaimTemplates: + - metadata: + name: data + spec: + resources: + requests: + storage: 5Gi + storageClassName: manual + volumeMode: Block + accessModes: + - ReadWriteOnce + onlyApplyOSDPlacement: false diff --git a/samples/local.yaml b/samples/local.yaml deleted file mode 100644 index ad0228f..0000000 --- a/samples/local.yaml +++ /dev/null @@ -1,31 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: manual -provisioner: kubernetes.io/no-provisioner -volumeBindingMode: WaitForFirstConsumer ---- -kind: PersistentVolume -apiVersion: v1 -metadata: - name: local-osd - labels: - type: local-osd -spec: - storageClassName: manual - capacity: - storage: 5Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - volumeMode: Block - local: - path: /dev/sdb - nodeAffinity: - required: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - ubuntu2004