标签:container das hex delete ons 执行 min pat device
https://rook.io/docs/rook/v1.1/ceph-examples.html?rook-ceph官方指导
https://github.com/rook/rook/tree/master/cluster/examples/kubernetes/ceph?github项目地址
gitlab上传的附件
修改 node的调度策略,只要ceph-osd为enabled的node才可调度osd的pod,其他类似
osd:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: ceph-osd
operator: In
values:
- enabled
选择node运行的存储
- node:
- name: "k8s-node03"
devices: # specific devices to use for storage can be specified for each node
- name: "vdb"
开启mgr dashbord
dashboard:
enabled: true
执行storageclass-delete.yaml文件,此文件大致执行如下内容:
官方对此两种的使用方式为
The storage classes are found in different sub-directories depending on the driver:
csi/rbd: The CSI driver for block devices. This is the preferred driver going forward.
flex: The flex driver will be deprecated in a future release to be determined.
所以此处使用csi这种面向未来的方式
动态存储卷调用实例
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: nginx-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi storageClassName: rook-ceph
有问题(略)
执行cephobjstoreUser.yaml文件,生成对象存储的用户
获取Access key
kubectl get secret rook-ceph-object-user-my-store-admin -o yaml -n rook-ceph|grep AccessKey | awk '{print $2}' | base64 --decode
获取Secret Key
kubectl get secret rook-ceph-object-user-my-store-admin -o yaml -n rook-ceph|grep SecretKey | awk '{print $2}' | base64 --decode
access_key = SH48VDNKNIIZT45TYO1P
host_base = oss.jwt.com
host_bucket = %(*)s.oss.jwt.com
secret_key = wTjY1bU3UH4AvDB7w6s4VnP97O5IsoeWbEkxwCP2
use_https = False
s3cmd ls 查看bucket列表
s3cmd mb s3://my-bucket-name 创建bucket,且bucket名称是唯一的,不可重复
s3cmd rb s3://my-bucket-name 删除空的bucket
s3cmd rb s3://my-bucket-name 列举bucket中的内容
s3cmd put file.txt s3://my-bucket-name/file.txt 上传文件到bucket的指定目录下
s3cmd put ./* s3://my-bucket-name/ 批量上传
s3cmd get s3://my-bucket-name/file.txt file.txt 下载bucket中的指定文件
s3cmd get s3://my-bucket-name/* ./ 批量下载
s3cmd del s3://my-bucket-name/file.txt 删除bucket中的文件
设置mgr dashbord中的object gateway,根据官方设置,未成功
Enabling Dashboard Object Gateway managementProvided you have deployed the Ceph Toolbox, created an Object Store and a user, you can enable Object Gateway management by providing the user credentials to the dashboard:
Access toolbox CLI:
kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath=‘{.items[0].metadata.name}‘) bash
Enable system flag on the user:
radosgw-admin user modify --uid=my-user --system
Provide the user credentials:
ceph dashboard set-rgw-api-user-id my-user
ceph dashboard set-rgw-api-access-key
ceph dashboard set-rgw-api-secret-key-->
使用kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath=‘{.items[0].metadata.name}‘) bash
命令进入ceph的管理中
ceph常用命令
ceph -s 查看集群状态 ceph osd status 查看osd状态 ceph pg stat 查看pg状态 ceph osd pool set pool pg_num 64 设置pg数量 ceph osd pool set pool pgp_num 64 设置pgp数量,在集群规模较小,pg数量过少会导致监控警告,此两条命令需一起使用
标签:container das hex delete ons 执行 min pat device
原文地址:https://www.cnblogs.com/dyb0204/p/11994349.html