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
相关推荐
一叶知秋yyds33 分钟前
Ubuntu 虚拟机安装 OpenClaw 完整流程
linux·运维·ubuntu·openclaw
斯普信云原生组1 小时前
Prometheus 环境监控虚机 Redis 方案(生产实操版)
运维·docker·容器
safestar20122 小时前
ES批量写入性能调优:BulkProcessor 参数详解与实战案例
java·大数据·运维·jenkins
来一颗砂糖橘3 小时前
负载均衡的多维深度解析
运维·负载均衡
楠奕3 小时前
CentOS7安装GoldenDB单机搭建及常见报错解决方案
linux·运维·服务器
GCTTTTTT3 小时前
远程服务器走本地代理
运维·服务器
剑锋所指,所向披靡!3 小时前
Linux常用指令(2)
linux·运维·服务器
飞Link4 小时前
逆向兼容的桥梁:3to2 自动化降级工具实现全解析
运维·开发语言·python·自动化
LIZhang20165 小时前
linux写一个脚本实时保存内存占用情况
linux·运维·服务器
FS_Marking5 小时前
ZTP(零接触配置):实现自动化与高效的网络部署
运维·网络·自动化