# redis 配置段
redis:
type: external
external:
# support redis, redis+sentinel
# addr for redis: <host_redis>:<port_redis>
# addr for redis+sentinel: <host_sentinel1>:<port_sentinel1>,<host_sentinel2>:<port_sentinel2>,<host_sentinel3>:<port_sentinel3>
addr: "redis+sentinel: redis-sentinel-sentinel-headless.default.svc.cluster.local:26379" # 示例的写法貌似有问题,我后期手动更改了好多 configmap 和 secret,我后面删除了 redis+sentinel,upgrade 的时候不知道会不会覆盖我修改的配置,更新后检查一切正常
# The name of the set of Redis instances to monitor, it must be set to support redis+sentinel
sentinelMasterSet: "myMaster"
# The "coreDatabaseIndex" must be "0" as the library Harbor
# used doesn't support configuring it
# harborDatabaseIndex defaults to "0", but it can be configured to "6", this config is optional
# cacheLayerDatabaseIndex defaults to "0", but it can be configured to "7", this config is optional
coreDatabaseIndex: "0"
jobserviceDatabaseIndex: "1"
registryDatabaseIndex: "2"
trivyAdapterIndex: "5"
# harborDatabaseIndex: "6"
# cacheLayerDatabaseIndex: "7"
# username field can be an empty string, and it will be authenticated against the default user
username: ""
password: "Daocloud-123"
# If using existingSecret, the key must be REDIS_PASSWORD # 由于我们 redis-secret 里面的 key 不是它。所以这里我们用 password 的形式
existingSecret: ""
# postgres 配置段
database:
# if external database is used, set "type" to "external"
# and fill the connection information in "external" section
type: external
external:
host: "pg-cluster01.default.svc.cluster.local"
port: "5432"
username: "postgres"
password: "M5Al5QLf966WrJ6ql6Zf0kV27Zqj2vLSCtzOLv9du2pej4UyV24jUoNlM8n76XdU" # 这里 harbor-core 的 configmap 也自定义了 POSTGRESQL_PASSWORD
coreDatabase: "core"
# if using existing secret, the key must be "password"
existingSecret: ""
# "disable" - No SSL
# "require" - Always SSL (skip verification)
# "verify-ca" - Always SSL (verify that the certificate presented by the
# server was signed by a trusted CA)
# "verify-full" - Always SSL (verify that the certification presented by the
# server was signed by a trusted CA and the server host name matches the one
# in the certificate)
sslmode: "require" # 这里要改成 skip,否则 harbor-core 去连接 pg 时会报禁止该 pod 连接
# The maximum number of connections in the idle connection pool per pod (core+exporter).
# If it <=0, no idle connections are retained.
maxIdleConns: 100
# The maximum number of open connections to the database per pod (core+exporter).
# If it <= 0, then there is no limit on the number of open connections.
# Note: the default number of connections is 1024 for harbor's postgres.
maxOpenConns: 900
# trivy 配置段
trivy:
# enabled the flag to enable Trivy scanner
enabled: false # 启用后,他会自动关联 redis 的配置
# expose 配置段
expose:
# Set how to expose the service. Set the type as "ingress", "clusterIP", "nodePort" or "loadBalancer"
# and fill the information in the corresponding section
type: nodePort
# pvc 配置段
persistence:
enabled: true
resourcePolicy: "keep"
persistentVolumeClaim:
registry:
existingClaim: ""
storageClass: "nfs-csi"
subPath: ""
accessMode: ReadWriteOnce
size: 5Gi
annotations: {}
jobservice:
jobLog:
existingClaim: ""
storageClass: "nfs-csi"
subPath: ""
accessMode: ReadWriteOnce
size: 1Gi
annotations: {}
database:
existingClaim: ""
storageClass: "nfs-csi"
subPath: ""
accessMode: ReadWriteOnce
size: 1Gi
annotations: {}
redis:
existingClaim: ""
storageClass: "nfs-csi"
subPath: ""
accessMode: ReadWriteOnce
size: 1Gi
annotations: {}
trivy:
existingClaim: ""
storageClass: "nfs-csi"
subPath: ""
accessMode: ReadWriteOnce
size: 5Gi
annotations: {}
# get 并修改 externalURL
helm get values harbor -a > harbor-values.yaml
externalURL: https://10.29.14.36:30003
# 更新
helm upgrade harbor ./ -f harbor-values.yaml
Release "harbor" has been upgraded. Happy Helming!
NAME: harbor
LAST DEPLOYED: Fri Feb 14 16:25:09 2025
NAMESPACE: default
STATUS: deployed
REVISION: 3
TEST SUITE: None
NOTES:
Please wait for several minutes for Harbor deployment to complete.
Then you should be able to visit the Harbor portal at https://10.29.14.36:30003
For more details, please visit https://github.com/goharbor/harbor