Skip to main content

Monica on GKE Autopilot

Monica on GKE Autopilot

Monica is an open-source personal relationship management (PRM) application — a "personal CRM" for organising how you stay in touch with friends, family, and contacts. This module deploys Monica 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 Monica 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.


What Monica costs on RAD, and how that compares​

Running Monica in your own GCP project costs about $110.13/month in Google Cloud charges; RAD's module fee is a one-time 110 credits (or 99 credits in a RAD-managed project), covering setup and support -- not the ongoing cloud bill, which Google bills you directly in your own project or RAD meters hourly in credits in a RAD-managed one. If a lower running cost matters more than the deployment target, see the Cloud Run guide for the lower-cost option; otherwise, if you deploy into a RAD-managed project you can pause the whole thing for free when you are not using it -- see Pause it for free below.

What you pay on RAD​

Your own projectRAD-managed project
Module fee110 credits, once99 credits, once (10% lower)
Build timemetered in credits as the build runs (a few credits, typically)same
Google Cloud running cost~$110.13/month, billed to your own billing account at Google's list price~99 credits/day, metered hourly by RAD at list price plus margin

Default running cost in your own project

ResourceUS$/month (Google list price, us-central1)
GKE Autopilot pod, 1x vCPU / 2 GiB$39.68
Cloud SQL for MySQL, 1 vCPU / 3.75 GB, zonal, 10 GB SSD$51.02
NFS/cache file server (small VM)$13.43
Cloud NAT and networking$5.00
Cloud Storage (add-ons, backups)$1.00
GKE cluster management feeshared across every GKE app in the project; $0 if this is your only cluster, else ~$73
Total$110.13

How it compares​

  • Monica's own official hosted version costs $9/month ($90/year billed annually) (source: https://www.monicahq.com/en/pricing), run by the project itself with no infrastructure to operate -- the comparison that matters here is less the sticker price and more whether you want the vendor's own cloud or your own GCP project with RAD managing it.
  • Running it yourself on a bare VPS is still the cheapest cash option -- Hetzner CPX22 (2 vCPU/4GB) runs about $24/month, a DigitalOcean 2 vCPU/4GB Droplet is also $24/month, and a GCP Compute Engine e2-standard-2 (2 vCPU/8GB) is about $49/month -- plus the admin's own time for backups, security patches and upgrades, which RAD's managed Cloud SQL, Secret Manager and monitoring cover for you -- but RAD's price is never meant to beat a VPS, only to replace the admin time a VPS still needs.
  • Either way, this is a single-user personal CRM, so the running cost above is what actually drives the bill, not the module fee -- and that running cost is the one you can pause (see below).

Pause it for free: delete a RAD-managed project, restore it when you need it​

This is the headline for a RAD-managed project. Deleting a RAD-managed project first unlinks its billing, then asks Google to delete the project outright -- Google's own 30-day recoverable soft delete. Unlike deleting one module, this does not tear down Cloud SQL, any VM or the compute resource one by one: the whole project simply stops, and nothing is charged while it waits, because billing is already unlinked.

Restoring, within 30 days and only by the project's owner, asks Google to undelete the project and reattaches its billing account, then asks you to run Update on each deployment to confirm everything came back. Because nothing was individually destroyed, that Update finds the same resources already there -- it is a check, not a rebuild, and an Update never charges the module fee again. This costs only a handful of credits (under US$1) in total for a typical 2-3-deployment chain.

What this needs: you must own the project (not one RAD only manages billing for), you must restore it yourself within 30 days -- after that Google deletes it for good -- and restoring is admitted like creating a new project, so your purchased credit balance must still clear the tier's floor (100 credits for the sandbox tier most study/demo use fits). Google says most services are fully working again within 36 hours of a restore.

One real gap: nightly backups are written to a bucket inside the project, and that bucket has Cloud Storage's soft-delete explicitly turned off, so it is very likely gone as soon as you delete the project -- even though the project itself is recoverable for 30 days. If you have customised the app and want to keep that work, copy a backup out (to Google Drive, or a bucket outside the project) before deleting. For a default install with nothing irreplaceable in it, this does not matter.

Pay only while you use it, the other way: delete and redeploy​

In your own project (or once you are past the 30-day restore window above), the alternative is to delete Monica outright and redeploy it later. A redeploy costs the module fee again, plus the builds -- roughly 110 + 3-6 credits of build time.

Deleting saves money only once Monica would otherwise sit unused long enough to clear that redeploy cost against its own daily running cost -- against the own-project total above, that works out to about 3 days or more. Most of the running cost here is usually the database and the shared file/cache VM; they stop only when nothing else in the project uses them, so deleting this app while something else shares the project saves only this app's own compute part.

Keep data first: nightly backups go to a bucket inside the deployment and are deleted with it, so copy the latest backup out before deleting if you want to keep it.

Lab sessions and Managed Environments​

  • Lab sessions, for training: a trainer runs a session for a class. Each participant gets the app in their own Google Cloud project for 15 minutes to 24 hours, within an allowance the trainer sets. Either the trainer funds every place, or each participant pays for their own. Everything is deleted when the session ends and unused credits go back to the trainer.
  • Managed Environments, for consultancies: a partner runs the app for a client from a ring-fenced wallet it funds, and settles with the client directly. If the wallet runs low, billing pauses and the data is kept, so nobody receives an unexpected charge. At the end the partner hands the project over and the deployments become the client's own.
  • Credits can be bought in more than 20 currencies, including XAF, XOF, NGN, GHS, KES and ZAR, by card, bank transfer or mobile money.

Sources (8 October 2026): Google Cloud Billing Catalog API list prices; radmodules.dev/pricing for RAD's own fees and daily-credit estimates; https://cloud.google.com/resource-manager/docs/delete-restore-projects for the pause/restore mechanics; https://www.monicahq.com/en/pricing for the named competitor's price.

1. Overview​

Monica runs as a PHP/Laravel web workload (official Apache image). The deployment wires together a focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeGKE AutopilotApache/PHP pods, 1 vCPU / 2 GiB by default, horizontally autoscaled
DatabaseCloud SQL for MySQL 8.0Required — Monica is fixed to MySQL
Object storageCloud StorageA dedicated monica-uploads bucket for contact photos/documents, plus a default data bucket from storage_buckets
PersistenceNFS (enabled by default)Shared volume for Laravel's storage/ uploads across pods
CacheRedis (optional)Off by default; used for cache/session when enabled
SecretsSecret ManagerAuto-generated Laravel APP_KEY; database password
IngressCloud Load BalancingExternal LoadBalancer, optional custom domain + managed certificate

Sensible defaults worth knowing up front:

  • MySQL 8.0 is the fixed engine. The database engine comes from the shared application layer (MYSQL_8_0); Monica does not run on PostgreSQL here.
  • The image is the official prebuilt monica:<version>. No Cloud Build step — container_image_source = "prebuilt" pulls the Apache variant from Docker Hub, which serves on port 80.
  • APP_KEY is generated automatically and stored in Secret Manager. It is a Laravel encryption key and must never be rotated after first boot — rotating it permanently corrupts every encrypted database field and invalidates all sessions.
  • Migrations run automatically on start. The image entrypoint runs php artisan migrate --force on every pod start, so the schema is created and upgraded on boot (after the db-init job provisions the database and user).
  • Cloud SQL Auth Proxy sidecar on 127.0.0.1. enable_cloudsql_volume = true on GKE — the Auth Proxy runs as a sidecar bound to loopback, so Monica_GKE overrides DB_HOST = 127.0.0.1.
  • NFS is enabled by default (enable_nfs = true) so uploaded files in Laravel's storage/ directory are shared and durable across pods.
  • Minimum 1 replica is maintained (min_instance_count = 1, max = 1) — GKE does not support scale-to-zero, and a single replica suits a personal CRM.
  • APP_URL is set from the predicted service URL so Laravel builds correct absolute links; update it to the external LoadBalancer/custom-domain URL after the IP is known.

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. The namespace and other identifiers are reported in the deployment Outputs.

A. GKE Autopilot — the Monica workload​

Monica pods are scheduled on Autopilot, which bills for the CPU/memory the pods actually request. The deployment runs a single replica by default.

  • Console: Kubernetes Engine → Workloads → select the Monica workload to see pods and events. Kubernetes Engine → Services & Ingress shows the external IP.
  • CLI:
    kubectl get pods,svc -n "$NAMESPACE"
    kubectl logs -n "$NAMESPACE" deploy/<service-name> --tail=100
    kubectl describe deploy -n "$NAMESPACE" <service-name>

See App_GKE for how Autopilot, scaling, and the workload type (Deployment vs StatefulSet) are managed. Note that when the app is NFS-backed the foundation uses a Recreate update strategy to avoid two pods contending on the shared volume/DB during rollouts.

B. Cloud SQL for MySQL 8.0​

Monica stores all application data (contacts, activities, reminders, journal entries, users) in a managed Cloud SQL for MySQL 8.0 instance. Pods reach it privately through the Cloud SQL Auth Proxy sidecar on 127.0.0.1:3306; no public IP is exposed. On first deploy the db-init Job creates the application database and user and grants privileges; the container entrypoint then runs the Laravel migrations.

  • Console: SQL → select the instance for connections, backups, flags, metrics.
  • CLI:
    gcloud sql instances list --project "$PROJECT"
    gcloud sql instances describe <instance-name> --project "$PROJECT"
    # Open an interactive shell to inspect schema/data:
    gcloud sql connect <instance-name> --user=<db-user> --database=<db-name> --project "$PROJECT"

The instance name, database, user, and the Secret Manager secret holding the password are all surfaced in the Outputs. For the connection model, automated backups, and password rotation, see App_GKE.

C. Cloud Storage​

A dedicated Cloud Storage bucket (suffix monica-uploads) is provisioned automatically for Monica's uploaded files (contact photos, documents). A second bucket (suffix data) is also created by default via the storage_buckets variable's own default entry. The workload service account is granted access. Additional buckets can be declared via storage_buckets.

  • Console: Cloud Storage → Buckets.
  • CLI:
    gcloud storage buckets list --project "$PROJECT"
    gcloud storage ls gs://<uploads-bucket>/ # bucket name is in the Outputs

See App_GKE for CMEK options and GCS Fuse mounts.

D. Redis (optional cache)​

Redis is disabled by default (enable_redis = false). When enabled, the foundation injects REDIS_HOST/REDIS_PORT; leaving redis_host empty while NFS is enabled uses the NFS server VM's IP as the Redis endpoint (the NFS VM co-hosts Redis).

  • Console: Memorystore → Redis (if using a managed instance).
  • CLI:
    redis-cli -h <redis-host> ping
    # Confirm the injected Redis env in the running pod:
    kubectl exec -n "$NAMESPACE" deploy/<service-name> -- env | grep REDIS_HOST

E. Secret Manager​

One cryptographic secret is generated automatically and stored in Secret Manager: the Laravel APP_KEY (used for AES-256-CBC encryption of encrypted columns and for signing sessions/cookies). It is delivered into the pod via the Secret Store CSI driver. The database password is managed separately by the foundation.

  • Console: Security → Secret Manager.
  • CLI:
    gcloud secrets list --project "$PROJECT" --filter="name~monica-app-key"
    gcloud secrets versions access latest --secret=<secret-name> --project "$PROJECT"

The database password secret name is in the Outputs. See App_GKE for the Secret Store CSI integration and rotation.

F. Networking & ingress​

By default the workload is exposed through an external Cloud Load Balancing IP (service_type = LoadBalancer). A custom domain with a Google-managed certificate can be enabled, and a static IP can be reserved so the address survives redeploys.

  • Console: Network services → Load balancing; VPC network → IP addresses.
  • CLI:
    kubectl get ingress,svc -n "$NAMESPACE"
    gcloud compute addresses list --project "$PROJECT"

See App_GKE for custom domains, Cloud CDN, and static IP details.

G. Cloud Logging & Monitoring​

Pod stdout/stderr flow to Cloud Logging; GKE and Cloud SQL metrics flow to Cloud Monitoring. Optional uptime checks and alert policies are available.

  • Console: Logging → Logs Explorer; Monitoring → Dashboards / Alerting.
  • CLI:
    gcloud logging read 'resource.type="k8s_container" AND resource.labels.namespace_name="'"$NAMESPACE"'"' \
    --project "$PROJECT" --limit 50

3. Monica Application Behaviour​

  • First-deploy database setup. An initialization Job runs db-init.sh using mysql:8.0-debian. It connects through the Cloud SQL Auth Proxy and idempotently creates the application database and user, grants privileges, and verifies the app user can connect (also warming the MySQL 8 caching_sha2_password auth cache). The job is safe to re-run.
  • Migrations run automatically on start. The official Monica image's entrypoint runs php artisan migrate --force on every pod start — there is no separate migration job. The schema is created on first boot (after db-init) and upgraded automatically when you bump application_version.
  • APP_KEY is immutable after first boot. It is generated once and written to Secret Manager. Changing it permanently corrupts all encrypted database fields and invalidates every session — only rotate during a planned maintenance window with a full data re-encryption plan.
  • First-run setup in the UI. Monica has no default credentials. Reach the external LoadBalancer URL: an unauthenticated visitor is redirected to the registration/setup page. The first account you create becomes the administrator. Register with admin@techequity.cloud for RAD deployments.
  • File uploads are shared across pods. Uploaded photos/documents live under Laravel's storage/. NFS is enabled by default so the volume is shared and durable; the monica-uploads GCS bucket is also provisioned. NFS-backed rollouts use the Recreate strategy to avoid two pods contending on the same volume.
  • Health path. The startup probe is TCP on / (passes as soon as Apache binds the port) and the liveness probe is HTTP GET / (Monica's home page returns 200). Allow a generous first-boot window for Apache startup plus the initial php artisan migrate --force.
  • Update APP_URL after the IP is known. The predicted URL is injected at plan time; set APP_URL to the external LoadBalancer or custom-domain URL via environment_variables so absolute links and redirects resolve correctly.

4. Configuration Variables​

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

Group 3 — Application Identity​

VariableDefaultDescription
application_namemonicaBase name for resources. Do not change after first deploy.
application_versionlatestMonica image tag; pin to a specific release in production.

Group 4 — Runtime & Scaling​

VariableDefaultDescription
deploy_applicationtrueSet false to provision infrastructure only.
container_image_sourceprebuiltPulls the official monica image directly — do not change to custom.
container_port80Monica's Apache image listens on port 80.
cpu_limit1000mCPU per pod (1 vCPU).
memory_limit2GiMemory per pod.
min_instance_count1GKE has no scale-to-zero; keep at 1 for a personal CRM.
max_instance_count1Single replica is sufficient.
enable_cloudsql_volumetrueCloud SQL Auth Proxy sidecar; DB_HOST is overridden to 127.0.0.1.

Group 13 — Filesystem (NFS)​

VariableDefaultDescription
enable_nfstrueOn by default — shared, durable volume for Laravel storage/ uploads across pods.
nfs_mount_path/var/www/html/storageMount path inside the container — Monica persists uploads and runtime data under Laravel's storage/ directory.

Group 14 — Cloud Storage & Artifact Registry​

VariableDefaultDescription
create_cloud_storagetrueProvision the monica-uploads bucket (from the Common module) plus the buckets in storage_buckets. Set false to skip all bucket creation.
storage_buckets[{ name_suffix = "data" }]Additional buckets to provision — the default creates a second data bucket alongside monica-uploads.
gcs_volumes[]Optional GCS Fuse volume mounts via the CSI driver.

Group 16 — Database Backend​

VariableDefaultDescription
database_typeMYSQL_8_0 (from Common)Fixed to MySQL 8.0.
application_database_namemonicaDatabase base name (tenant-prefixed). Immutable after first deploy.
application_database_usermonicaApplication database user base name. Immutable after first deploy.

Group 15 — Redis Cache​

VariableDefaultDescription
enable_redisfalseEnable to add cache/session backing; injects REDIS_HOST/REDIS_PORT.
redis_host""Redis endpoint. Leave empty to use the NFS server IP (requires enable_nfs = true).
redis_port6379Redis port.

All other inputs follow standard App_GKE behaviour.


5. Outputs​

These values are returned on a successful deployment and are the quickest way to locate and explore the running resources.

OutputDescription
service_nameKubernetes Service name.
namespaceNamespace the workload runs in.
service_cluster_ipIn-cluster ClusterIP.
stage_service_cluster_ipsMap of ClusterIPs for stage-specific services.
service_external_ipExternal LoadBalancer IP (when a static IP is reserved).
service_urlURL to reach Monica.
database_instance_nameCloud SQL instance name.
database_nameApplication database name.
database_userApplication database user.
database_password_secretSecret Manager secret holding the DB password.
database_host / database_portDB endpoint (127.0.0.1 via the Auth Proxy) / port.
storage_bucketsCreated Cloud Storage buckets (monica-uploads and data by default).
network_name / network_exists / regionsVPC network, presence, available regions.
container_image / container_registryDeployed image and Artifact Registry repo.
monitoring_enabled / monitoring_notification_channelsMonitoring status and channels.
initialization_jobs / db_import_jobNames of the setup (db-init) and (optional) import jobs.
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
cicd_enabled / cicd_configurationCI/CD status and details (repo, trigger, registry).
github_repository_url / github_repository_owner / github_repository_nameCI/CD GitHub details.
artifact_registry_repository / cloudbuild_trigger_name / cloudbuild_trigger_idRegistry and build trigger.
kubernetes_readyWhether the cluster/workload is ready.
vpc_sc_enabled / vpc_sc_perimeter_name / vpc_sc_dry_run_modeVPC-SC status.
audit_logging_enabled / artifact_registry_cmek_enabledAudit logging and CMEK status.

6. Configuration Pitfalls & Sensible Defaults​

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

Inherited plan-time validation. This module passes its configuration through the App_GKE foundation engine, which validates values and combinations at plan time — a gen1 runtime with NFS/GCS mounts, an out-of-range redis_port/backup_retention_days, bare-integer quota_memory_* values, a Deployment workload_type alongside stateful_pvc_enabled. Invalid configuration fails the plan with a clear, named error before any resource is created, so most mistakes below are caught up front rather than at apply or runtime.

SettingSensible valueRiskConsequence if wrong
APP_KEY (auto-generated)Never rotate after first bootCriticalRotating it permanently corrupts every encrypted database field and invalidates all sessions.
application_database_name / application_database_userSet onceCriticalImmutable after first deploy; renaming recreates the DB/user and destroys all data.
database_typeMYSQL_8_0CriticalMonica is a MySQL app; a non-MySQL engine breaks the driver and migrations.
enable_nfstrueHighDisabling loses the shared storage/ volume — uploaded photos/documents are not shared across pods and are lost on pod recreation.
container_image_sourceprebuiltHighSetting custom makes App_GKE attempt a build with no Dockerfile.
container_port80HighThe Apache image listens on 80; a mismatched port fails the startup probe.
enable_cloudsql_volumetrue (GKE)HighThe Auth Proxy sidecar provides 127.0.0.1:3306; disabling it breaks MySQL connectivity.
DB_HOST (auto-set 127.0.0.1)leave as injectedHighOn GKE the proxy sidecar is on loopback; a different host cannot reach MySQL.
APP_URLExternal LoadBalancer/domain URLHighA wrong URL breaks absolute links and the / → setup/registration redirect.
min_instance_count1MediumGKE requires min ≥ 1; a single replica suits a personal CRM.
memory_limit2GiMediumTrimming too far risks PHP OOM during first-boot migrations and heavy pages.
enable_redisoff unless neededLowOptional cache/session backing; when enabled without a host and NFS off, the Redis endpoint is blank.

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

Need RAD to do something it does not do yet? Request it on the roadmap, or vote on what is already there.