aws ec2部署harbor,使用s3存储

aws ec2部署harbor

官网下载部署文件

shell 复制代码
wget https://github.com/goharbor/harbor/releases/download/v2.13.1/harbor-online-installer-v2.13.1.tgz

创建名为harbor的IAM用户,给harbor用户或用户组授予S3 Bucket的权限策略。给harbor用户创建访问密钥,用于harbor.yml配置中

json 复制代码
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:GetBucketLocation",
        "s3:ListBucketMultipartUploads"
      ],
      "Resource": "arn:aws:s3:::test-harbor"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject",
        "s3:ListMultipartUploadParts",
        "s3:AbortMultipartUpload"
      ],
      "Resource": "arn:aws:s3:::test-harbor/*"
    }
  ]
}

配置harbor.yml文件

yaml 复制代码
hostname: hub.test.com

http:
  port: 80

# 配置证书,也可以只监听80端口,用ALB暴露服务
https:
  port: 443
  certificate: /home/ec2-user/test.com.pem
  private_key: /home/ec2-user/test.com.key

harbor_admin_password: qweasd

database:
  password: 123456

data_volume: /data

storage_service:
  s3:
    accesskey: xxxxxxxxxxx
    secretkey: xxxxxxxxxxxxxxxxxxxxx
    region: ap-southeast-1
    bucket: test-harbor
    regionendpoint: https://s3.ap-southeast-1.amazonaws.com
    secure: true
    v4auth: true

jobservice:
  max_job_workers: 4
  max_job_duration_hours: 24
  job_loggers:
    - STD_OUTPUT
    - FILE
  logger_sweeper_duration: 1

notification:
  webhook_job_max_retry: 3
  webhook_job_http_client_timeout: 3

log:
  level: info
  local:
    rotate_count: 20
    rotate_size: 200M
    location: /var/log/harbor

部署,执行官网部署文件中的install.sh,会根据配置生成docker-compose文件并启动。

shell 复制代码
sudo ./install.sh
相关推荐
wanhengidc17 小时前
云手机在网络游戏中的主要功能
运维·服务器·游戏·智能手机
HitpointNetSuite18 小时前
连锁餐饮行业ERP如何选择:为何Oracle NetSuite成为增长新引擎
大数据·运维·数据库·oracle·netsuite
讲师-汪春波18 小时前
[运维]宝塔 Apache环境使用CDN获取访客真实IP方法
运维·tcp/ip·apache·cdn
2401_858286111 天前
OS36.【Linux】简单理解EXT2文件系统(2)
linux·运维·服务器·数据结构·文件系统·ext2
勤源科技1 天前
全链路智能运维中的业务连续性保障与容灾切换机制
运维
Zach_yuan1 天前
程序地址空间
android·linux·运维·服务器
梁萌1 天前
Linux安装BiliNote
linux·运维·服务器·docker·bilinote
小安运维日记1 天前
RHCA - DO374 | Day03:通过自动化控制器运行剧本
linux·运维·数据库·自动化·ansible·1024程序员节
行思理1 天前
docker新手教程
运维·docker·容器
TG_yunshuguoji1 天前
亚马逊云渠道商:本地SSD缓存如何保障数据安全?
运维·服务器·安全·云计算·aws