Skip to main content

Mealie on GKE Autopilot

Mealie on GKE Autopilot

Mealie is an open-source, self-hosted recipe manager and meal planner with a FastAPI backend and a Vue frontend, offering automatic recipe import by URL alongside a manual UI editor. This module deploys Mealie on GKE Autopilot on top of the App_GKE foundation, which provisions and manages the shared Google Cloud and Kubernetes infrastructure.

This guide focuses on the cloud services Mealie uses and how to explore and operate them from the Google Cloud Console and the command line. For the mechanics common to every GKE application — Workload Identity, ingress, autoscaling, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC Service Controls, backups, and the deployment lifecycle — refer to the App_GKE foundation guide rather than repeating them here.


1. Overview

Mealie runs as a single FastAPI/Vue web workload. The deployment wires together a small, focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeGKE AutopilotFastAPI pod, 1 vCPU / 512 MiB by default
DatabaseCloud SQL for PostgreSQL 15Mealie reads discrete POSTGRES_* env vars, not a constructed DSN
Object storageCloud StorageA data bucket is created for recipe images, but not auto-mounted
Cache & queuenoneMealie has no Redis or queue dependency
SecretsSecret ManagerDatabase password only — Mealie has no env-configurable admin credential
IngressCloud Load BalancingExternal LoadBalancer, optional custom domain + managed certificate

Sensible defaults worth knowing up front:

  • PostgreSQL is the standardized engine. Mealie_Common fixes database_type = "POSTGRES_15" and sets DB_ENGINE=postgres explicitly.
  • No custom container build. The official prebuilt image (ghcr.io/mealie-recipes/mealie) is used directly.
  • Default admin account, not first-registration — and it is NOT configurable. Mealie's initial credential can no longer be set via environment variables as of v3.x (see the Common guide). Every deployment boots the same well-known account: changeme@example.com / MyPassword. Log in immediately after first deploy and complete the forced password reset.
  • workload_type = "Deployment", not StatefulSet. Mealie keeps no local state beyond what's already in Cloud SQL — no PVC, no NFS mount required.
  • Recipe images are not persisted by default. A GCS bucket is created but not auto-mounted — add a gcs_volumes entry if uploaded recipe images need to survive a pod restart.

2. Google Cloud Services & How to Explore Them

All commands assume you have run gcloud container clusters get-credentials <cluster> --region <region> --project <project> and that PROJECT, REGION, and NAMESPACE are set.

A. GKE Autopilot — the Mealie workload

  • CLI:
    kubectl get pods,svc -n "$NAMESPACE"
    kubectl logs -n "$NAMESPACE" deploy/<service-name> --tail=100

B. Cloud SQL for PostgreSQL 15

Pods reach the database privately through the cloud-sql-proxy sidecar over 127.0.0.1.

  • CLI:
    gcloud sql instances list --project "$PROJECT"
    gcloud sql connect <instance-name> --user=<db-user> --database=<db-name> --project "$PROJECT"

C. Cloud Storage

  • CLI:
    gcloud storage buckets list --project "$PROJECT" --filter="name~mealie"

D. Secret Manager

  • CLI:
    gcloud secrets list --project "$PROJECT" --filter="name~mealie"
    gcloud secrets versions access latest --secret=<secret-name> --project "$PROJECT"

E. Networking & ingress

  • CLI:
    kubectl get svc -n "$NAMESPACE" -o wide

F. Cloud Logging & Monitoring

  • CLI:
    kubectl logs -n "$NAMESPACE" deploy/<service-name> --tail=100 -f

3. Mealie Application Behaviour

  • First-deploy database setup. An initialization Job runs create-db-and-user.sh, idempotently creating the application role and database.
  • Schema migrations on start. Mealie applies its own internal migrations automatically on every pod start.
  • Fixed default admin credential — not configurable. Mealie creates changeme@example.com / MyPassword on first database initialisation. This is a hardcoded upstream default (no env var overrides it as of v3.x), not a generated secret — a password reset is forced on first login, and operators must complete it immediately after deploy.
  • Health path. Startup and liveness probes target /api/app/about.
  • Inspect job execution:
    kubectl get jobs -n "$NAMESPACE"
    kubectl logs -n "$NAMESPACE" job/<job-name>

4. Configuration Variables

Variables are grouped exactly as they appear on the deployment platform. Only settings specific to or notable for Mealie are listed; every other input is inherited from App_GKE with its standard behaviour.

Group 3 — Application Identity

VariableDefaultDescription
application_namemealieBase name for resources.
application_versionlatestMealie publishes a genuine latest tag.

Group 4 — Runtime & Scaling

VariableDefaultDescription
container_image_sourceprebuiltNo custom build needed.
container_port9000Mealie's native default port.
min_instance_count / max_instance_count0 / 1HPA scaling bounds.

Group 11 — Storage & Filesystem

VariableDefaultDescription
storage_bucketsone data bucketCreated but not auto-mounted.
stateful_pvc_enabledfalseNot used — Mealie is stateless at the pod level.

Group 12 (16) — Database Backend

VariableDefaultDescription
database_typePOSTGRES_15Fixed by Mealie_Common.
db_host_env_var_namePOSTGRES_SERVERAliases the platform DB_HOST onto Mealie's expected name.
db_user_env_var_namePOSTGRES_USERAliases DB_USER.
db_password_env_var_namePOSTGRES_PASSWORDAliases DB_PASSWORD.
db_name_env_var_namePOSTGRES_DBAliases DB_NAME.
db_port_env_var_namePOSTGRES_PORTAliases DB_PORT.

Group 14 — Observability & Health

VariableDefaultDescription
startup_probe_config / health_check_configHTTP /api/app/aboutProbes target Mealie's real info endpoint.

5. Outputs

OutputDescription
service_name / service_url / service_external_ipKubernetes Service identity and address.
database_instance_name / database_name / database_user / database_host / database_portCloud SQL connection details.
storage_bucketsThe data bucket for recipe images.
kubernetes_readyWhether the workload reached Ready state.

6. Configuration Pitfalls & Sensible Defaults

Risk: Critical (data loss / outage / security) — High (service degraded) — Medium (cost or partial degradation) — Low (minor).

SettingSensible valueRiskConsequence if wrong
application_database_name / application_database_userSet onceCriticalImmutable after first deploy; renaming recreates the DB/user and destroys all data.
container_image_sourceprebuilt (default)High"custom" triggers an unnecessary Cloud Build with no Dockerfile in this module.
Default admin credential (changeme@example.com / MyPassword)Log in and change it immediately after first deployCriticalThis is a fixed, publicly documented upstream default — not a generated secret — as soon as the DB initialises, anyone who knows Mealie's default credential can log in until you complete the forced first-login password reset.
gcs_volumes for recipe imagesAdd explicitly if neededMediumWithout it, uploaded recipe images live on the pod's ephemeral filesystem and do not survive a restart.
db_*_env_var_name variablesLeave at their Mealie-specific defaultsCriticalChanging/clearing these breaks Mealie's Postgres connection — it reads POSTGRES_*, not DB_*.

For the foundation behaviour referenced throughout — Workload Identity, ingress, autoscaling, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC-SC, backups, and image mirroring — see App_GKE. Mealie-specific application configuration shared with the Cloud Run variant is described in Mealie_Common.