helm 安装 rook-ceph(腾讯云镜像仓库)
1、 rook-ceph-operator
helm repo add rook-release https://charts.rook.io/release
helm repo update
helm search repo rook-release/rook-ceph
helm pull rook-release/rook-ceph --version v1.12.2 --untar
cat > ~/rook-ceph/values-prod.yml << 'EOF'
image:
repository: ccr.ccs.tencentyun.com/huanghuanhui/rook-ceph
tag: ceph-v1.12.2
pullPolicy: IfNotPresent
resources:
limits:
cpu: "2"
memory: "4Gi"
requests:
cpu: "1"
memory: "2Gi"
csi:
cephcsi:
# @default -- `quay.io/cephcsi/cephcsi:v3.9.0`
image: ccr.ccs.tencentyun.com/huanghuanhui/rook-ceph:cephcsi-v3.9.0
registrar:
# @default -- `registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.8.0`
image: ccr.ccs.tencentyun.com/huanghuanhui/rook-ceph:csi-node-driver-registrar-v2.8.0
provisioner:
# @default -- `registry.k8s.io/sig-storage/csi-provisioner:v3.5.0`
image: ccr.ccs.tencentyun.com/huanghuanhui/rook-ceph:csi-provisioner-v3.5.0
snapshotter:
# @default -- `registry.k8s.io/sig-storage/csi-snapshotter:v6.2.2`
image: ccr.ccs.tencentyun.com/huanghuanhui/rook-ceph:csi-snapshotter-v6.2.2
attacher:
# @default -- `registry.k8s.io/sig-storage/csi-attacher:v4.3.0`
image: ccr.ccs.tencentyun.com/huanghuanhui/rook-ceph:csi-attacher-v4.3.0
resizer:
# @default -- `registry.k8s.io/sig-storage/csi-resizer:v1.8.0`
image: ccr.ccs.tencentyun.com/huanghuanhui/rook-ceph:csi-resizer-v1.8.0
# -- Image pull policy
imagePullPolicy: IfNotPresent
EOF
helm upgrade --install --create-namespace --namespace rook-ceph rook-ceph -f ./values-prod.yml .
2、rook-ceph-cluster
helm repo add rook-release https://charts.rook.io/release
helm repo update
helm search repo rook-release/rook-ceph-cluster
helm pull rook-release/rook-ceph-cluster --version v1.12.2 --untar
cat > ~/rook-ceph-cluster/values-prod.yml << 'EOF'
toolbox:
enabled: true
EOF
helm upgrade --install --create-namespace --namespace rook-ceph rook-ceph-cluster --set operatorNamespace=rook-ceph -f ./values-prod.yml .
kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}') bash
3、NodePort(nodeport方式访问)
kubectl expose pod $(kubectl get pod -n rook-ceph | grep rook-ceph-mgr-a | awk '{print $1}') --type=NodePort --name=rook-ceph-mgr-a-service --port=8443
# kubectl delete service rook-ceph-mgr-a-service
密码
kubectl -n rook-ceph get secret rook-ceph-dashboard-password -o jsonpath="{['data']['password']}" | base64 --decode && echo
4、rook-ceph-mgr-dashboard-Ingress(ingress域名方式访问)
cat > ~/rook-ceph/rook-ceph-mgr-dashboard-Ingress.yml << 'EOF'
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: rook-ceph-mgr-dashboard-ingress
namespace: rook-ceph
annotations:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
nginx.ingress.kubernetes.io/server-snippet: |
proxy_ssl_verify off;
spec:
rules:
- host: rook-ceph.huanghuanhui.cloud
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: rook-ceph-mgr-dashboard
port:
name: https-dashboard
tls:
- hosts:
- rook-ceph.huanghuanhui.cloud
secretName: rook-ceph-mgr-dashboard-ingress-tls
EOF
kubectl create secret -n rook-ceph \
tls rook-ceph-mgr-dashboard-ingress-tls \
--key=/root/ssl/huanghuanhui.cloud_nginx/huanghuanhui.cloud.key \
--cert=/root/ssl/huanghuanhui.cloud_nginx/huanghuanhui.cloud_bundle.crt
kubectl apply -f ~/rook-ceph/rook-ceph-mgr-dashboard-Ingress.yml
密码
kubectl -n rook-ceph get secret rook-ceph-dashboard-password -o jsonpath="{['data']['password']}" | base64 --decode && echo
访问地址:rook-ceph.huanghuanhui.cloud
用户密码:admin、()
===
# https://github.com/rook/rook/issues/12758
ceph crash prune 3 # 保留最近3天的崩溃日志,并删除3天前的以前的日志
ceph crash prune 0
ceph crash ls