실습
사전 작업
Ceph 클러스터 구성
{ export CLUSTER_NAME=$(kubectl get node \ -o=jsonpath='{.items[0].metadata.labels.alpha\.eksctl\.io\/cluster-name}') echo $CLUSTER_NAME }{ cat <<EOF > ceph-node.yaml apiVersion: eksctl.io/v1alpha5 kind: ClusterConfig metadata: name: $CLUSTER_NAME region: ap-northeast-2 managedNodeGroups: - name: ceph-node instanceType: c5.2xlarge desiredCapacity: 3 volumeSize: 20 labels: role: ceph additionalVolumes: - volumeName: /dev/sdf volumeSize: 20 volumeType: gp3 EOF eksctl create nodegroup --config-file=ceph-node.yaml }kubectl get node -l role=cephkubectl create ns rook-ceph{ helm repo add rook-release https://charts.rook.io/release helm repo update }cat <<EOF > rook-ceph.yaml nodeSelector: role: ceph csi: provisionerNodeAffinity: role=ceph admissionController: nodeAffinity: role=ceph priorityClassName: system-cluster-critical EOFhelm install rook-ceph rook-release/rook-ceph -n rook-ceph -f rook-ceph.yamlkubectl -n rook-ceph get pod -l app=rook-ceph-operatorkubectl -n rook-ceph logs deploy/rook-ceph-operatorcat <<EOF > rook-ceph-cluster.yaml cephClusterSpec: cephVersion: image: quay.io/ceph/ceph:v17.2.5 storage: useAllNodes: false useAllDevices: false nodes: - name: NODE_NAME devices: - name: DEVICE_NAME - name: NODE_NAME devices: - name: DEVICE_NAME - name: NODE_NAME devices: - name: DEVICE_NAME placement: all: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: role operator: In values: - ceph crashCollector: disable: true dashboard: enabled: true ssl: false cephFileSystems: - name: ceph-filesystem spec: metadataPool: replicated: size: 3 dataPools: - failureDomain: host replicated: size: 3 name: data0 metadataServer: activeCount: 1 activeStandby: true resources: limits: cpu: "2000m" memory: "4Gi" requests: cpu: "1000m" memory: "4Gi" priorityClassName: system-cluster-critical placement: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: role operator: In values: - ceph storageClass: enabled: true isDefault: false name: ceph-filesystem pool: data0 reclaimPolicy: Delete allowVolumeExpansion: true volumeBindingMode: "Immediate" mountOptions: [] parameters: csi.storage.k8s.io/provisioner-secret-name: rook-csi-cephfs-provisioner csi.storage.k8s.io/provisioner-secret-namespace: "{{ .Release.Namespace }}" csi.storage.k8s.io/controller-expand-secret-name: rook-csi-cephfs-provisioner csi.storage.k8s.io/controller-expand-secret-namespace: "{{ .Release.Namespace }}" csi.storage.k8s.io/node-stage-secret-name: rook-csi-cephfs-node csi.storage.k8s.io/node-stage-secret-namespace: "{{ .Release.Namespace }}" csi.storage.k8s.io/fstype: ext4 cephObjectStores: - name: ceph-objectstore spec: metadataPool: failureDomain: host replicated: size: 3 dataPool: failureDomain: host erasureCoded: dataChunks: 2 codingChunks: 1 preservePoolsOnDelete: true gateway: port: 80 resources: limits: cpu: "2000m" memory: "2Gi" requests: cpu: "1000m" memory: "1Gi" instances: 1 priorityClassName: system-cluster-critical placement: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: role operator: In values: - ceph storageClass: enabled: true name: ceph-bucket reclaimPolicy: Delete volumeBindingMode: "Immediate" parameters: region: ap-northeast-2 ingress: dashboard: ingressClassName: nginx host: name: HOST_NAME toolbox: enabled: true affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: role operator: In values: - ceph monitoring: enabled: false createPrometheusRules: false EOFhelm install rook-ceph-cluster rook-release/rook-ceph-cluster -n rook-ceph -f rook-ceph-cluster.yamlkubectl get crdkubectl get cephclusters.ceph.rook.io rook-ceph -n rook-cephkubectl -n rook-ceph logs deploy/rook-ceph-operator -fkubectl get pod -n rook-cephkubectl -n rook-ceph logs deploy/rook-ceph-operator -fkubectl get ing -n rook-cephkubectl -n rook-ceph get secret rook-ceph-dashboard-password \ -o jsonpath={.data.password} | base64 -d && echokubectl get sc
볼륨 프로비저닝
Cleanup
Last updated