Back to Hub

cargo.ayedo.cloud/ayedo/k8s/harbor 0.0.27 k8sapp Apache 2.0

Installs Harbor via Helm Chart

polycrate block pull cargo.ayedo.cloud/ayedo/k8s/harbor:0.0.27

Harbor

Helm-based Harbor install. Exposed either through the chart Ingress (ingress.enabled, default true) or through the Gateway API on eg-shared (gateway.enabled). Both can run in parallel (cutover pattern) — see Exposure below.

Harbor 2.15.2 (Block 0.0.21)

Chart default is 1.19.2 (official pairing: Harbor 2.15.2). Harbor OSS images are pinned to v2.15.2.

Watch

  • Bundled internal PostgreSQL in 2.15.2 would jump 15 → 18 via pg_upgrade. This workspace uses external CNPG (database.type=external); that bundled upgrade does not run.
  • From Harbor 2.15.2 the chart Redis image becomes Valkey (goharbor/valkey-photon:v2.15.2), protocol-compatible. No new block keys.
  • Images (goharbor/*:v2.15.2) need registry/egress.

Release notes: https://github.com/goharbor/harbor/releases/tag/v2.15.2 Chart: https://github.com/goharbor/harbor-helm/releases/tag/v1.19.2

Workspaces with only ingress.* need no change.


Exposure: Ingress and/or Gateway API

Two independent switches, ingress.enabled (default true) and gateway.enabled (default false):

  • Ingress only — Helm expose.type=ingress. The chart Ingress routes /api/, /service/, /v2/, /c/ to harbor-core and / to harbor-portal.
  • Gateway only (ingress.enabled: false) — Helm expose.type=clusterIP, no chart Ingress. The HTTPRoute serves the host.
  • Both — chart Ingress and HTTPRoute serve the same host in parallel, with separate TLS secrets (harbor-ingress / harbor-gateway-tls). Use it to move DNS from the ingress controller to the Envoy VIP without downtime.

The HTTPRoute routes exactly like the chart Ingress, straight to <fullname>-core and <fullname>-portal (<fullname> = block name if it contains harbor, else <block-name>-harbor). Both Services exist in every expose mode, so flipping ingress.enabled never changes the Gateway path. Setting gateway.service_name replaces this with a single backend (e.g. harbor = the chart nginx, which only exists with ingress.enabled: false).

externalURL is https://<gateway.host or ingress.core.domain> whenever the Gateway or Ingress TLS is on.

Endpoint monitoring

Default on. Probes GET /api/v2.0/health and expects 200. GET / only hits the portal. GET /v2/ returns 401. The annotations land on the chart Ingress or, when gateway.enabled is true, on the HTTPRoute. Switch: ingress.endpoint_monitor.enabled (also for the HTTPRoute). polycrate_k8sapp_name is the block instance name.

Gateway API / Envoy (gateway)

Prerequisites in the cluster:

  • Gateway API CRDs and Envoy Gateway, e.g. via block cargo.ayedo.cloud/ayedo/k8s/envoy
  • a GatewayClass, default eg-shared (mergeGateways: true, shared VIP). eg-dedicated gives each Gateway its own VIP.
  • cert-manager with the ClusterIssuer from gateway.tls.issuer
  • DNS for the host points at the Envoy VIP

TLS terminates at Envoy; the backend is plain HTTP.

Resources (all in namespace, created by install, removed when gateway.enabled: false):

  • Certificate harbor-gateway-tls (cert-manager) — always with gateway.enabled
  • Gateway harbor-https (HTTPS :443, tls.mode: Terminate, allowedRoutes: Same) — only with create_gateway: true and empty parent_gateway_name
  • ClientTrafficPolicy harbor-https-client / BackendTrafficPolicy harbor-https-backend — only with an own Gateway
  • HTTPRoute harbor → harbor-core:80 (/api, /service, /v2, /c) and harbor-portal:80 (/) — always with gateway.enabled

Keys under gateway — format: key (default) — description:

  • enabled (false) — Create the Gateway API resources. false removes them on the next install.
  • create_gateway (true) — Own HTTPS Gateway in the namespace. Ignored once parent_gateway_name is set.
  • gateway_class_name (eg-shared) — GatewayClass of the own Gateway
  • gateway_name (harbor-https) — Name of the own Gateway. With create_gateway: false and no parent, the HTTPRoute points at an existing Gateway of this name in the block namespace.
  • parent_gateway_name ("") — Set → no own Gateway; the HTTPRoute attaches to this Gateway
  • parent_gateway_namespace (envoy-gateway-system) — Namespace of the parent Gateway
  • parent_gateway_section_name (https) — Listener (sectionName) of the parent Gateway
  • host ("" → ingress.core.domain) — Hostname. One of both is required, otherwise install fails.
  • route_name (harbor) — Name of the HTTPRoute
  • service_name ("") — Empty: path routing to core/portal as above. Set: single backend for path / (e.g. harbor with ingress.enabled: false)
  • service_port (80) — Port of the single backend; ignored with path routing
  • tls.issuer (letsencrypt-production, fallback ingress.letsencrypt.issuer) — ClusterIssuer for the Certificate
  • tls.secret_name (harbor-gateway-tls) — Secret of the Certificate
  • traffic.request_timeout (900s) — ClientTrafficPolicy.requestReceivedTimeout and BackendTrafficPolicy.requestTimeout. A single blob upload or download that takes longer is cut off — raise it for very large images on slow links.
  • traffic.connect_timeout (60s) — BackendTrafficPolicy.connectTimeout
  • traffic.idle_timeout (900s) — ClientTrafficPolicy.idleTimeout
  • traffic.buffer_limit (10Mi) — ClientTrafficPolicy.connection.bufferLimit

Ready-made examples: polycrate block examples harbor (gateway-api-envoy, gateway-parent, dual-ingress-gateway).

Variant A — own Gateway on eg-shared (default)

- name: harbor
  from: cargo.ayedo.cloud/ayedo/k8s/harbor:0.0.26
  config:
    namespace: harbor
    ingress:
      enabled: false              # Gateway only; true = Ingress in parallel
      core:
        domain: registry.example.com
    gateway:
      enabled: true
      gateway_class_name: eg-shared
      tls:
        issuer: letsencrypt-production
        secret_name: harbor-gateway-tls

DNS for registry.example.com points at the shared VIP of the envoy block. Use gateway_class_name: eg-dedicated for an own IP.

Variant B — attach the route to an existing parent Gateway

    ingress:
      enabled: false
      core:
        domain: registry.example.com
    gateway:
      enabled: true
      parent_gateway_name: shared-https   # existing Gateway with an HTTPS Terminate listener
      parent_gateway_namespace: envoy-gateway-system
      parent_gateway_section_name: https
      tls:
        issuer: letsencrypt-production

The parent needs a terminating HTTPS listener with that sectionName that admits routes from the block namespace (allowedRoutes.namespaces.from: All or a matching selector) and references a certificate for the host. The block's Certificate lives in the block namespace; a listener in another namespace needs a ReferenceGrant or its own (wildcard) certificate. No own Gateway, no traffic policies — timeouts and buffer limits come from the parent. The envoy block's default_gateway (eg-shared, listener tls, TLS passthrough) is not a valid parent: HTTPRoutes need a terminating HTTPS listener.

Variant C — existing Gateway in the block namespace

    gateway:
      enabled: true
      create_gateway: false
      gateway_name: my-existing-gateway

The block creates only the Certificate and the HTTPRoute, pointing at my-existing-gateway in the block namespace (no sectionName).

Variant D — Ingress and Gateway in parallel (cutover)

    ingress:
      enabled: true
      core:
        domain: registry.example.com
      class: nginx
      tls:
        enabled: true
      letsencrypt:
        issuer: letsencrypt-production
    gateway:
      enabled: true          # host empty → ingress.core.domain
      tls:
        issuer: letsencrypt-production
  1. polycrate run harbor install with both on. Ingress and Gateway serve the same host.
  2. Check the Gateway before the DNS switch: curl --resolve registry.example.com:443:<ENVOY-VIP> https://registry.example.com/api/v2.0/health → 200.
  3. Switch DNS to the Envoy VIP; docker login registry.example.com once clients see the new record.
  4. Optional: ingress.enabled: false and install again. Helm switches to expose.type=clusterIP and removes the chart Ingress; the HTTPRoute stays unchanged.

Checks

kubectl -n harbor get svc harbor-core harbor-portal
kubectl -n harbor get gateway,httproute,certificate
kubectl -n harbor get httproute harbor -o jsonpath='{.status.parents[*].conditions}'

Accepted=True and ResolvedRefs=True on the route, Ready=True on the Certificate.

Typical errors:

  • install fails: gateway.enabled requires gateway.host or ingress.core.domain — neither is set.
  • HTTPRoute ResolvedRefs=False / BackendNotFound — gateway.service_name: harbor is set while ingress.enabled is true (no nginx Service then). Remove service_name to route to core/portal.
  • HTTPRoute Accepted=False / NotAllowedByListeners — the parent Gateway does not admit routes from the namespace, or parent_gateway_section_name does not match.
  • Certificate stays Ready=False — the ACME challenge cannot reach the host (DNS still on the old target, issuer without a matching solver). kubectl -n harbor describe challenge.
  • Large docker push aborts after ~15 minutes — raise traffic.request_timeout.