bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
9.04k stars 9.22k forks source link

[bitnami/harbor] - Cannot start harbor with external database #30504

Closed kissferenc closed 2 days ago

kissferenc commented 3 days ago

Name and Version

bitnami/harbor 24.0.2

What architecture are you using?

amd64

What steps will reproduce the bug?

I cannot start harbor with an external database.

This is my helm chart values:

adminPassword: "admin"
externalURL: https://harbor.home.local
logLevel: warn
ipFamily:
  ipv6:
    enabled: false
exposureType: ingress
ingress:
  core:
    hostname: harbor.home.local
persistence:
  enabled: true
  resourcePolicy: "delete"
  persistentVolumeClaim:
    registry:
      size: 3Gi
    jobservice:
      size: 1Gi
    trivy:
      size: 3Gi
  imageChartStorage:
    type: filesystem
certificateVolume:
  resources:
     requests:
       cpu: 200m
       memory: 128Mi
     limits:
       cpu: 500m
       memory: 256Mi
nginx:
  image:
    registry: docker.io
    repository: bitnami/nginx
    tag: 1.27.2-debian-12-r0
  resources:
    requests:
      cpu: 200m
      memory: 128Mi
    limits:
      cpu: 500m
      memory: 128Mi
portal:
  image:
    registry: docker.io
    repository: bitnami/harbor-portal
    tag: 2.11.1-debian-12-r5
    pullPolicy: IfNotPresent
    debug: false
  resources:
    requests:
      cpu: 200m
      memory: 128Mi
    limits:
      cpu: 500m
      memory: 256Mi
core:
  image:
    registry: docker.io
    repository: bitnami/harbor-core
    tag: 2.11.1-debian-12-r6
  resources:
    requests:
      cpu: 200m
      memory: 128Mi
    limits:
      cpu: 1
      memory: 512Mi
jobservice:
  image:
    registry: docker.io
    repository: bitnami/harbor-jobservice
    tag: 2.11.1-debian-12-r5
  resources:
    requests:
      cpu: 200m
      memory: 128Mi
    limits:
      cpu: 500m
      memory: 256Mi
registry:
  credentials:
    username: registry
    password: registrypass
    ## If you update the username or password of registry, make sure use cli tool htpasswd to generate the bcrypt hash
    ## e.g. "htpasswd -nbBC10 $username $password"
    ##
    htpasswd: registrypass:xxx
  server:
    image:
      registry: docker.io
      repository: bitnami/harbor-registry
      tag: 2.11.1-debian-12-r6
    resources:
     requests:
       cpu: 200m
       memory: 128Mi
     limits:
       cpu: 500m
       memory: 256Mi
  controller:
    image:
      registry: docker.io
      repository: bitnami/harbor-registryctl
      tag: 2.11.1-debian-12-r5
    resources:
     requests:
       cpu: 200m
       memory: 128Mi
     limits:
       cpu: 500m
       memory: 256Mi
trivy:
  image:
    registry: docker.io
    repository: bitnami/harbor-adapter-trivy
    tag: 2.11.1-debian-12-r3
  resources:
     requests:
       cpu: 200m
       memory: 128Mi
     limits:
       cpu: 500m
       memory: 256Mi
exporter:
  image:
    registry: docker.io
    repository: bitnami/harbor-exporter
    tag: 2.11.1-debian-12-r6
  resources:
     requests:
       cpu: 200m
       memory: 128Mi
     limits:
       cpu: 500m
       memory: 256Mi
postgresql:
  enabled: false
externalDatabase:
  host: postgres-postgresql.db.svc.cluster.local
  user: harbor
  database: harbor
  password: harbor
redis:
  enabled: true
  architecture: standalone
  master:
    resources:
      requests:
        cpu: 200m
        memory: 128Mi
      limits:
        cpu: 500m
        memory: 256Mi

What do you see instead?

The core log output:

[ORM]2024/11/18 18:47:30 register db Ping `default`, failed to connect to `host=postgres-postgresql.db.svc.cluster.local user=harbor database=sslmode=disable`: server error (FATAL: database "sslmode=disable" does not exist (SQLSTATE 3D000))

The database name was misparsed: sslmode=disable.

After I turned the sslmode: enabled, the database name was sslmode=enabled.

gulecroc commented 2 days ago

You need to set externalDatabase.coreDatabase

https://github.com/bitnami/charts/blob/d7b125b8b6d6da047e76598d72449e71330d1ffb/bitnami/harbor/values.yaml#L3667

kissferenc commented 2 days ago

Oh! I see! I copied the externalDatabse settings from values of gitea and I didn't notice the difference! It is working now, thx for your help!