
图1. Harbor HA 架构

图2. Ceph Object Gateway 架构
应用场景
Ceph 以 Storage Class 形式接入k8s集群,提供 rbd 供有状态应用容器使用,如 redis、db、es 等等,甚至rbd 还能供主机直接挂载使用;另外也能提供 cephfs 供多点挂载读写应用使用, 如应用于机器学习场景下的高吞吐量读写。
Ceph 也能提供 S3 对象存储供 Harbor 使用,解决高可用模式下存储问题。同样的,S3 还能同时提供给业务使用。
本文档基于以下版本实现。
| Application | Version |
|---|---|
| Ceph | 1.14.2 |
| Harbor | 1.9.4 |
| Docker | CE 19.03 |
查看存储池状态
rados df
查看 zonegroup
radosgw-admin zonegroup get
创建对象存储
Create a radosgw user for s3 access
radosgw-admin user create --uid="harbor" --display-name="Harbor Registry"
Create a swift user
radosgw-admin subuser create --uid=harbor --subuser=harbor:swift --access=full
Create Secret Key
radosgw-admin key create --subuser=harbor:swift --key-type=swift --gen-secret
记住
keys
字段中的access_key
&secret_key
查看 bucket 状态
radosgw-admin bucket stats harbor
Harbor
修改 harbor 配置文件
harbor.yml
storage_service:
s3:
region: us-east-1
regionendpoint: http://192.168.0.10:7480
bucket: harbor
secure: false
accesskey: D1GOBJWCX79LJ469ABAT
secretkey: LFOcGayBQEP99prsuVEn4H8L0ZQNTWkgshcbh9Sl
region
可任意填写regionendpoint
填写 Ceph S3 服务地址bucket
填写 bucket 名称secure
falseaccesskey
access_keysecretkey
secret_key
启动 Harbor
启动Harbor即可。
文章转载自汝林外史,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




