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
相关推荐
代码方舟13 小时前
企业级对公银行 KYC 架构:基于天远人脸身份证比对A构建自动化客户尽调网关
运维·人工智能·架构·自动化
ShiXZ21313 小时前
网络调试四剑客:ping / telnet / nc / netstat 速查指令集
运维·开发语言·网络·php
小五传输13 小时前
Serv-U替代方案怎么选?政务机关文件安全传输对比与迁移指南
大数据·运维·安全
woniu_buhui_fei14 小时前
日常工作常用的命令(Linux+JDK)
linux·运维·服务器
snow@li14 小时前
Telnet 全景教程:全平台安装、命令使用、故障排查与安全规范
运维·网络
Bruce_Liuxiaowei14 小时前
自动化渗透测试——用AI构建自动化渗透测试流程
运维·人工智能·自动化
OnlineProxy14 小时前
如何在无需手机号的情况下创建 Google 账号:高信任度代理(High Trust Score Proxy)如何取代短信验证
运维·服务器·facebook
imaol114 小时前
文件编程--标准IO
linux·运维·算法
梦想的旅途214 小时前
企业微信SCRM怎么对接API?私域自动化常用接口清单
运维·自动化·企业微信
旗开得胜马到成功15 小时前
AMD TPM 8.3/8.5漏洞技术剖析:服务器加密信任根崩塌后的备份密钥泄露风险与紧急加固
运维·服务器·网络·系统架构