logto

by upstreamyard

Helm chartv0.1.6App 1.46.0MPL-2.0Verified publisher

Logto, the open-source identity and access management platform (OIDC, SSO, multi-tenancy) for apps and SaaS. Community chart by upstreamyard, not an official Logto chart.

About this chart

Logto Helm chart

Have any questions, feedback or need help (e.g. setup, hardened images, etc.)? Reach out to [email protected]

Helm chart for Logto, the open-source identity and access management platform: sign-in, OIDC and OAuth 2.0, SSO and multi-tenancy for your apps. It uses Logto's official image svhd/logto.

Community chart by upstreamyard, not an official Logto chart. Logto is © its authors, licensed under MPL-2.0.

Install

helm repo add upstreamyard https://upstreamyard.github.io/helm-charts
helm install logto upstreamyard/logto \
  --set database.url='postgres://logto:password@your-postgres:5432/logto' \
  --set endpoint=https://auth.example.com \
  --set adminConsole.endpoint=https://admin.auth.example.com

Or from the OCI registry:

helm install logto oci://ghcr.io/upstreamyard/charts/logto \
  --set database.url='postgres://logto:password@your-postgres:5432/logto'

Then create the admin account right away (see "Admin Console" below):

kubectl port-forward svc/logto 3002:3002   # http://localhost:3002

Verifying the chart

Chart packages are PGP-signed. Import the public key (fingerprint 9B416F989B7E6C65F7F3BFAE7689688B20EC7813) and install with --verify:

curl -s https://upstreamyard.github.io/helm-charts/pgp_keys.asc | gpg --dearmor > upstreamyard.gpg
helm install logto upstreamyard/logto --verify --keyring upstreamyard.gpg --set database.url='...'

The OCI copy on GHCR is signed with cosign instead (see the repository README).

Requirements

  • PostgreSQL 14 or newer (required; tested with 17). This chart does not deploy a database.
  • The database user must be allowed to create roles (CREATEROLE or superuser). Logto creates PostgreSQL roles for its tenants when it sets up the database; without the permission, setup fails with permission denied to create role. Logto's docs don't mention this.
  • Redis is optional: a shared cache that reduces database reads.

What the chart does

  • Database setup and upgrades: before every install and upgrade, a Job sets up an empty database (npm run cli db seed -- --swe, skipped when it's already set up) and deploys the database alterations of the new Logto version (npm run alteration deploy latest). Logto refuses to start until they are deployed.
  • Non-root: Logto's image runs as root by default; the chart runs it as UID 10001. Logto writes alteration scripts into a folder that only root's group may write to, so the chart mounts an empty volume there.
  • Two endpoints: Logto serves your apps on port 3001 (endpoint) and the Admin Console on port 3002 (adminConsole.endpoint). Each has its own Ingress (ingress, adminIngress) and should get its own host name. trustProxyHeader is on, so Logto uses the X-Forwarded-* headers of your Ingress.
  • Probes: /api/status for startup, liveness and readiness.
  • Several replicas: all pods share the database; Redis is optional.
  • Connectors: the official connectors (social sign-in, email, SMS) are part of the image, so nothing is downloaded at startup.
  • Security: runs as non-root UID 10001, drops all capabilities, and doesn't mount a ServiceAccount token.

Admin Console

On a new installation, the first person who opens the Admin Console creates the admin account. Create it right away through kubectl port-forward, before you enable adminIngress, or restrict the admin Ingress (e.g. by IP or VPN). To run Logto without the Admin Console, set adminConsole.enabled=false.

Configuration

Logto is configured through environment variables; the chart sets the essential ones from its values. Everything else goes into extraEnv or extraEnvFrom, for example:

extraEnv:
  - name: CASE_SENSITIVE_USERNAME
    value: "false"
  - name: DATABASE_STATEMENT_TIMEOUT
    value: DISABLE_TIMEOUT          # when connecting through PgBouncer or RDS Proxy

All variables are listed in Logto's configuration reference. To use Logto's Secret Vault, set secretVault.kek (or secretVault.existingSecret) to a base64-encoded 32-byte key, e.g. from openssl rand -base64 32.

Production example

# values-prod.yaml
replicaCount: 2
database:
  existingSecret: logto-db          # key: database-url
redis:
  existingSecret: logto-redis       # key: redis-url
secretVault:
  existingSecret: logto-kek         # key: secret-vault-kek
endpoint: https://auth.example.com
adminConsole:
  endpoint: https://admin.auth.example.com
ingress:
  enabled: true
  className: nginx
  hosts:
    - host: auth.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: auth-tls
      hosts: [auth.example.com]
adminIngress:
  enabled: true
  className: nginx
  annotations: {}                   # restrict access, e.g. an IP allow-list
  hosts:
    - host: admin.auth.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: admin-auth-tls
      hosts: [admin.auth.example.com]

Known issue: restarts when the database drops connections

When PostgreSQL closes Logto's connections (a database restart or failover), Logto 1.44.0 exits with an unhandled database error (terminating connection due to administrator command), so Kubernetes restarts the pod. It comes back as soon as the database is reachable; expect a few restarts and a short outage during database maintenance.

Values

KeyTypeDefaultDescription
adminConsole.enabledbooltrueServe the Admin Console on port 3002. If false, the chart sets ADMIN_DISABLE_LOCALHOST=1 and doesn't expose the admin port.
adminConsole.endpointstring""Public URL of the Admin Console (ADMIN_ENDPOINT), e.g. https://admin.auth.example.com. Empty means http://localhost:3002.
adminIngress.annotationsobject{}Ingress annotations.
adminIngress.classNamestring""Ingress class name.
adminIngress.enabledboolfalseCreate an Ingress for the Admin Console (port 3002). Its host should match adminConsole.endpoint. The first visitor of a new installation creates the admin account, so restrict access (e.g. by IP) until that is done.
adminIngress.hostslist[{"host":"admin.auth.example.com","paths":[{"path":"/","pathType":"Prefix"}]}]Ingress hosts and paths.
adminIngress.tlslist[]Ingress TLS configuration.
affinityobject{}Affinity.
database.existingSecretstring""Name of an existing Secret that holds the connection string (recommended for production).
database.existingSecretKeystring"database-url"Key in existingSecret that holds the connection string.
database.urlstring""Connection string postgres://user:password@host:5432/logto. URL-encode special characters in the password. Stored in a Secret created by this chart. Ignored when existingSecret is set.
endpointstring""Public URL of Logto (ENDPOINT), e.g. https://auth.example.com. It becomes the OIDC issuer, so set it before your apps use Logto. Empty means http://localhost:3001.
extraEnvlist[]Extra environment variables for Logto, e.g. CASE_SENSITIVE_USERNAME, DATABASE_STATEMENT_TIMEOUT, proxy settings. See https://docs.logto.io/concepts/core-service/configuration
extraEnvFromlist[]Extra environment variables from Secrets or ConfigMaps.
extraVolumeMountslist[]Extra volume mounts for the Logto container.
extraVolumeslist[]Extra volumes for the pod, e.g. TLS certificates for HTTPS_CERT_PATH.
fullnameOverridestring""Override the full resource name.
image.pullPolicystring"IfNotPresent"Image pull policy.
image.repositorystring"svhd/logto"Image repository. The official Logto image.
image.tagstring""Image tag. Defaults to the chart's appVersion.
imagePullSecretslist[]Secrets for pulling from a private registry.
ingress.annotationsobject{}Ingress annotations.
ingress.classNamestring""Ingress class name.
ingress.enabledboolfalseCreate an Ingress for the Logto core service (port 3001). Its host should match endpoint.
ingress.hostslist[{"host":"auth.example.com","paths":[{"path":"/","pathType":"Prefix"}]}]Ingress hosts and paths.
ingress.tlslist[]Ingress TLS configuration.
livenessProbeobject{"httpGet":{"path":"/api/status","port":"http"},"periodSeconds":10,"timeoutSeconds":5}Liveness probe on /api/status.
migrations.activeDeadlineSecondsint600Maximum runtime of the Job in seconds.
migrations.backoffLimitint3Retries of the Job before the install/upgrade fails.
migrations.enabledbooltrue
migrations.resourcesobject{}Resources for the Job.
nameOverridestring""Override the chart name in resource names.
nodeSelectorobject{}Node selector.
podAnnotationsobject{}Extra pod annotations.
podLabelsobject{}Extra pod labels.
podSecurityContextobject{"runAsGroup":10001,"runAsNonRoot":true,"runAsUser":10001,"seccompProfile":{"type":"RuntimeDefault"}}Pod security context. Runs Logto as non-root UID 10001 (the image itself defaults to root).
readinessProbeobject{"failureThreshold":3,"httpGet":{"path":"/api/status","port":"http"},"periodSeconds":5,"timeoutSeconds":5}Readiness probe on /api/status.
redis.existingSecretstring""Name of an existing Secret that holds the Redis URL.
redis.existingSecretKeystring"redis-url"Key in existingSecret that holds the Redis URL.
redis.urlstring""Redis URL, e.g. redis://redis:6379. Stored in a Secret created by this chart. Ignored when existingSecret is set.
replicaCountint1Number of Logto pods. Logto keeps no state in the pod, so several replicas share the PostgreSQL database. Redis (redis.url) is optional and only adds a shared cache.
resourcesobject{"limits":{"memory":"1Gi"},"requests":{"cpu":"100m","memory":"256Mi"}}Resources for the Logto container.
secretVault.existingSecretstring""Name of an existing Secret that holds the key encryption key.
secretVault.existingSecretKeystring"secret-vault-kek"Key in existingSecret that holds the key encryption key.
secretVault.kekstring""Key encryption key for Logto's Secret Vault (SECRET_VAULT_KEK): a base64-encoded 32-byte key, e.g. openssl rand -base64 32. Optional; the Secret Vault doesn't work without it. Stored in a Secret created by this chart. Ignored when existingSecret is set.
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]}}Container security context.
service.adminPortint3002Port of the Admin Console (only when adminConsole.enabled).
service.portint3001Port of the Logto core service (sign-in pages, OIDC, Management API).
service.typestring"ClusterIP"Service type.
serviceAccount.annotationsobject{}ServiceAccount annotations.
serviceAccount.automountboolfalseMount the ServiceAccount token. Logto does not use the Kubernetes API.
serviceAccount.createbooltrueCreate a ServiceAccount.
serviceAccount.namestring""ServiceAccount name. Generated from the full name if empty.
startupProbeobject{"failureThreshold":30,"httpGet":{"path":"/api/status","port":"http"},"periodSeconds":2}Startup probe on /api/status (answers 204 as soon as the server is up).
terminationGracePeriodSecondsint30Seconds Kubernetes waits after SIGTERM. Logto stops within a second.
tolerationslist[]Tolerations.
trustProxyHeaderbooltrueTrust X-Forwarded-* headers (TRUST_PROXY_HEADER). Needed behind an Ingress or load balancer that terminates TLS.

Deploy logto with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has logto on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartlogto is pinned at v0.1.6 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply