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
相关推荐
云飞云共享云桌面20 小时前
传统工作站 vs 云飞云共享云桌面:制造业设计云桌面选型深度对比
运维·服务器·前端·网络·3d·架构·制造
Maynor9961 天前
我用 Codex 给自己的网站上线了一个智能体客服:从 Dify 到服务器部署,全程实战复盘
运维·服务器
java_cj1 天前
深入kubectl create源码:从YAML到Pod的完整链路拆解
运维·云原生·容器·kubernetes
深圳恒讯1 天前
越南服务器BGP多线和单线有什么区别?
运维·服务器
志栋智能1 天前
超自动化运维如何提升安全合规水平?
运维·安全·自动化
A_humble_scholar1 天前
Linux(九) 进程管理完全指南:从入门到实战
linux·运维·chrome
江华森1 天前
Linux 操作命令完全指南
linux·运维
源图客1 天前
【AI向量数据库】Weaviate介绍与部署
运维·docker·容器
用什么都重名1 天前
Git分支合并与远程服务器同步实战:保留关键配置文件
运维·服务器·git
C++ 老炮儿的技术栈1 天前
Ubuntu root账号自动登陆
linux·运维·服务器·c语言·c++·ubuntu·visual studio