Skip to main content

Kimai on GKE Autopilot

Kimai on GKE Autopilot

Kimai is a free, open-source time-tracking application (Symfony/PHP) used by freelancers and agencies for billable-hours tracking, timesheets, and reporting that feeds into invoicing. This module deploys Kimai 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 Kimai uses and how to explore and operate them from the Google Cloud Console and the command line. For the mechanics that are 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 Kimai costs on RAD, and how that compares​

Kimai on RAD's GKE Autopilot module costs about US$97 a month in a Google Cloud project you own, plus a one-off 110-credit (US$11.00) module fee. GKE suits Kimai that must stay available for a larger agency; for the lowest cost, the Cloud Run module runs the same Kimai for about US$70 a month. If you only need it occasionally, a RAD-managed project can be deleted and restored within 30 days for a handful of credits, so that US$97 becomes a few dollars a month instead. See Pause it for free, below.

What you pay on RAD​

In a Google Cloud project you ownIn a project RAD manages for you
Module fee, once per deployment110 credits (US$11.00 at the top-up price)99.0 credits (10% lower)
Build timeA few credits per buildThe same
Google Cloud running costBilled by Google to your own billing account, about US$97 a month for the default configuration (table below)Metered hourly in credits; RAD publishes 93 credits a day, about 2790 a month (about US$279 at the top-up price, US$223 at the Scale plan's rate)
Who owns whatYou own the project and its billing; RAD deploys and updates itRAD owns the project, with guardrails, quotas and budget alerts; you get console access, and a minimum purchased balance is held in reserve

10 credits cost US$1 on a one-off top-up, and less on a monthly plan. In a project RAD manages, the database, file server and network are shared by every application in the project, so a second application does not add a second database.

Default running cost in your own project (us-central1, Google list prices):

Resource (module default)Per month
GKE Autopilot pod, 1x vCPU / 2 GiBUS$39.68
Cloud SQL for MySQL, 1 vCPU / 3.75 GB, zonal, 10 GB SSDUS$51.02
Cloud NAT and networkingUS$5.00
Cloud Storage (add-ons, backups)US$1.00
GKE cluster management feeshared across every GKE app in the project; $0 if this is your only cluster, else ~73
Totalabout US$97

How it compares​

  • Kimai Cloud (Standard €3.99/user/month, €2.99 annually; Professional €4.99/user/month, €3.99 annually — kimai.org/en/pricing) stays cheaper in cash for most team sizes than the GKE figure above, for the same reason: it scales with users, this does not.
  • RAD's cost doesn't grow per user, and a GKE deployment stays available continuously rather than depending on a third party's uptime.
  • A Compute Engine e2-standard-2 (2 vCPU/8 GB, about US$49/month) is the closer-sized self-managed comparison, minus the managed database, backups and patching RAD includes.
  • Or see the Cloud Run guide for the lower-cost option.

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

If Kimai runs in a project RAD manages for you, you have a second option that goes well beyond scaling to zero: delete the whole project, and restore it within 30 days for close to nothing. This suits Kimai you only need occasionally — a course project, a demo, a short-lived evaluation — far better than running it continuously.

  • How it works. Deleting a RAD-managed project unlinks its billing first, then asks Google to delete the project. Google does not remove the project immediately: it keeps it, recoverable, for 30 days. Because billing is already unlinked, nothing is charged while it waits. Unlike deleting one module, this does not tear down Cloud SQL or Kimai's own compute one by one — the whole project, and everything in it, simply stops.
  • Restoring costs a handful of credits, not a rebuild. Within 30 days, the project's owner can restore it. RAD 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. For Kimai behind a small Services_GCP and Project_GCP, that is a handful of credits (under US$1) in total, against the 115 credits a full redeploy costs.
  • What this needs. You must own the project (not a bring-your-own one RAD only manages billing for), and you restore it yourself within the 30 days — after that, Google deletes it for good. Restoring is admitted like creating a new project: your purchased credit balance must still clear the tier's floor (100 credits for the sandbox tier most study and demo use fits). Google says most services are fully working again within 36 hours of a restore.
  • One real gap: the backup bucket does not survive. Kimai's nightly backups are written to a bucket inside the project, and that bucket is not protected by Cloud Storage's soft-delete, 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've customised Kimai and want to keep that work, copy a backup out (to Google Drive, or a bucket outside the project) before you delete, the same as the redeploy workflow below. For a default installation with nothing irreplaceable in it, this does not matter.

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

GKE keeps at least one pod running, so it never scales to zero on its own. The option above only applies to a RAD-managed project; in your own project, or once the 30-day window has passed, the way to stop paying is to delete the deployment and deploy it again when you need it.

  • What a redeploy costs. The module fee again plus the builds: about 115 credits (US$11.50), because RAD recreates the project and shared services before Kimai. Deleting saves money only once Kimai would otherwise sit unused for about four days or more, both in your own project (about US$3.22 a day) and in a RAD-managed one (93 credits a day).
  • Delete everything Kimai uses. Most of the running cost is usually the database. It stops only when nothing else in the project uses it, so deleting Kimai while something else shares the project saves only Kimai's own compute part.
  • Keep your 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 Kimai session for a class. Each participant gets Kimai in their own Google Cloud project for 15 minutes to 24 hours, within an allowance the trainer sets. Either the trainer funds every place up front, 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 Kimai 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 of the engagement 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 list prices from the Cloud Billing Catalog API; RAD fees and the 93-credit daily estimate from radmodules.dev/pricing; Delete and restore projects for the 30-day recovery window and what it says about Cloud Storage objects without soft delete. Kimai Cloud pricing. Prices change; check each source before relying on a figure.

1. Overview​

Kimai runs as a Symfony/PHP pod (the official kimai/kimai2:apache image, wrapped in a thin custom build) on GKE Autopilot. The deployment wires together a focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeGKE AutopilotSymfony/PHP pod, 1 vCPU / 2 GiB by default; single replica by default (GKE has no scale-to-zero)
DatabaseCloud SQL for MySQL 8.0Required — Kimai_Common fixes the engine; PostgreSQL is not supported
Object storageCloud StorageA storage bucket, GCS-FUSE-mounted at /opt/kimai/var/data for uploaded invoice logos/templates and plugin data
SecretsSecret ManagerAuto-generated APP_SECRET (Symfony signing key) and ADMINPASS (admin password); database password
IngressCloud Load BalancingExternal LoadBalancer; custom domain and reserved static IP are supported (see §4 for the defaults this module's own live deployment actually used)

Sensible defaults worth knowing up front:

  • MySQL 8.0 is mandatory. The database engine is fixed by Kimai_Common; selecting any other engine breaks the deployment.
  • Custom wrapper image is required, not optional. container_image_source = "custom" builds a thin image FROM kimai/kimai2 whose entrypoint composes Kimai's single DATABASE_URL connection string at container startup from Foundation-injected secret values (see §3).
  • container_port = 8001, not port 80 — confirmed via local docker run testing and live deployment. This is the :apache image variant's actual listening port.
  • enable_cloudsql_volume = true — this is the opposite default from Kimai_CloudRun. A Cloud SQL Auth Proxy sidecar is injected into the pod and listens on 127.0.0.1; the wrapper entrypoint's DB_IP alias resolves to that loopback address here, rather than the raw private IP Cloud Run uses.
  • Two Secret Manager secrets, generated once. APP_SECRET (Symfony CSRF/session signing key) and ADMINPASS (initial super-admin password) — both re-injected from Secret Manager on every container start, so no persistent volume is needed just to keep them stable.
  • No scale-to-zero. min_instance_count = 1, max_instance_count = 1 by default; GKE Autopilot keeps a Deployment's replica count at or above its configured minimum.
  • enable_nfs defaults true but is functionally unused. It mounts Cloud Filestore NFS at /var/lib/kimai, but the real persistent storage path is the GCS-FUSE-mounted storage bucket at /opt/kimai/var/data. Nothing writes to the NFS mount. Safe to disable.
  • No separate migrate job. kimai:install (schema creation and migrations) runs on every container boot, idempotently, as part of the vendor's own entrypoint chain — only a single db-init job is needed to create the database and user beforehand.

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 Kimai workload​

Kimai runs as a single-replica Deployment by default. Autopilot bills for the CPU/memory the pod actually requests. A Cloud SQL Auth Proxy sidecar runs alongside the main container (enable_cloudsql_volume = true).

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

See App_GKE for how Autopilot, scaling, and the workload type (Deployment vs StatefulSet) are managed.

B. Cloud SQL for MySQL 8.0​

Kimai stores all application data (projects, activities, timesheets, users, invoices) in a managed Cloud SQL for MySQL 8.0 instance. The pod reaches it privately through a Cloud SQL Auth Proxy sidecar listening on 127.0.0.1. On first deploy, a db-init job creates the application database and user; kimai:install then creates the schema on the container's own first boot.

  • Console: SQL → select the instance for connections, backups, flags, and metrics.
  • CLI:
    gcloud sql instances list --project "$PROJECT"
    gcloud sql instances describe <instance-name> --project "$PROJECT"
    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 in the Outputs. See App_GKE for the connection model, automated backups, and password rotation.

C. Cloud Storage​

Two GCS buckets can exist for this deployment: a storage bucket provisioned by Kimai_Common and GCS-FUSE-mounted at /opt/kimai/var/data (uploaded invoice logos/templates, plugin data), and a separate, generic Foundation-level bucket (storage_buckets, defaulting to a bucket named data) that Kimai does not read or write unless you wire it up explicitly.

  • Console: Cloud Storage → Buckets.
  • CLI:
    gcloud storage buckets list --project "$PROJECT"

See App_GKE for CMEK options and GCS Fuse CSI mounts.

D. Secret Manager​

Two secrets are generated automatically and stored in Secret Manager: APP_SECRET (Symfony CSRF/session signing key) and ADMINPASS (the initial super-admin account password). The database password is managed separately by the foundation.

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

See App_GKE for the Secret Store CSI integration and rotation.

E. Networking & ingress​

By default the workload is exposed through an external Cloud Load Balancing IP; a Kubernetes Ingress for custom domains and a reserved static IP can be layered on (both module defaults are true, though this module's own live deployment was run with both set false — see Outputs and §4).

  • 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.

F. Cloud Logging & Monitoring​

Pod stdout/stderr flow to Cloud Logging; GKE and Cloud SQL metrics flow to Cloud Monitoring, with optional uptime checks and alert policies.

  • 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. Kimai Application Behaviour​

  • A single DATABASE_URL composed entirely at runtime, not passed through Terraform. Kimai's Doctrine DBAL layer reads one connection string, DATABASE_URL=mysql://user:pass@host:port/db?charset=utf8mb4&serverVersion=8.0, not discrete DB_* variables. Kimai_Common builds a thin custom wrapper image FROM kimai/kimai2 whose entrypoint.sh composes DATABASE_URL at container start from the Foundation-injected DB_USER/DB_NAME/DB_PASSWORD/DB_IP env vars — URL-encoding the password with php -r 'echo rawurlencode(...)' — before handing off unmodified to the vendor's own docker-php-entrypoint /entrypoint.sh.
  • DB_IP resolves to the Auth Proxy sidecar's loopback on GKE. The wrapper reads the host from $DB_IP (aliased via db_host_env_var_name = "DB_IP"). On GKE, with enable_cloudsql_volume = true (the default), this resolves to the cloud-sql-proxy sidecar's 127.0.0.1 address — a plain host with no colons, just like the raw private IP Cloud Run's variant of this same module uses. This is why the same wrapper entrypoint code works unmodified on both platforms.
  • Verified locally before ever touching the cloud. The password URL-encoding step and the vendor's own DB-wait preflight check were both confirmed by building the wrapper image and running it locally against a real MySQL container with a password containing special characters (@:/?), catching and fixing issues before the first cloud deploy attempt.
  • Health check behaviour. Both the startup and liveness probes target GET /en/login (Kimai's login page), which returns 200 once the application is ready.
    EXTERNAL_IP=$(kubectl get svc -n "$NAMESPACE" -o jsonpath='{.items[0].status.loadBalancer.ingress[0].ip}')
    curl -s -o /dev/null -w "%{http_code}\n" "http://${EXTERNAL_IP}/en/login" # expect 200
  • Admin bootstrap runs on every boot, idempotently. The vendor's own entrypoint runs kimai:user:create admin "$ADMINMAIL" ROLE_SUPER_ADMIN "$ADMINPASS" on every container start whenever ADMINPASS is set — a no-op once the account exists. The username is always admin, hardcoded by the vendor image regardless of admin_email's value.
  • Inspect job execution:
    kubectl get jobs -n "$NAMESPACE"
    kubectl logs -n "$NAMESPACE" job/<db-init-job-name>

4. Configuration Variables​

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

Group 1 — Project & Identity​

VariableDefaultDescription
project_id(required)Target Google Cloud project.
regionus-central1Region for the cluster and regional resources.

Group 3 — Application Identity​

VariableDefaultDescription
application_namekimaiBase name for resources. Do not change after first deploy.
application_display_nameKimaiHuman-readable name shown in the Console.
application_descriptionKimai time tracking on GKEKubernetes workload description.
application_versionlatestImage tag driving the kimai/kimai2 build. "latest" maps to the maintained :apache rolling tag; any other value maps to "<version>-apache".
admin_emailadmin@example.comSuper-admin account email, injected as ADMINMAIL. The account username is always admin, hardcoded by the vendor entrypoint.
enable_gcs_storage_volumetrueGCS-FUSE-mount the storage bucket at /opt/kimai/var/data.

Group 4 — Runtime & Scaling​

VariableDefaultDescription
container_image_sourcecustomBuilds the DATABASE_URL-composing wrapper image via Cloud Build — required, not optional, for this module.
min_instance_count / max_instance_count1 / 1GKE has no scale-to-zero; single replica by default.
container_port8001Kimai's :apache image variant listens on 8001, confirmed via local testing and live deployment.
cpu_limit / memory_limit1000m / 2GiPer-pod resource limits.
php_memory_limit512MPHP memory_limit (the vendor entrypoint reads the lowercase memory_limit env var directly).
enable_cloudsql_volumefalseCloud SQL Auth Proxy sidecar on 127.0.0.1. Keep true on GKE — the wrapper's DB_IP alias depends on it.

Group 6 — GKE Backend & Cluster​

VariableDefaultDescription
service_typeLoadBalancerExternal IP by default.
session_affinityClientIPRoutes a client's requests to the same pod.
workload_typenullAuto-resolves to Deployment (Kimai needs no per-pod PVC identity).

Group 11 — Jobs & Scheduled Tasks​

VariableDefaultDescription
initialization_jobs[]Leave empty to use the built-in single db-init job. There is no separate migrate job — kimai:install runs on every container boot, idempotently.

Group 13 — Filesystem (NFS)​

VariableDefaultDescription
enable_nfsfalseFunctionally unused — mounted at /var/lib/kimai, but Kimai's real persistent storage is the GCS-FUSE-mounted storage bucket at /opt/kimai/var/data. Safe to disable.

Group 14 — Cloud Storage & Artifact Registry​

VariableDefaultDescription
storage_buckets[{ name_suffix = "data" }]Generic Foundation-level bucket. Not read or written by Kimai.
gcs_volumes[]Additional GCS Fuse volume mounts, merged with the storage bucket mount.

Group 16 — Database Backend​

VariableDefaultDescription
database_typenull (resolves to MYSQL_8_0)Fixed by Kimai_Common.
application_database_name / application_database_userkimaiTenant-prefixed at deploy time. Immutable after first deploy.
db_host_env_var_nameDB_IPAliases the DB host so the wrapper's DATABASE_URL composition reads a plain, colon-free host — resolves to the Auth Proxy sidecar's loopback on GKE.
db_user_env_var_name / db_name_env_var_name / db_port_env_var_name / db_password_env_var_name"" (all four)Unused by Kimai — the wrapper reads the standard DB_USER/DB_NAME/DB_PASSWORD directly and hardcodes port 3306.

Group 19 — Custom Domain, Static IP & Networking​

VariableDefaultDescription
enable_custom_domaintrueKubernetes Ingress with application_domains. This module's own live-verified deployment set this false (see config/deploy.tfvars).
reserve_static_iptrueA stable IP that survives redeploys. This module's own live-verified deployment set this false too.
network_tags["nfsserver"]Firewall targeting; required for NFS connectivity when enable_nfs = true.

Group 15 — Redis​

VariableDefaultDescription
enable_redisfalseKimai has no built-in Redis integration used by this module — its default cache backend is the local filesystem.

Every other input (Group 0 metadata, Group 2 environment, Group 5 secrets, Group 7 StatefulSet, Group 8 resource quota, Group 9 reliability, Group 10 observability, Group 12 CI/CD, Group 17 backup, Group 18 custom SQL, Group 20 IAP, Group 21 Cloud Armor, Group 22 VPC-SC) behaves exactly as documented in App_GKE.


5. Outputs​

Returned on a successful deployment — the quickest way to locate and explore the running resources.

OutputDescription
service_nameKubernetes Service name.
namespaceKubernetes namespace.
service_cluster_ip / service_external_ipInternal / external IP.
service_urlService URL.
database_instance_nameCloud SQL instance name.
database_name / database_userApplication database name / user.
database_password_secretSecret Manager secret holding the DB password.
database_host127.0.0.1 via the Cloud SQL Auth Proxy sidecar.
storage_bucketsCreated Cloud Storage buckets.
container_image / container_registryDeployed image and Artifact Registry repo.
initialization_jobsName of the setup job (db-init).
kubernetes_readyWhether the cluster endpoint is available and all K8s resources are deployed.
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
vpc_sc_enabled / vpc_sc_perimeter_name / vpc_sc_dry_run_modeVPC-SC 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. Invalid configuration fails the plan with a clear, named error before any resource is created.

SettingSensible valueRiskConsequence if wrong
container_image_sourcecustomCriticalSwitching to prebuilt deploys the stock kimai/kimai2 image with no wrapper entrypoint — DATABASE_URL is never composed, so the pod cannot reach MySQL at all.
enable_cloudsql_volumetrue on GKECriticalSetting false removes the Auth Proxy sidecar the wrapper entrypoint's DB_IP alias depends on to reach Cloud SQL — the pod cannot connect.
container_port8001CriticalThe :apache image variant listens on 8001, not 80 — pointing the platform at the wrong port makes the service unreachable even though the container is healthy.
application_database_name / application_database_userSet onceCriticalImmutable after first deploy; renaming recreates the DB/user and destroys all timesheets, projects, and invoices.
APP_SECRET (auto-generated)Never hand-edit in Secret Manager after first bootHighKimai uses this as a Symfony security-signing key; changing it invalidates CSRF tokens and active sessions.
Default administrator account (username always admin, password in the ADMINPASS secret)Retrieve the generated password from Secret Manager and log in promptlyHighThe admin password is a real, per-deployment generated secret, not a public well-known default — but still worth confirming who has read access to the secret.
max_instance_count1 unless verified otherwiseHighScaling beyond 1 pod without verifying Kimai's session behaviour under multiple pods risks inconsistent user sessions across pods.
enable_nfsfalse unless needed for another purposeLow / costDefaults true and provisions a Filestore share Kimai never uses — a needless recurring cost; real persistence is the GCS-FUSE-mounted storage bucket.
enable_cloud_armorenable for productionMediumThe service is publicly reachable without WAF protection by default.

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. Kimai-specific application configuration shared with the Cloud Run variant is described in Kimai_Common.

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