Rook
https://rook.io/images/rook-logo.svg
色々あったけど現在はCeph Operatorになった
code:bash
$ kubectl apply -f common.yaml -f crds.yaml -f operator.yaml
$ kubectl get pod -n rook-ceph
NAME READY STATUS RESTARTS AGE
rook-ceph-operator-b89545b4f-w6zvw 1/1 Running 0 58s
single nodeなのでoverrideでosd size 1に(推奨は3)
code:bash
$ cat rook-config-override.yaml
kind: ConfigMap
apiVersion: v1
metadata:
name: rook-config-override
namespace: rook-ceph
data:
config: |
osd pool default size = 1
$ kubectl apply -f rook-config-override.yaml
code:yaml.patch
diff --git a/deploy/examples/cluster-on-pvc.yaml b/deploy/examples/cluster-on-pvc.yaml
index 388bfe1f4..f3ea2f7a4 100644
--- a/deploy/examples/cluster-on-pvc.yaml
+++ b/deploy/examples/cluster-on-pvc.yaml
@@ -16,7 +16,7 @@ spec:
mon:
# Set the number of mons to be started. Generally recommended to be 3.
# For highest availability, an odd number of mons should be specified.
- count: 3
+ count: 1
# The mons should be on unique nodes. For production, at least 3 nodes are recommended for this reason.
# Mons should only be allowed on the same node for test environments where data loss is acceptable.
allowMultiplePerNode: false
@@ -28,10 +28,10 @@ spec:
# size appropriate for monitor data will be used.
volumeClaimTemplate:
spec:
- storageClassName: gp2
+ storageClassName: topolvm-provisioner
resources:
requests:
- storage: 10Gi
+ storage: 10Mi
cephVersion:
image: quay.io/ceph/ceph:v16.2.7
allowUnsupported: false
@@ -51,7 +51,7 @@ spec:
storageClassDeviceSets:
- name: set1
# The number of OSDs to create from this device set
- count: 3
+ count: 1
# IMPORTANT: If volumes specified by the storageClassName are not portable across nodes
# this needs to be set to false. For example, if using the local storage provisioner
# this should be false.
@@ -81,33 +81,33 @@ spec:
operator: In
values:
- rook-ceph-osd
- 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
- topologySpreadConstraints:
- - maxSkew: 1
- # IMPORTANT: If you don't have zone labels, change this to another key such as kubernetes.io/hostname
- topologyKey: topology.kubernetes.io/zone
- whenUnsatisfiable: DoNotSchedule
- labelSelector:
- matchExpressions:
- - key: app
- operator: In
- values:
- - 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
+ ## topologySpreadConstraints:
+ ## - maxSkew: 1
+ ## # IMPORTANT: If you don't have zone labels, change this to another key such as kubernetes.io/hostname
+ ## topologyKey: topology.kubernetes.io/zone
+ ## whenUnsatisfiable: DoNotSchedule
+ ## labelSelector:
+ ## matchExpressions:
+ ## - key: app
+ ## operator: In
+ ## values:
+ ## - rook-ceph-osd-prepare
resources:
# These are the OSD daemon limits. For OSD prepare limits, see the separate section below for "prepareosd" resources
# limits:
@@ -125,9 +125,9 @@ spec:
spec:
resources:
requests:
- storage: 10Gi
+ storage: 10Mi
# IMPORTANT: Change the storage class depending on your environment
- storageClassName: gp2
+ storageClassName: topolvm-provisioner
volumeMode: Block
accessModes:
- ReadWriteOnce
$ kubectl apply -f cluster-on-pvc.yaml
single nodeなのでstorageclassはtestのやつ
code:bash
$ kubectl apply -f csi/rbd/storageclass-test.yaml
code:bash.yaml
$ cat podpvc.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: rook-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: rook-ceph-block
---
apiVersion: v1
kind: Pod
metadata:
name: my-pod
labels:
app.kubernetes.io/name: my-pod
spec:
containers:
- name: ubuntu
image: quay.io/cybozu/ubuntu:20.04
volumeMounts:
- mountPath: /test1
name: my-volume
volumes:
- name: my-volume
persistentVolumeClaim:
claimName: rook-pvc
OSDがUPするのに少し時間がかかるので待つと出来てる、おわり
dashboardも欲しければやっとく ドメインは適宜変更
code:bash
$ kubectl apply -f dashboard-ingress-https.yaml
参考