Skip to main content

Vaultwarden GKE Module — Configuration Guide

This guide describes every configuration variable available in the Vaultwarden_GKE module. Vaultwarden_GKE is a wrapper module that combines the generic App_GKE infrastructure module with the Vaultwarden_Common shared application configuration to deploy Vaultwarden on Google Kubernetes Engine (GKE) Autopilot.

Most configuration options in Vaultwarden GKE map directly to the same options in App GKE. Where a variable is identical in behaviour, this guide references the App GKE guide rather than repeating the same documentation.

Note: Variables marked as platform-managed are set and maintained by the platform. You do not normally need to change them.


Standard Configuration Reference

Configuration AreaApp GKE.md SectionVaultwarden-Specific Notes
Module Metadata & Configuration§1 Module OverviewVaultwarden-specific module_description and module_services defaults are pre-set.
Project & Identity§2 IAM & Access ControlIdentical.
Application Identity§3.A Compute (GKE Autopilot)Vaultwarden-specific defaults; see Group 2.
Runtime & Scaling§3.A Compute (GKE Autopilot)Vaultwarden-specific defaults; see Group 3.
Environment Variables & Secrets§3 Core Service ConfigurationApplication vars injected by wrapper; see Group 5.
Initialization Jobs & CronJobs§3.E Initialization Jobs & CronJobsSupports both PostgreSQL and MySQL db-init jobs; see Group 8.
Storage — GCS§3.C Storagevaultwarden-data GCS bucket provisioned automatically.
Database Configuration§3.B Database (Cloud SQL)Supports PostgreSQL 15 (default) and MySQL 8.0; see Group 11.
Backup Schedule & Retention§3.B Database (Cloud SQL)backup_retention_days defaults to 30 (longer than other modules).
Observability & Health Checks§3.A Compute (GKE Autopilot)Probes target /alive; see Group 13.
Cloud Armor WAF§4.A Cloud Armor WAFRecommended for Vaultwarden.
Identity-Aware Proxy§4.B Identity-Aware Proxy (IAP)Identical.
Stateful WorkloadsStatefulSet config in App GKEStatefulSet is the default workload type with a 10 Gi PVC at /data; see Group 18.
Traffic & Ingress§5 Traffic & Ingresssession_affinity = "ClientIP" by default; see Group 17.

How Vaultwarden GKE Relates to App GKE

Vaultwarden GKE passes all variables through to App GKE and adds a Vaultwarden Common sub-module. The main effects are:

  1. StatefulSet with PVC is the default. Unlike most modules that default to Deployment, Vaultwarden GKE defaults to workload_type = "StatefulSet" with stateful_pvc_enabled = true, stateful_pvc_size = "10Gi", and stateful_pvc_mount_path = "/data". This provides persistent local storage for Vaultwarden's data directory.
  2. PostgreSQL 15 (default) or MySQL 8.0 supported. Set database_type = "MYSQL_8_0" for MySQL. Vaultwarden Common selects the appropriate init job image automatically.
  3. Session affinity is enabled by default. session_affinity = "ClientIP" ensures Bitwarden client connections are routed consistently to the same pod.
  4. DATA_FOLDER=/data is injected automatically. The wrapper injects this env var pointing to the PVC mount path.
  5. SIGNUPS_ALLOWED=false by default. Registrations are disabled by default. Set signups_allowed = true for initial setup; disable immediately after creating admin accounts.
  6. No application-level secrets. Vaultwarden Common creates no Secret Manager secrets. All credential management is by App GKE.

Group 0: Module Metadata & Configuration

Identical to App_GKE. See App_GKE §1.

Vaultwarden-specific defaults:

VariableVaultwarden GKE DefaultNotes
module_description"Vaultwarden: Deploy Vaultwarden password manager on GKE Autopilot…"Pre-populated.
credit_cost150GKE deployments cost more than Cloud Run.

Group 1: Project & Identity

Identical to App_GKE. See App_GKE §2.


Group 2: Application Identity

Vaultwarden-specific defaults:

VariableVaultwarden GKE DefaultApp GKE DefaultNotes
application_name"vaultwarden""gkeapp"Base name for all resources. Do not change after deployment.
display_name"Vaultwarden"(not in App GKE)Human-readable name for the platform UI.
description"Vaultwarden password manager"(not in App GKE)Deployment description.
application_version"1.32.7""1.0.0"Vaultwarden release version.

Group 3: Runtime & Scaling

Vaultwarden-specific defaults:

VariableVaultwarden GKE DefaultApp GKE DefaultNotes
container_port808080Vaultwarden's HTTP port.
cpu_limit"1000m""1000m"Vaultwarden is a lightweight Rust binary.
memory_limit"512Mi""512Mi"Same as App GKE default.
min_instance_count11At least one Vaultwarden pod always running.
max_instance_count33Maximum pod replicas.
enable_cloudsql_volumetruetrueCloud SQL Auth Proxy sidecar.

Application-specific variables:

VariableDefaultDescription
domain""Vaultwarden's public domain for WebAuthn and email links. Injected as DOMAIN when non-empty.
signups_allowedfalseAllow new user registrations. Set true for initial setup only.
web_vault_enabledtrueEnable the Vaultwarden web UI.

Group 4: Access & Networking

Identical to App_GKE. See App_GKE §4 and App_GKE §5.

Cloud Armor recommendation: Enabling enable_cloud_armor = true is strongly recommended for Vaultwarden deployments to protect login endpoints from brute-force attacks.

VariableDefaultDescription
enable_iapfalseEnables Identity-Aware Proxy.
iap_authorized_users[]Users/service accounts granted IAP access.
iap_authorized_groups[]Google Groups granted IAP access.
enable_custom_domainfalseCustom domain with managed SSL.
application_domains[]Custom domain names. Also set domain to the full https:// URL.
reserve_static_iptrueReserves a Global Static IP.
enable_cloud_armorfalseCloud Armor WAF. Recommended for Vaultwarden.
admin_ip_ranges[]WAF-exempt CIDR ranges.
enable_vpc_scfalseVPC Service Controls.

Group 5: Environment Variables & Secrets

The vaultwarden.tf wrapper injects the following environment variables automatically:

VariableValueDescription
ROCKET_PORTvar.container_portVaultwarden's HTTP listen port.
SIGNUPS_ALLOWEDvar.signups_allowedRegistration control.
WEB_VAULT_ENABLEDvar.web_vault_enabledWeb UI toggle.
DATA_FOLDER/dataVaultwarden data directory (PVC mount path).
DOMAINvar.domain (if non-empty)Public URL for WebAuthn and email links.

Default environment variable values:

VariableDefaultDescription
LOG_LEVELwarnLog verbosity.
SHOW_PASSWORD_HINTfalseDisable password hints.
SMTP_HOST""SMTP server hostname.
SMTP_PORT587SMTP port.
SMTP_FROMvaultwarden@example.comSender email.
SMTP_SSLtrueEnable SMTP TLS.

Override via environment_variables. Use secret_environment_variables for SMTP passwords.


Group 6: Backup & Maintenance

Vaultwarden-specific default:

VariableDefaultNotes
backup_schedule"0 2 * * *"Daily at 02:00 UTC.
backup_retention_days3030-day retention (higher than other modules) to accommodate vault recovery scenarios.
enable_backup_importfalseOne-time restore on deploy.

Group 7: CI/CD & GitHub Integration

Identical to App_GKE. See App_GKE §6.


Group 8: Jobs & Scheduled Tasks

Vaultwarden db-init job:

Vaultwarden Common detects database_type and selects the appropriate init job image:

database_typeImageDescription
POSTGRES_15 (default)postgres:15-alpineInitialises Vaultwarden PostgreSQL database and user
MYSQL_8_0mysql:8.0-debianInitialises Vaultwarden MySQL database and user
FieldValue
Job namedb-init
execute_on_applytrue
CPU / Memory1000m / 512Mi
Max retries3

Override initialization_jobs with a non-empty list to replace this default.


Group 11: Database Configuration

Vaultwarden-specific defaults:

VariableVaultwarden GKE DefaultNotes
database_type"POSTGRES_15"Default. Set "MYSQL_8_0" for MySQL.
db_name"vaultwarden"Do not change after deployment.
db_user"vaultwarden"Application database user.

Automatic password rotation:

VariableDefaultDescription
enable_auto_password_rotationfalseAutomated rotation.
rotation_propagation_delay_sec90Restart delay after rotation.

Group 13: Observability & Health

Vaultwarden exposes /alive as its dedicated health endpoint.

Startup probe:

FieldVaultwarden DefaultNotes
path"/alive"Vaultwarden's health endpoint.
initial_delay_seconds30Vaultwarden starts quickly as a Rust binary.
failure_threshold6Tolerance for first-boot database connection.

Liveness probe:

FieldVaultwarden Default
path"/alive"
initial_delay_seconds30

Override recommended: startup_probe_config and health_check_config default to path = "/healthz". Override both to path = "/alive" for Vaultwarden.


Group 14: Reliability Policies

Identical to App_GKE. See App_GKE §7.

PodDisruptionBudget is enabled by default (enable_pod_disruption_budget = true, pdb_min_available = "1") to ensure zero-downtime pod evictions for a password manager.


Group 17: GKE Backend Configuration

Vaultwarden-specific defaults:

VariableVaultwarden GKE DefaultApp GKE DefaultNotes
workload_type"StatefulSet"null (Deployment)StatefulSet for persistent local storage at /data.
session_affinity"ClientIP""None"Ensures Bitwarden client connections route to the same pod.
service_type"LoadBalancer""LoadBalancer"Exposes Vaultwarden via external load balancer.

Group 18: Stateful Workloads

Vaultwarden GKE defaults to a StatefulSet with a persistent PVC for Vaultwarden's data directory:

VariableDefaultDescription
stateful_pvc_enabledtrueProvisions a PersistentVolumeClaim for Vaultwarden's data.
stateful_pvc_size"10Gi"PVC size. Increase for large vaults.
stateful_pvc_mount_path"/data"Mount path matching DATA_FOLDER.
stateful_pvc_storage_class""Storage class (empty = cluster default).
stateful_headless_servicefalseHeadless service for StatefulSet DNS.
stateful_pod_management_policy"OrderedReady"Pod startup order policy.
stateful_update_strategy"RollingUpdate"Update strategy.

Note: StatefulSet auto-select applies here: stateful_pvc_enabled = true automatically resolves to workload_type = "StatefulSet". Do not set workload_type = "Deployment" alongside stateful_pvc_enabled = true — this fails at plan time.


Configuration Pitfalls & Sensible Defaults

Risk levels: Critical (data loss, full outage, security breach) — High (service unavailable or significant degradation) — Medium (degraded function or increased cost) — Low (minor impact).

VariableSensible DefaultRiskConsequence of Incorrect Value
domain"" (empty — not injected)HighMust be the full public URL (e.g., https://vault.example.com). Without it, TOTP/2FA QR codes link to localhost, organisation invitation emails contain broken links, and attachment download URLs are invalid. Set this before any user enables 2FA.
signups_allowedfalseCriticalThe module defaults to false. If set to true before initial admin setup, any internet user can register on the vault. Lock down registrations immediately after the first admin account is created.
admin_token (via environment_variables)Not set (admin panel disabled)HighWhen ADMIN_TOKEN is absent, the /admin panel is completely disabled — the intended secure default. If admin access is needed, set ADMIN_TOKEN to an Argon2 hash or a strong random string via environment_variables.
stateful_pvc_enabledfalse (defaults to Deployment)HighSetting to true without setting a stateful_pvc_size will use the Kubernetes default disk size. Vaultwarden data is served from Cloud SQL; local PVC data will be lost if the StatefulSet is deleted. Consider whether persistent local disk is truly needed alongside Cloud SQL.
workload_type + stateful_pvc_enabledDeployment / falseHighSetting workload_type = "Deployment" and stateful_pvc_enabled = true fails at plan time. StatefulSet is auto-selected when stateful_pvc_enabled = true; do not set both explicitly.
database_typePOSTGRES_15HighChanging the database type after first deploy causes Vaultwarden to connect to an empty database. All vault data will appear lost until the original type is restored.
db_namevaultwardenHighChanging after initial deploy causes Vaultwarden to see an empty database on the next pod restart. All credentials appear lost until the name is restored.
min_instance_count1HighSetting to 0 enables scale-to-zero in GKE (via HPA). A password manager with scale-to-zero means the vault is unavailable for several seconds after a cold start; Bitwarden clients show connection errors during this window.
container_port80HighMust match the ROCKET_PORT environment variable. A mismatch means the Kubernetes readiness probe fails and the pod never enters the Ready state, blocking all traffic indefinitely.
container_protocolhttp1MediumVaultwarden uses HTTP/1.1 for its REST API. Setting to h2c will cause the GKE load balancer to use h2c-specific connection handling that Vaultwarden does not support, resulting in protocol negotiation failures and 502 errors.
enable_cloudsql_volumetrueCriticalMust be true. Vaultwarden connects to Cloud SQL via the Auth Proxy Unix socket. Disabling this causes all database connections to fail and the pod enters a CrashLoopBackOff immediately.
smtp_* variables (via environment_variables)Not setHighSMTP variables (SMTP_HOST, SMTP_PORT, SMTP_FROM, SMTP_USERNAME, SMTP_PASSWORD, SMTP_SECURITY) must all be set together or not at all. Partial configuration causes silent email delivery failures — Vaultwarden logs no error but invitation, 2FA recovery, and password-reset emails are never delivered.
quota_memory_requests / quota_memory_limits"4Gi" / "8Gi"CriticalValues must use binary unit suffixes (e.g., "4Gi", "8192Mi"). Bare integers are treated as bytes by Kubernetes, creating an effectively zero memory quota that blocks all pod scheduling immediately.
enable_resource_quotafalseMediumWhen enabled with incorrect quota values, the namespace quota immediately prevents the Vaultwarden pod from being scheduled. Verify quota_memory_requests and quota_memory_limits values before enabling.
backup_schedule"0 2 * * *"MediumAn empty string disables automated backups. A password manager without backups means a Cloud SQL failure results in permanent credential loss for all vault users.
enable_pod_disruption_budgettrueMediumDisabling PDB allows GKE node upgrades to evict the Vaultwarden pod without waiting, causing a vault outage during cluster maintenance windows.
session_affinityfalseLowEnabling session affinity is not needed for Vaultwarden since all session state is in the database. It can cause uneven pod load distribution when multiple replicas are running.
enable_vpc_scfalseHighRequires explicit organization_id. Without it, VPC Service Controls are silently skipped. Enabling without a valid org ID leaves the perimeter uncreated.
enable_iapfalseMediumWhen enabled, iap_oauth_client_id and iap_oauth_client_secret must both be provided. Partial configuration leaves the backend either fully blocked or unprotected.

Module Outputs

OutputDescription
service_nameName of the Kubernetes service.
service_urlService URL.
service_external_ipExternal IP of the load balancer.
project_idGCP project ID.
deployment_idDeployment ID suffix.
namespaceKubernetes namespace.
database_instance_nameName of the Cloud SQL instance.
database_nameApplication database name.
database_userApplication database user.
database_password_secretSecret Manager secret for the database password.
storage_bucketsCreated GCS storage buckets.
container_imageContainer image used.
kubernetes_readytrue when Kubernetes resources are deployed.