Zurück zum Hub

cargo.ayedo.cloud/ayedo/k8s/forgejo 0.1.4 k8sapp GPL-3.0-or-later

Forgejo SCM with Gateway API, external CNPG, optional host-executor runner, Keycloak OIDC, SMTP, and VictoriaMetrics scrape

polycrate block pull cargo.ayedo.cloud/ayedo/k8s/forgejo:0.1.4

cargo.ayedo.cloud/ayedo/k8s/forgejo

Installs Forgejo on Kubernetes with Gateway API (Envoy), an external CloudNativePG database, optional unprivileged host-executor runner (Kaniko), Keycloak OIDC, SMTP, and VictoriaMetrics scrapes.

Configuration examples: polycrate block examples cargo.ayedo.cloud/ayedo/k8s/forgejo (examples.poly).

Hub: cargo.ayedo.cloud/ayedo/k8s/forgejo. Org-scoped Actions runners are not created by this block — the Polycrate API registers those. Leave runner.enabled: false in platform installs.

Changelog

Moved to CHANGELOG.poly.

Network (Gateway API)

  • gateway.enabled — Default: true; Purpose: Certificate + Gateway + HTTPRoute on eg-shared
  • gateway.host — Default: required; Purpose: Public HTTPS hostname
  • gateway.tcp.enabled — Default: true; Purpose: Envoy TCP Gateway + TCPRoute for SSH
  • gateway.tcp.port — Default: 22; Purpose: VIP listener
  • ssh.listen_port — Default: 2222; Purpose: Container / Service listen port
  • ssh.advertised_port — Default: 22; Purpose: Clone URL port (git@host:org/repo.git)

HTTPRoute carries Operator annotations (polycrate_endpoint_monitor, polycrate_k8sapp_name, polycrate_endpoint_path).

Database

Use a separate CloudNativePG block (forgejo-db). Install waits for database.cluster_name in the same namespace. Credentials come from database.secret_name (username / password). Git objects live on the forgejo-data PVC (default 100Gi), not in Postgres.

Isolation / OIDC

Production defaults match polycrate-api Spec 776/780: no self-registration, no JIT (oidc.enable_auto_registration: false), no customer org/repo create, restricted users, packages off (Harbor-only). OIDC group claim is groups (flattened Keycloak Organization groups). Username claim is preferred_username (= Polycrate User.uuid).

When oidc.enabled: true, install creates an openidConnect auth source. Existing sources are left in place.

SMTP

Opt-in smtp.enabled. Protocol/host/port/user/password/from are all configurable. Platform default host is gnu.ayedo.io. Password belongs in secrets.poly.

Metrics

[metrics] ENABLED exposes /metrics on the HTTP port. Default scrape is VMServiceScrape. Set metrics.vmpodscrape.enabled: true for a pod scrape as well.

Runner (host / Kaniko)

Optional. Default off. When enabled, host executor plus Kaniko binary, no Docker socket, no privileged, no DinD. Set runner.secret (40 hex chars) in secrets.poly. Workflows must call /kaniko/executor.

Extra env

extra_env is a list of {name, value} applied after the generated FORGEJO__* keys.

Actions

  • install — Namespace, wait for CNPG, app, Gateway, scrapes, optional runner/OIDC
  • uninstall — App, runner, scrapes, Gateway. Keeps forgejo-data PVC and the CNPG cluster
polycrate run forgejo install -w /absolute/path/to/workspace
polycrate run forgejo uninstall -w /absolute/path/to/workspace