A runbook for moving a Google Cloud Run service to Levelrail: concept mapping, deploying the same image, secrets, Cloud SQL, domains, jobs and what you give up.
This is a runbook for moving one Cloud Run service onto a Levelrail instance you run yourself. It maps only to features that exist in this repository today. Where something is unverified or has no equivalent, it says so.
Some areas are still beta (see feature status). You operate the server it runs on: OS updates, disk, backups and the Docker daemon are yours. Run the new deployment in parallel with Cloud Run, and keep Cloud Run as the rollback path until the shadow run in section 7 is clean.
There is no importer for Cloud Run. Everything below is manual. A Cloud Run service is already a container image listening on a port, which is the unit Levelrail deploys, so most services move without a rebuild. Whether the move saves money is a separate question, covered in Cloud Run alternative.
1. Inventory what Cloud Run holds
Collect this before touching Levelrail. Much of it lives in the Google Cloud console or in the service’s revision template, not in your repo.
Item
How to get it
Why you need it
Full service definition
gcloud run services describe SERVICE --region REGION --format export
One YAML with the image, port, env, resources, scaling and probes. Keep it next to your notes.
Image reference
The image field in that YAML
Usually Artifact Registry (REGION-docker.pkg.dev/PROJECT/REPO/IMAGE:TAG). Prefer a digest or a fixed tag over latest.
Env vars
env in that YAML
Plain values move with apps env import.
Secret Manager references
env entries with valueFrom.secretKeyRef, and secret volume mounts
Cloud Run resolves these at start. Levelrail has its own secret store, so you copy the values in.
Min and max instances, concurrency
autoscaling.knative.dev/minScale, maxScale and containerConcurrency
They map to a fixed replica count, see section 2.
CPU and memory
resources.limits
They map to resources.cpu and resources.memory.
Domains
gcloud beta run domain-mappings list --region REGION, or your load balancer config
You recreate each one and cut DNS over.
Cloud SQL connections
The run.googleapis.com/cloudsql-instances annotation
Each one needs its own data move, see section 5.
Cloud Scheduler jobs
gcloud scheduler jobs list
Scheduler calls an HTTP URL. Levelrail scheduled tasks run a command in the container.
Service account and IAM
The service’s runtime service account
Anything the app does with Google APIs through that identity needs a replacement, see section 8.
VPC connector and egress settings
The service YAML
Reaching private Google resources from outside Google needs your own network path.
If the service already runs from an image in a registry, you can deploy that image as is.
Public image
levelrail-cli apps create --name web --image docker.io/your-org/web:1.4.2 --port 8080
--port is the port your container listens on. Cloud Run tells your container which port to bind through the PORT environment variable. Set the same value as a plain env var so the app behaves the same here:
levelrail-cli apps env import web --file prod.env --apply
where prod.env contains PORT=8080 along with your other plain variables.
Private image in Artifact Registry
Create a registry credential first. Artifact Registry accepts a service account key as the password with the username _json_key, and the host is REGION-docker.pkg.dev:
Create a service account that has only the Artifact Registry Reader role for this, and keep the key out of your shell history. Check the credential before the first deploy:
levelrail-cli registry-credentials test <id>
Then reference it from an app.yaml and create the app from the file:
If you would rather not give the server a Google credential, pull the image where you have access, retag it and push it to a registry the server can reach:
docker pull us-central1-docker.pkg.dev/PROJECT/REPO/web:1.4.2docker tag us-central1-docker.pkg.dev/PROJECT/REPO/web:1.4.2 registry.example.com/web:1.4.2docker push registry.example.com/web:1.4.2
Image deploys do not rebuild anything. If you want Levelrail to build from your repo instead, that is the git flow in Deploying apps.
Redeploy and roll back
levelrail-cli apps deploy web --image us-central1-docker.pkg.dev/PROJECT/REPO/web:1.4.3levelrail-cli apps deploys list weblevelrail-cli apps deploys rollback-to web <deploy-id> --watch
4. Env vars, secrets, health checks
Plain env. Copy the non-secret entries from the exported service YAML into a .env file, then apps env import <app> --file prod.env --dry-run, then again without --dry-run.
Secrets. Read each value from Secret Manager and set it as a Levelrail secret:
levelrail-cli apps secrets set web DATABASE_URL "$(gcloud secrets versions access latest --secret=DATABASE_URL)"
For many keys write a secrets.env file and use apps secrets set web --env-file secrets.env. Delete the file afterwards. There is no live link to Secret Manager: rotating a secret in Google does not change it here.
Apply. apps apply web restarts the app so saved env and secrets reach the running container.
Secret files. Cloud Run can mount a secret as a file. Levelrail injects secrets as env vars. If your code reads a file path, either change it to read the env var or write the file from the env var in your entrypoint.
Health. A Cloud Run startup probe becomes a readiness probe, and a liveness probe stays a liveness probe:
levelrail-cli apps health set web --probe readiness --path /healthz --interval 5slevelrail-cli apps health set web --probe liveness --path /healthz --failures 3
A deploy that fails readiness does not take over traffic: the ingress keeps routing to the previous release and the attempt is recorded as failed. Cloud Run’s default TCP startup check has no direct counterpart, so add a real /healthz route.
5. Move Cloud SQL data
A managed database on Levelrail is a container on your node with its own volume, credentials and scheduled backups. It is not a hosted service with a replica in another zone. Read Managing databases before you commit.
Create the database with a matching major version:
levelrail-cli databases create --name main --engine postgres --version 16levelrail-cli databases status main
Dump from Cloud SQL. Use the Cloud SQL Auth Proxy or an authorized network, then:
Alternatively use gcloud sql export sql INSTANCE gs://BUCKET/appdb.sql --database=appdb and download the file.
Restore into the new database. Publish the database port temporarily, then restore with pg_restore using the database’s own credentials:
levelrail-cli databases public-access set main --port 5433pg_restore --no-owner --no-acl --dbname="postgres://USER:PASSWORD@SERVER_IP:5433/DBNAME?sslmode=require" appdb.dumplevelrail-cli databases public-access clear main
The credentials are the ones Levelrail generated for the database (see the Overview tab and levelrail-cli databases get main). A temporary login from databases access temp with --preset read_write cannot change the schema, so it is not enough for a first restore. Clear public access when you are done.
Connect the app to the database instead of pasting a URL:
levelrail-cli apps connect web main --env-var DATABASE_URL
Rehearse the cutover. A dump is a point in time. For a live database, plan a short write freeze: stop writes on Cloud Run, take a final dump, restore, switch. Time the restore before the real day.
Backups. Configure a backup target and a schedule, then run a restore into a new database to prove it works. See Backup targets.
Cloud SQL’s automatic failover, read replicas and point-in-time recovery are not replicated by default here. Point-in-time restore exists for Postgres, see Managing databases.
6. Domains, jobs, logs and metrics
Domains and certificates
Add the domain to the app while DNS still points at Google:
levelrail-cli apps domains add web app.example.com --dns off
Lower the DNS TTL a day ahead, then change the A and AAAA records to the server’s public IP. Cloud Run domain mappings point at Google’s records, so those are replaced, not edited.
Certificates: with ACME enabled, issuance needs the domain to already point at the server, so expect a short window, or upload a certificate for the domain first. ACME has one recorded live run, see the ACME verification runbook.
Keep the Cloud Run service and its domain mapping untouched until the shadow run is clean. Restoring the old DNS records is the rollback.
Scheduled jobs
A Cloud Scheduler job that POSTs to /cron/cleanup has no direct equivalent, because Levelrail runs a command, not an HTTP request. Options:
Put the work behind a command your image already contains and schedule that: levelrail-cli apps scheduled-tasks create web --schedule "0 3 * * *" -- ./cleanup.sh.
Keep the HTTP route and call it from a command that exists in the image, for example curl if it is installed. Confirm the tool exists before relying on it.
Run each once with levelrail-cli apps scheduled-tasks run web <id> and check last_run_status. More in Scheduled jobs. Cloud Run Jobs (batch tasks) can use the jobs: block, which runs a command in a fresh container of the service’s image.
Logs and metrics
levelrail-cli apps logs web --since 1h --q errorlevelrail-cli apps logs web --followlevelrail-cli apps requests weblevelrail-cli apps metrics web --metric cpu_percent --since 1h --step 5m
Logs and metrics are stored on the node. If you have alerts or dashboards in Google Cloud Monitoring, rebuild them as Levelrail alert rules, see Observability. Structured JSON logs written to stdout work as they do on Cloud Run, but the field names Google uses for severity and trace are not interpreted specially.
7. Cutover and shadow run
Run both platforms side by side long enough for boring problems to appear. Suggested minimum: one full business cycle, including any weekly or monthly job.
A deliberately broken deploy is rejected while the old container keeps serving.
A rollback to the previous image works from the CLI and the dashboard.
Every env var key that exists on Cloud Run exists here, and secrets were copied, not left behind.
The app reads PORT or the configured port and passes readiness on the first deploy.
Webhooks, OAuth callback URLs and allowed origins point at the new hostname or still resolve through the same domain.
Each scheduled task ran on schedule.
A database backup ran, and a restore was rehearsed into a new database.
Certificate issuance finished and expiry alerting is configured.
Response time and error rate compare acceptably against Cloud Run, using apps requests.
The server has an owner for patching and disk monitoring.
Decommission the Cloud Run service only after this passes and you have decided what to do about each item in the next section.
8. What you give up
Cloud Run feature
Status on Levelrail
Scale to zero
Not automatic per request. Whole-app sleep after a quiet period exists as an opt-in, and the first request waits for a cold start of seconds to a minute. Compare that to Cloud Run’s much shorter cold starts.
Autoscaling
None. Replicas are fixed. A traffic spike beyond your server’s capacity is a slow service, not a new instance.
Pay per request billing
You pay for the server whether it is busy or idle. See Cloud Run alternative for when that favors you.
Multi-zone and regional redundancy
One server is one failure domain. A multi-node setup is possible, but you build and run it.
Google’s global frontend and edge
Caddy serves from the nodes you run. Put a CDN in front if you need one.
Managed IAM, workload identity and service-to-service auth
Your app’s Google API calls need a credential you provide, such as a service account key stored as a secret.
Cloud SQL operations (automated patching, HA, replicas)
You upgrade and back up the database container yourself, see Database upgrades.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Levelrail","description":"Self-hosted deployment platform. Push to git, get a running app with TLS, logs, metrics and rollback. One Go binary, no Kubernetes.","colors":{"primary":"#107292","light":"#2FB3DC","dark":"#084F67"},"logo":{"light":"https://mintcdn.com/levelrail/56HjW70mOjUmjIrm/assets/brand/wordmark-light.svg?fit=max\u0026auto=format\u0026n=56HjW70mOjUmjIrm\u0026q=85\u0026s=cbe02b3c3d17b11f9cc5a18551a30782","dark":"https://mintcdn.com/levelrail/56HjW70mOjUmjIrm/assets/brand/wordmark-dark.svg?fit=max\u0026auto=format\u0026n=56HjW70mOjUmjIrm\u0026q=85\u0026s=a4aa78b496c43e0a5edd9dffce778a45","href":"https://levelrail.com"},"favicon":"https://mintcdn.com/levelrail/zPhEnShTGkGFCjPc/public/favicon.svg?fit=max\u0026auto=format\u0026n=zPhEnShTGkGFCjPc\u0026q=85\u0026s=65f3143dd7539d4b1d34090204f05be0","appearance":{"default":"dark","strict":false},"background":{"color":{"light":"#ffffff","dark":"#000000"}},"navbar":{"links":[{"icon":"globe","href":"https://levelrail.com","label":"Website"},{"icon":"clock-rotate-left","href":"/changelog","label":"Changelog"},{"icon":"github","href":"https://github.com/glincker/levelrail","label":"GitHub"}],"primary":{"type":"button","label":"Get started","href":"/getting-started"}},"footer":{"socials":{"github":"https://github.com/glincker/levelrail","x":"https://x.com/thegdsks","website":"https://levelrail.com"}},"search":{"prompt":"Search docs, CLI, API, guides"},"seo":{"metatags":{"og:site_name":"Levelrail Docs","og:type":"website","og:image":"https://docs.levelrail.com/public/og/default.png","og:image:width":"1200","og:image:height":"630","twitter:card":"summary_large_image","twitter:image":"https://docs.levelrail.com/public/og/default.png","twitter:site":"@thegdsks","keywords":"self-hosted PaaS, Coolify alternative, Docker deployment platform, self-hosted deploys, Levelrail"},"indexing":"navigable"},"fonts":{"heading":{"family":"Geist","weight":500},"body":{"family":"Geist"}},"styling":{"codeblocks":"dark","latex":true},"errors":{"404":{"redirect":false,"title":"Page not found","description":"This page moved or never existed. Try the [quickstart](/getting-started), the [all pages index](/all-pages) or search above."}},"contextual":{"options":["copy","view","chatgpt","claude","cursor","mcp"],"display":"header"},"interaction":{"drilldown":true},"metadata":{"timestamp":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"levelrail","hasAudioNarration":false,"actualSubdomain":"levelrail","customDomains":["docs.levelrail.com"],"gitSource":{"type":"github","owner":"glincker","repo":"levelrail","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6af80bed4f86660c4a245822","clientVersion":"0.0.4142","searchFilterCounts":[{"language":"default","tag":"Self-host gallery","count":575},{"language":"default","tag":"How-to guides","count":248},{"language":"default","tag":"Productivity","count":86},{"language":"default","tag":"Developer Tools","count":82},{"language":"default","tag":"Deploying","count":55},{"language":"default","tag":"Get started","count":50},{"language":"default","tag":"Database Tools","count":50},{"language":"default","tag":"AI","count":48},{"language":"default","tag":"Monitoring","count":48},{"language":"default","tag":"Media","count":47}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":":root{--lr-live: #2fb3dc;--lr-soft: #58b1ce;--lr-teal: #107292;--lr-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;--lr-r: 12px;--lr-face: #0e0f11;--lr-face-2: #141617;--lr-text: #cfcfd3;--lr-link: #58b1ce;--lr-line: rgba(255, 255, 255, 0.08);--lr-ring: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04) 40%, rgba(255, 255, 255, 0.06));--lr-ring-hot: linear-gradient(180deg, rgba(47, 179, 220, 0.55), rgba(47, 179, 220, 0.12) 45%, rgba(47, 179, 220, 0.2));--lr-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));--lr-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 1px 1px rgba(0, 0, 0, 0.5), 0 8px 16px -4px rgba(0, 0, 0, 0.55), 0 24px 48px -12px rgba(0, 0, 0, 0.65);--lr-glow-op: 1;--lr-grain: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 9 0 0 0 -4.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E\")}html:not(.dark){--lr-face: #ffffff;--lr-face-2: #f6f6f7;--lr-text: #3a3d40;--lr-link: #107292;--lr-line: rgba(14, 15, 17, 0.1);--lr-ring: linear-gradient(180deg, rgba(14, 15, 17, 0.2), rgba(14, 15, 17, 0.08) 40%, rgba(14, 15, 17, 0.1));--lr-ring-hot: linear-gradient(180deg, rgba(16, 114, 146, 0.6), rgba(16, 114, 146, 0.18) 45%, rgba(16, 114, 146, 0.26));--lr-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));--lr-shadow: 0 1px 1px rgba(14, 15, 17, 0.06), 0 8px 16px -6px rgba(14, 15, 17, 0.1);--lr-glow-op: 0.35}html.dark body{background-color:#000}body{position:relative;font-feature-settings:\"cv11\", \"ss03\";-webkit-font-smoothing:antialiased}body::before,body::after{content:\"\";position:absolute;inset:0 0 auto 0;height:440px;z-index:-1;pointer-events:none;background:radial-gradient(54% 92% at 50% 0%, rgba(47, 179, 220, 0.42), transparent 72%),\n radial-gradient(38% 78% at 10% 0%, rgba(31, 200, 176, 0.3), transparent 72%),\n radial-gradient(36% 70% at 92% 0%, rgba(108, 125, 255, 0.3), transparent 72%)}body::before{opacity:calc(0.4 * var(--lr-glow-op))}body::after{opacity:calc(0.9 * var(--lr-glow-op));filter:saturate(1.2) brightness(1.25);-webkit-mask-image:var(--lr-grain), linear-gradient(to bottom, #000 0%, transparent 88%);-webkit-mask-size:220px 220px, 100% 100%;-webkit-mask-composite:source-in;mask-image:var(--lr-grain), linear-gradient(to bottom, #000 0%, transparent 88%);mask-size:220px 220px, 100% 100%;mask-composite:intersect}html{isolation:isolate}#content-area,#content-container{color:var(--lr-text)}#page-title{font-weight:300;letter-spacing:-0.03em;line-height:1.08;text-wrap:balance}#content-area h2{font-weight:300;letter-spacing:-0.025em}#content-area h3,#content-area h4{font-weight:500;letter-spacing:-0.02em}#header p,#content-area p{text-wrap:pretty}#header>div>div:first-child:not(:has(h1)){font-family:var(--lr-mono);font-size:0.75rem;letter-spacing:0.08em;text-transform:uppercase;color:#8d8d96}#content-area a:not(.card):not([data-component-part]){color:var(--lr-link)}#content-area a[href]:not(.card){text-decoration-color:color-mix(in srgb, var(--lr-link) 40%, transparent)}#content-area a[href]:not(.card):hover{text-decoration-color:currentColor}code,pre,kbd,samp{font-family:var(--lr-mono)!important;font-feature-settings:\"calt\" 0}#content-area :not(pre)>code{background:var(--lr-face-2);border:1px solid var(--lr-line);border-radius:6px;padding:0.1em 0.4em;font-size:0.875em;color:inherit}html.dark #content-area :not(pre)>code{color:#e4e4e7}.code-block{border-radius:var(--lr-r);border:1px solid transparent;box-shadow:var(--lr-shadow);background:var(--lr-sheen) padding-box, linear-gradient(#08090a, #08090a) padding-box, var(--lr-ring) border-box}.code-block-background,.code-block>div{border-radius:var(--lr-r);background-color:transparent}.code-block [data-component-part=\"code-block-root\"],.code-block pre{background:transparent}.code-block code{font-size:0.8125rem;line-height:1.7}.card,.accordion,.accordion-group,.callout{border:1px solid transparent;border-radius:var(--lr-r);box-shadow:var(--lr-shadow);background:var(--lr-sheen) padding-box, linear-gradient(var(--lr-face), var(--lr-face)) padding-box, var(--lr-ring) border-box}.card{transition:box-shadow 0.2s, transform 0.2s}.card:hover{transform:translateY(-1px)}html.dark .card:hover{border-color:rgba(47, 179, 220, 0.45)}.card [data-component-part=\"card-title\"]{font-weight:500;letter-spacing:-0.01em}.card [data-component-part=\"card-icon\"]{color:var(--lr-live)}html:not(.dark) .card [data-component-part=\"card-icon\"]{color:#107292}.accordion{margin-bottom:0.75rem;overflow:hidden}.accordion-group{overflow:hidden}.callout{padding:1rem 1.25rem}.callout[class*=\"border-yellow\"],.callout[class*=\"border-green\"],.callout[class*=\"border-blue\"],.callout[class*=\"border-red\"],.callout[class*=\"border-sky\"]{background:var(--lr-sheen) padding-box, linear-gradient(var(--lr-face), var(--lr-face)) padding-box, var(--lr-ring) border-box}@media (prefers-reduced-motion: reduce){.card{transition:none}.card:hover{transform:none}}#content-area table{border-collapse:separate;border-spacing:0;border:1px solid var(--lr-line);border-radius:var(--lr-r);overflow:hidden;box-shadow:var(--lr-shadow)}#content-area thead th{font-family:var(--lr-mono);font-size:0.75rem;font-weight:500;letter-spacing:0.06em;text-transform:uppercase;color:#8d8d96;background:var(--lr-face-2)}#content-area tbody td,#content-area thead th{border-bottom:1px solid var(--lr-line)}#content-area tbody tr:last-child td{border-bottom:0}#navbar>div.absolute,#navbar>div>div.absolute{background:color-mix(in srgb, var(--lr-face) 38%, transparent);border-bottom-color:var(--lr-line);backdrop-filter:blur(20px) saturate(1.3);-webkit-backdrop-filter:blur(20px) saturate(1.3)}#sidebar .sticky.pointer-events-none{background:none}#navbar .nav-tabs-item[data-active=\"true\"]{color:var(--lr-live)}html:not(.dark) #navbar .nav-tabs-item[data-active=\"true\"]{color:#107292}#navbar .nav-tabs-item[data-active=\"true\"]>div,#navbar .nav-tabs-item[data-active=\"true\"]::after{background:var(--lr-live)}html:not(.dark) #navbar .nav-tabs-item[data-active=\"true\"]>div,html:not(.dark) #navbar .nav-tabs-item[data-active=\"true\"]::after{background:#107292}#topbar-cta-button a>span.absolute{border-radius:50px;background:var(--lr-live);border:1px solid rgba(255, 255, 255, 0.35);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 6px 14px -6px rgba(47, 179, 220, 0.45)}#topbar-cta-button a{padding-left:1rem;padding-right:0.75rem}#topbar-cta-button a .text-white,#topbar-cta-button a svg{color:#000!important}html:not(.dark) #topbar-cta-button a>span.absolute{background:#06232c;border-color:transparent;box-shadow:0 1px 1px rgba(14, 15, 17, 0.3)}html:not(.dark) #topbar-cta-button a .text-white,html:not(.dark) #topbar-cta-button a svg{color:#2fb3dc!important}#search-bar-entry{border-radius:50px;border:1px solid transparent;box-shadow:var(--lr-shadow);background:var(--lr-sheen) padding-box, linear-gradient(var(--lr-face-2), var(--lr-face-2)) padding-box, var(--lr-ring) border-box}#search-bar-entry:hover{background:var(--lr-sheen) padding-box, linear-gradient(var(--lr-face-2), var(--lr-face-2)) padding-box, var(--lr-ring-hot) border-box}#sidebar .sidebar-group-header{font-family:var(--lr-mono);font-size:0.6875rem;letter-spacing:0.08em;text-transform:uppercase;font-weight:500;color:#8d8d96}#sidebar a[aria-current=\"page\"]{border-radius:50px;color:var(--lr-live);background:rgba(47, 179, 220, 0.08);box-shadow:inset 0 0 0 1px rgba(47, 179, 220, 0.2)}html:not(.dark) #sidebar a[aria-current=\"page\"]{color:#084f67;background:rgba(16, 114, 146, 0.09);box-shadow:inset 0 0 0 1px rgba(16, 114, 146, 0.25)}#sidebar a:not([aria-current=\"page\"]):hover{border-radius:50px}#table-of-contents a[data-active=\"true\"],#table-of-contents .toc-item[data-active=\"true\"]{color:var(--lr-live)}html:not(.dark) #table-of-contents a[data-active=\"true\"]{color:#107292}#footer{border-top:1px solid var(--lr-line)}#content-area table th,#content-area table td{padding:0.75rem 1rem;vertical-align:top}#content-area table td:first-child{font-weight:500}#sidebar a[aria-current=\"page\"] img[src*=\"/assets/icons/\"],#navbar .nav-tabs-item[data-active=\"true\"] img[src*=\"/assets/icons/\"]{filter:brightness(0) saturate(100%) invert(58%) sepia(96%) saturate(237%) hue-rotate(148deg) brightness(81%) contrast(149%)}html:not(.dark) #sidebar a[aria-current=\"page\"] img[src*=\"/assets/icons/\"],html:not(.dark) #navbar .nav-tabs-item[data-active=\"true\"] img[src*=\"/assets/icons/\"]{filter:brightness(0) saturate(100%) invert(28%) sepia(90%) saturate(323%) hue-rotate(148deg) brightness(118%) contrast(123%)}"}],"page":{"pagePath":"migrating-from-cloud-run","slug":"/migrating-from-cloud-run","pageMetadata":{"title":"Migrating a service from Cloud Run","description":"A runbook for moving a Google Cloud Run service to Levelrail: concept mapping, deploying the same image, secrets, Cloud SQL, domains, jobs and what you give up.","og:url":"https://docs.levelrail.com/migrating-from-cloud-run","href":"/migrating-from-cloud-run"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"A runbook for moving a Google Cloud Run service to Levelrail: concept mapping, deploying the same image, secrets, Cloud SQL, domains, jobs and what you give up.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,input:`input`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`This is a runbook for moving one Cloud Run service onto a Levelrail instance you run yourself. It maps only to features that exist in this repository today. Where something is unverified or has no equivalent, it says so.`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Some areas are still beta (see `,_jsx(_components.a,{href:`/feature-status`,children:`feature status`}),`). You operate the server it runs on: OS updates, disk, backups and the Docker daemon are yours. Run the new deployment in parallel with Cloud Run, and keep Cloud Run as the rollback path until the shadow run in section 7 is clean.`]})}),`\n`,_jsxs(_components.p,{children:[`There is no importer for Cloud Run. Everything below is manual. A Cloud Run service is already a container image listening on a port, which is the unit Levelrail deploys, so most services move without a rebuild. Whether the move saves money is a separate question, covered in `,_jsx(_components.a,{href:`/cloud-run-alternative`,children:`Cloud Run alternative`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`1-inventory-what-cloud-run-holds`,children:`1. Inventory what Cloud Run holds`}),`\n`,_jsx(_components.p,{children:`Collect this before touching Levelrail. Much of it lives in the Google Cloud console or in the service’s revision template, not in your repo.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Item`}),_jsx(_components.th,{children:`How to get it`}),_jsx(_components.th,{children:`Why you need it`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Full service definition`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`gcloud run services describe SERVICE --region REGION --format export`})}),_jsx(_components.td,{children:`One YAML with the image, port, env, resources, scaling and probes. Keep it next to your notes.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Image reference`}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`image`}),` field in that YAML`]}),_jsxs(_components.td,{children:[`Usually Artifact Registry (`,_jsx(_components.code,{children:`REGION-docker.pkg.dev/PROJECT/REPO/IMAGE:TAG`}),`). Prefer a digest or a fixed tag over `,_jsx(_components.code,{children:`latest`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Env vars`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`env`}),` in that YAML`]}),_jsxs(_components.td,{children:[`Plain values move with `,_jsx(_components.code,{children:`apps env import`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Secret Manager references`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`env`}),` entries with `,_jsx(_components.code,{children:`valueFrom.secretKeyRef`}),`, and secret volume mounts`]}),_jsx(_components.td,{children:`Cloud Run resolves these at start. Levelrail has its own secret store, so you copy the values in.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Min and max instances, concurrency`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`autoscaling.knative.dev/minScale`}),`, `,_jsx(_components.code,{children:`maxScale`}),` and `,_jsx(_components.code,{children:`containerConcurrency`})]}),_jsx(_components.td,{children:`They map to a fixed replica count, see section 2.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`CPU and memory`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`resources.limits`})}),_jsxs(_components.td,{children:[`They map to `,_jsx(_components.code,{children:`resources.cpu`}),` and `,_jsx(_components.code,{children:`resources.memory`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Domains`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`gcloud beta run domain-mappings list --region REGION`}),`, or your load balancer config`]}),_jsx(_components.td,{children:`You recreate each one and cut DNS over.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Cloud SQL connections`}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`run.googleapis.com/cloudsql-instances`}),` annotation`]}),_jsx(_components.td,{children:`Each one needs its own data move, see section 5.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Cloud Scheduler jobs`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`gcloud scheduler jobs list`})}),_jsx(_components.td,{children:`Scheduler calls an HTTP URL. Levelrail scheduled tasks run a command in the container.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Service account and IAM`}),_jsx(_components.td,{children:`The service’s runtime service account`}),_jsx(_components.td,{children:`Anything the app does with Google APIs through that identity needs a replacement, see section 8.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`VPC connector and egress settings`}),_jsx(_components.td,{children:`The service YAML`}),_jsx(_components.td,{children:`Reaching private Google resources from outside Google needs your own network path.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`2-map-cloud-run-concepts-to-levelrail`,children:`2. Map Cloud Run concepts to Levelrail`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Cloud Run`}),_jsx(_components.th,{children:`Levelrail equivalent`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Service`}),_jsx(_components.td,{children:`An app with one service`}),_jsxs(_components.td,{children:[`See `,_jsx(_components.a,{href:`/deploying-apps`,children:`Deploying apps`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Container image from a registry`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`apps create --image`}),`, or `,_jsx(_components.code,{children:`image:`}),` in `,_jsx(_components.code,{children:`app.yaml`})]}),_jsx(_components.td,{children:`Private registries use a registry credential, see section 3.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Revision`}),_jsx(_components.td,{children:`A deploy`}),_jsxs(_components.td,{children:[`Each deploy is recorded with its image, status and reason. `,_jsx(_components.code,{children:`apps deploys list \u003capp>`}),` shows them.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Traffic to a previous revision, or revert`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`apps deploys rollback-to \u003capp> \u003cdeploy-id>`}),`, or `,_jsx(_components.code,{children:`apps rollback \u003capp> --image \u003ctag>`})]}),_jsx(_components.td,{children:`Prior images are pinned so garbage collection cannot remove a rollback target.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Gradual traffic split between revisions`}),_jsxs(_components.td,{children:[`Canary deploys, see `,_jsx(_components.a,{href:`/canary-deploys`,children:`Canary deploys`})]}),_jsx(_components.td,{children:`Check that page for the exact split behavior before relying on it.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Min instances`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`replicas`})}),_jsxs(_components.td,{children:[`Fixed, always running. `,_jsx(_components.code,{children:`apps scale \u003capp> --replicas N`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Max instances and autoscaling`}),_jsx(_components.td,{children:`None`}),_jsx(_components.td,{children:`There is no autoscaling. You choose the replica count.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Concurrency per instance`}),_jsx(_components.td,{children:`No setting`}),_jsxs(_components.td,{children:[`The container serves as many concurrent requests as it can handle. Replicas share load through the ingress, see `,_jsx(_components.a,{href:`/load-balancing`,children:`Load balancing`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`CPU and memory limits`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`resources.cpu`}),` and `,_jsx(_components.code,{children:`resources.memory`}),` in `,_jsx(_components.code,{children:`app.yaml`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`512Mi`}),` and `,_jsx(_components.code,{children:`1`}),` style values. Cloud Run’s CPU throttling when idle has no equivalent: the container always has its CPU.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Env vars`}),_jsxs(_components.td,{children:[`Plain env, `,_jsx(_components.code,{children:`apps env import --file`})]}),_jsx(_components.td,{children:`Applied at container create.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Secret Manager secrets`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`apps secrets set`}),`, envelope-encrypted and write-only`]}),_jsxs(_components.td,{children:[`Values are never returned after save. See `,_jsx(_components.a,{href:`/environment-and-secrets`,children:`Environment and secrets`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Startup probe`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`health.readiness`})}),_jsx(_components.td,{children:`A deploy that fails readiness does not take traffic.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Liveness probe`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`health.liveness`})}),_jsx(_components.td,{})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Custom domain with a managed certificate`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`domains:`}),` in the spec, or `,_jsx(_components.code,{children:`apps domains add`}),`, with Caddy handling TLS`]}),_jsxs(_components.td,{children:[`See `,_jsx(_components.a,{href:`/domains-and-ingress`,children:`Domains and ingress`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Cloud SQL`}),_jsx(_components.td,{children:`A managed database on Levelrail`}),_jsx(_components.td,{children:`You dump and restore the data yourself, section 5.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Cloud Scheduler to an HTTP endpoint`}),_jsxs(_components.td,{children:[`Scheduled tasks: `,_jsx(_components.code,{children:`apps scheduled-tasks create`})]}),_jsx(_components.td,{children:`A command inside the container, not an HTTP call.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Cloud Logging`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`apps logs`}),`, a node-local log store with search`]}),_jsxs(_components.td,{children:[`See `,_jsx(_components.a,{href:`/observability`,children:`Observability`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Cloud Monitoring request metrics`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`apps requests`}),` and `,_jsx(_components.code,{children:`apps metrics`})]}),_jsx(_components.td,{children:`Server-side request rate, errors and latency percentiles per app.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`IAM invoker and “allow unauthenticated”`}),_jsx(_components.td,{children:`Public by default once a domain is attached. Per-domain basic auth and an auth gate exist`}),_jsxs(_components.td,{children:[`See `,_jsx(_components.a,{href:`/domains-and-ingress`,children:`Domains and ingress`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Min instances at zero (scale to zero)`}),_jsxs(_components.td,{children:[`Opt-in whole-app sleep: `,_jsx(_components.code,{children:`apps sleep enable \u003capp> --after 30m`})]}),_jsxs(_components.td,{children:[`Not the same thing, see section 6 and `,_jsx(_components.a,{href:`/sleep-when-idle`,children:`Sleep when idle`}),`.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`3-deploy-the-same-container-image`,children:`3. Deploy the same container image`}),`\n`,_jsx(_components.p,{children:`If the service already runs from an image in a registry, you can deploy that image as is.`}),`\n`,_jsx(Heading,{level:`3`,id:`public-image`,children:`Public image`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --name`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --image`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` docker.io/your-org/web:1.4.2`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --port`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:` 8080`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`--port`}),` is the port your container listens on. Cloud Run tells your container which port to bind through the `,_jsx(_components.code,{children:`PORT`}),` environment variable. Set the same value as a plain env var so the app behaves the same here:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` env`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` import`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --file`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` prod.env`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --apply`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`where `,_jsx(_components.code,{children:`prod.env`}),` contains `,_jsx(_components.code,{children:`PORT=8080`}),` along with your other plain variables.`]}),`\n`,_jsx(Heading,{level:`3`,id:`private-image-in-artifact-registry`,children:`Private image in Artifact Registry`}),`\n`,_jsxs(_components.p,{children:[`Create a registry credential first. Artifact Registry accepts a service account key as the password with the username `,_jsx(_components.code,{children:`_json_key`}),`, and the host is `,_jsx(_components.code,{children:`REGION-docker.pkg.dev`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` registry-credentials`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --name`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` gar-private`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --registry-host`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` us-central1-docker.pkg.dev`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --username`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` _json_key`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --password`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"$(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`cat`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` sa-key.json)\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Create a service account that has only the `,_jsx(_components.code,{children:`Artifact Registry Reader`}),` role for this, and keep the key out of your shell history. Check the credential before the first deploy:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` registry-credentials`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` test`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`i`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`d`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`>`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Then reference it from an `,_jsx(_components.code,{children:`app.yaml`}),` and create the app from the file:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`yaml`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`yaml`,children:_jsxs(_components.code,{language:`yaml`,numberOfLines:`17`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`version`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`services`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` web`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` build`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` type`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`image`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` image`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`us-central1-docker.pkg.dev/PROJECT/REPO/web:1.4.2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` registryCredential`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`gar-private`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` port`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`8080`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` replicas`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` resources`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` memory`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`512Mi`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` cpu`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` health`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` readiness`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`path`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`/healthz`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`interval`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`5s`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`timeout`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`2s`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` env`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` PORT`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"8080\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` DATABASE_URL`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`secret`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`required`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --file`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` app.yaml`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --secret`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` DATABASE_URL=postgres://...`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`{ secret: true, required: true }`}),` variable must be supplied with `,_jsx(_components.code,{children:`--secret`}),` at creation, otherwise the CLI refuses to create the app. The field reference is in `,_jsx(_components.a,{href:`/app-spec-reference`,children:`app.yaml reference`}),`, and the registry credential steps are in `,_jsx(_components.a,{href:`/backups-and-storage#registry-credentials`,children:`Backup targets, registry credentials and app volume backups`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`image-not-reachable-from-your-server`,children:`Image not reachable from your server`}),`\n`,_jsx(_components.p,{children:`If you would rather not give the server a Google credential, pull the image where you have access, retag it and push it to a registry the server can reach:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`docker`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` pull`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` us-central1-docker.pkg.dev/PROJECT/REPO/web:1.4.2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`docker`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` tag`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` us-central1-docker.pkg.dev/PROJECT/REPO/web:1.4.2`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` registry.example.com/web:1.4.2`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`docker`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` push`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` registry.example.com/web:1.4.2`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Image deploys do not rebuild anything. If you want Levelrail to build from your repo instead, that is the git flow in `,_jsx(_components.a,{href:`/deploying-apps#from-a-git-repository`,children:`Deploying apps`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`redeploy-and-roll-back`,children:`Redeploy and roll back`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` deploy`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --image`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` us-central1-docker.pkg.dev/PROJECT/REPO/web:1.4.3`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` deploys`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` deploys`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` rollback-to`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`deploy-i`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`d`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`--watch`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`4-env-vars-secrets-health-checks`,children:`4. Env vars, secrets, health checks`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Plain env. Copy the non-secret entries from the exported service YAML into a `,_jsx(_components.code,{children:`.env`}),` file, then `,_jsx(_components.code,{children:`apps env import \u003capp> --file prod.env --dry-run`}),`, then again without `,_jsx(_components.code,{children:`--dry-run`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Secrets. Read each value from Secret Manager and set it as a Levelrail secret:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` secrets`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` set`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` DATABASE_URL`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` \"$(`}),_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`gcloud`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` secrets versions access latest `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`--secret=DATABASE_URL`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`)\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`For many keys write a `,_jsx(_components.code,{children:`secrets.env`}),` file and use `,_jsx(_components.code,{children:`apps secrets set web --env-file secrets.env`}),`. Delete the file afterwards. There is no live link to Secret Manager: rotating a secret in Google does not change it here.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Apply. `,_jsx(_components.code,{children:`apps apply web`}),` restarts the app so saved env and secrets reach the running container.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Secret files. Cloud Run can mount a secret as a file. Levelrail injects secrets as env vars. If your code reads a file path, either change it to read the env var or write the file from the env var in your entrypoint.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Health. A Cloud Run startup probe becomes a readiness probe, and a liveness probe stays a liveness probe:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` health`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` set`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --probe`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` readiness`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --path`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` /healthz`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --interval`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 5s`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` health`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` set`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --probe`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` liveness`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --path`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` /healthz`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --failures`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:` 3`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A deploy that fails readiness does not take over traffic: the ingress keeps routing to the previous release and the attempt is recorded as failed. Cloud Run’s default TCP startup check has no direct counterpart, so add a real `,_jsx(_components.code,{children:`/healthz`}),` route.`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`5-move-cloud-sql-data`,children:`5. Move Cloud SQL data`}),`\n`,_jsxs(_components.p,{children:[`A managed database on Levelrail is a container on your node with its own volume, credentials and scheduled backups. It is not a hosted service with a replica in another zone. Read `,_jsx(_components.a,{href:`/managing-databases`,children:`Managing databases`}),` before you commit.`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Create the database with a matching major version:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` databases`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --name`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` main`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --engine`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` postgres`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --version`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:` 16`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` databases`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` status`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` main`})]}),`\n`]})})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Dump from Cloud SQL. Use the Cloud SQL Auth Proxy or an authorized network, then:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`pg_dump`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --format=custom`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --no-owner`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --no-acl`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --host=127.0.0.1`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --port=5432`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --username=app`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --dbname=appdb`}),_jsx(_components.span,{style:{color:`#D7BA7D`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --file=appdb.dump`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Alternatively use `,_jsx(_components.code,{children:`gcloud sql export sql INSTANCE gs://BUCKET/appdb.sql --database=appdb`}),` and download the file.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Restore into the new database. Publish the database port temporarily, then restore with `,_jsx(_components.code,{children:`pg_restore`}),` using the database’s own credentials:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` databases`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` public-access`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` set`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` main`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --port`}),_jsx(_components.span,{style:{color:`#B5CEA8`,\"--shiki-dark\":`#B5CEA8`},children:` 5433`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`pg_restore`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --no-owner`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --no-acl`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --dbname=`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`\"postgres://USER:PASSWORD@SERVER_IP:5433/DBNAME?sslmode=require\"`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` appdb.dump`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` databases`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` public-access`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` clear`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` main`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The credentials are the ones Levelrail generated for the database (see the Overview tab and `,_jsx(_components.code,{children:`levelrail-cli databases get main`}),`). A temporary login from `,_jsx(_components.code,{children:`databases access temp`}),` with `,_jsx(_components.code,{children:`--preset read_write`}),` cannot change the schema, so it is not enough for a first restore. Clear public access when you are done.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Connect the app to the database instead of pasting a URL:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` connect`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` main`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --env-var`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` DATABASE_URL`})]}),`\n`]})})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Rehearse the cutover. A dump is a point in time. For a live database, plan a short write freeze: stop writes on Cloud Run, take a final dump, restore, switch. Time the restore before the real day.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Backups. Configure a backup target and a schedule, then run a restore into a new database to prove it works. See `,_jsx(_components.a,{href:`/backups-and-storage`,children:`Backup targets`}),`.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Cloud SQL’s automatic failover, read replicas and point-in-time recovery are not replicated by default here. Point-in-time restore exists for Postgres, see `,_jsx(_components.a,{href:`/managing-databases`,children:`Managing databases`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`6-domains-jobs-logs-and-metrics`,children:`6. Domains, jobs, logs and metrics`}),`\n`,_jsx(Heading,{level:`3`,id:`domains-and-certificates`,children:`Domains and certificates`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Add the domain to the app while DNS still points at Google:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` domains`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` app.example.com`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --dns`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` off`})]}),`\n`]})})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Test before you move DNS, with a host override:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --resolve`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` app.example.com:443:SERVER_IP`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` -k`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` https://app.example.com/healthz`})]}),`\n`]})})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Lower the DNS TTL a day ahead, then change the A and AAAA records to the server’s public IP. Cloud Run domain mappings point at Google’s records, so those are replaced, not edited.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Certificates: with ACME enabled, issuance needs the domain to already point at the server, so expect a short window, or upload a certificate for the domain first. ACME has one recorded live run, see the `,_jsx(_components.a,{href:`/acme-verification-runbook`,children:`ACME verification runbook`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Keep the Cloud Run service and its domain mapping untouched until the shadow run is clean. Restoring the old DNS records is the rollback.`}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`scheduled-jobs`,children:`Scheduled jobs`}),`\n`,_jsxs(_components.p,{children:[`A Cloud Scheduler job that POSTs to `,_jsx(_components.code,{children:`/cron/cleanup`}),` has no direct equivalent, because Levelrail runs a command, not an HTTP request. Options:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Put the work behind a command your image already contains and schedule that: `,_jsx(_components.code,{children:`levelrail-cli apps scheduled-tasks create web --schedule \"0 3 * * *\" -- ./cleanup.sh`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Keep the HTTP route and call it from a command that exists in the image, for example `,_jsx(_components.code,{children:`curl`}),` if it is installed. Confirm the tool exists before relying on it.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Run each once with `,_jsx(_components.code,{children:`levelrail-cli apps scheduled-tasks run web \u003cid>`}),` and check `,_jsx(_components.code,{children:`last_run_status`}),`. More in `,_jsx(_components.a,{href:`/scheduled-jobs`,children:`Scheduled jobs`}),`. Cloud Run Jobs (batch tasks) can use the `,_jsx(_components.code,{children:`jobs:`}),` block, which runs a command in a fresh container of the service’s image.`]}),`\n`,_jsx(Heading,{level:`3`,id:`logs-and-metrics`,children:`Logs and metrics`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` logs`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --since`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 1h`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --q`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` error`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` logs`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --follow`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` requests`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#DCDCAA`,\"--shiki-dark\":`#DCDCAA`},children:`levelrail-cli`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` apps`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` metrics`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` web`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --metric`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` cpu_percent`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --since`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 1h`}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:` --step`}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:` 5m`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Logs and metrics are stored on the node. If you have alerts or dashboards in Google Cloud Monitoring, rebuild them as Levelrail alert rules, see `,_jsx(_components.a,{href:`/observability`,children:`Observability`}),`. Structured JSON logs written to stdout work as they do on Cloud Run, but the field names Google uses for severity and trace are not interpreted specially.`]}),`\n`,_jsx(Heading,{level:`2`,id:`7-cutover-and-shadow-run`,children:`7. Cutover and shadow run`}),`\n`,_jsx(_components.p,{children:`Run both platforms side by side long enough for boring problems to appear. Suggested minimum: one full business cycle, including any weekly or monthly job.`}),`\n`,_jsxs(_components.ul,{className:`contains-task-list`,children:[`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`A deliberately broken deploy is rejected while the old container keeps serving.`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`A rollback to the previous image works from the CLI and the dashboard.`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Every env var key that exists on Cloud Run exists here, and secrets were copied, not left behind.`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`The app reads `,_jsx(_components.code,{children:`PORT`}),` or the configured port and passes readiness on the first deploy.`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Webhooks, OAuth callback URLs and allowed origins point at the new hostname or still resolve through the same domain.`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Each scheduled task ran on schedule.`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`A database backup ran, and a restore was rehearsed into a new database.`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Certificate issuance finished and expiry alerting is configured.`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`Response time and error rate compare acceptably against Cloud Run, using `,_jsx(_components.code,{children:`apps requests`}),`.`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`A control plane backup exists, see `,_jsx(_components.a,{href:`/control-plane-backup`,children:`Control plane backup`}),`.`]}),`\n`,_jsxs(_components.li,{className:`task-list-item`,children:[_jsx(_components.input,{type:`checkbox`,disabled:true}),` `,`The server has an owner for patching and disk monitoring.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`Decommission the Cloud Run service only after this passes and you have decided what to do about each item in the next section.`}),`\n`,_jsx(Heading,{level:`2`,id:`8-what-you-give-up`,children:`8. What you give up`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Cloud Run feature`}),_jsx(_components.th,{children:`Status on Levelrail`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Scale to zero`}),_jsx(_components.td,{children:`Not automatic per request. Whole-app sleep after a quiet period exists as an opt-in, and the first request waits for a cold start of seconds to a minute. Compare that to Cloud Run’s much shorter cold starts.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Autoscaling`}),_jsx(_components.td,{children:`None. Replicas are fixed. A traffic spike beyond your server’s capacity is a slow service, not a new instance.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Pay per request billing`}),_jsxs(_components.td,{children:[`You pay for the server whether it is busy or idle. See `,_jsx(_components.a,{href:`/cloud-run-alternative`,children:`Cloud Run alternative`}),` for when that favors you.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Multi-zone and regional redundancy`}),_jsx(_components.td,{children:`One server is one failure domain. A multi-node setup is possible, but you build and run it.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Google’s global frontend and edge`}),_jsx(_components.td,{children:`Caddy serves from the nodes you run. Put a CDN in front if you need one.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Managed IAM, workload identity and service-to-service auth`}),_jsx(_components.td,{children:`Your app’s Google API calls need a credential you provide, such as a service account key stored as a secret.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Cloud SQL operations (automated patching, HA, replicas)`}),_jsxs(_components.td,{children:[`You upgrade and back up the database container yourself, see `,_jsx(_components.a,{href:`/database-upgrades`,children:`Database upgrades`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Automatic OS and runtime patching`}),_jsx(_components.td,{children:`The host and Docker are yours to patch.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Revision traffic percentages in the console`}),_jsxs(_components.td,{children:[`Canary deploys cover a subset, see `,_jsx(_components.a,{href:`/canary-deploys`,children:`Canary deploys`}),`.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See also`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/cloud-run-alternative`,children:`Cloud Run alternative`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/deploying-apps`,children:`Deploying and managing apps`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/domains-and-ingress`,children:`Domains and ingress`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/managing-databases`,children:`Managing databases`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/app-spec-reference`,children:`app.yaml reference`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/feature-status`,children:`Feature status`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/migrating-from-vercel`,children:`Migrating from Vercel`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Migrating a service from Cloud Run","description":"A runbook for moving a Google Cloud Run service to Levelrail: concept mapping, deploying the same image, secrets, Cloud SQL, domains, jobs and what you give up.","og:url":"https://docs.levelrail.com/migrating-from-cloud-run","href":"/migrating-from-cloud-run"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"1. Inventory what Cloud Run holds","slug":"1-inventory-what-cloud-run-holds","depth":2,"children":[]},{"title":"2. Map Cloud Run concepts to Levelrail","slug":"2-map-cloud-run-concepts-to-levelrail","depth":2,"children":[]},{"title":"3. Deploy the same container image","slug":"3-deploy-the-same-container-image","depth":2,"children":[{"title":"Public image","slug":"public-image","depth":3,"children":[]},{"title":"Private image in Artifact Registry","slug":"private-image-in-artifact-registry","depth":3,"children":[]},{"title":"Image not reachable from your server","slug":"image-not-reachable-from-your-server","depth":3,"children":[]},{"title":"Redeploy and roll back","slug":"redeploy-and-roll-back","depth":3,"children":[]}]},{"title":"4. Env vars, secrets, health checks","slug":"4-env-vars-secrets-health-checks","depth":2,"children":[]},{"title":"5. Move Cloud SQL data","slug":"5-move-cloud-sql-data","depth":2,"children":[]},{"title":"6. Domains, jobs, logs and metrics","slug":"6-domains-jobs-logs-and-metrics","depth":2,"children":[{"title":"Domains and certificates","slug":"domains-and-certificates","depth":3,"children":[]},{"title":"Scheduled jobs","slug":"scheduled-jobs","depth":3,"children":[]},{"title":"Logs and metrics","slug":"logs-and-metrics","depth":3,"children":[]}]},{"title":"7. Cutover and shadow run","slug":"7-cutover-and-shadow-run","depth":2,"children":[]},{"title":"8. What you give up","slug":"8-what-you-give-up","depth":2,"children":[]},{"title":"See also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/levelrail/34332f0f5f6180ce/public/deploy.js"],"subdomain":"levelrail","siteName":"Levelrail","title":"Migrating a service from Cloud Run - Levelrail","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T17:48:52.028Z","gitLastModified":"2026-10-19T16:18:46.000Z","originalFileLocation":"migrating-from-cloud-run.md"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"A runbook for moving a Google Cloud Run service to Levelrail: concept mapping, deploying the same image, secrets, Cloud SQL, domains, jobs and what you give up.\">\u003cmeta data-mint-head name=\"keywords\" content=\"self-hosted PaaS, Coolify alternative, Docker deployment platform, self-hosted deploys, Levelrail\">\u003cmeta data-mint-head name=\"application-name\" content=\"Levelrail\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/levelrail/sfnZeja47AHfK8h4/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/levelrail/sfnZeja47AHfK8h4/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/levelrail/sfnZeja47AHfK8h4/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/levelrail/sfnZeja47AHfK8h4/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/levelrail/sfnZeja47AHfK8h4/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/levelrail/sfnZeja47AHfK8h4/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/levelrail/sfnZeja47AHfK8h4/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/levelrail/sfnZeja47AHfK8h4/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/levelrail/sfnZeja47AHfK8h4/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Migrating a service from Cloud Run - Levelrail\">\u003cmeta data-mint-head property=\"og:description\" content=\"A runbook for moving a Google Cloud Run service to Levelrail: concept mapping, deploying the same image, secrets, Cloud SQL, domains, jobs and what you give up.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Levelrail Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.levelrail.com/migrating-from-cloud-run\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.levelrail.com/public/og/default.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Migrating a service from Cloud Run - Levelrail\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"A runbook for moving a Google Cloud Run service to Levelrail: concept mapping, deploying the same image, secrets, Cloud SQL, domains, jobs and what you give up.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.levelrail.com/public/og/default.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/levelrail/sfnZeja47AHfK8h4/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Levelrail\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#107292\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.levelrail.com/migrating-from-cloud-run\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/migrating-from-cloud-run.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.levelrail.com/#organization\",\"name\":\"Levelrail\",\"url\":\"https://docs.levelrail.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/levelrail/56HjW70mOjUmjIrm/assets/brand/wordmark-light.svg?fit=max\u0026auto=format\u0026n=56HjW70mOjUmjIrm\u0026q=85\u0026s=cbe02b3c3d17b11f9cc5a18551a30782\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.levelrail.com#website\",\"name\":\"Levelrail\",\"url\":\"https://docs.levelrail.com\",\"publisher\":{\"@id\":\"https://docs.levelrail.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.levelrail.com/migrating-from-cloud-run#webpage\",\"url\":\"https://docs.levelrail.com/migrating-from-cloud-run\",\"name\":\"Migrating a service from Cloud Run\",\"description\":\"A runbook for moving a Google Cloud Run service to Levelrail: concept mapping, deploying the same image, secrets, Cloud SQL, domains, jobs and what you give up.\",\"dateModified\":\"2026-10-19T16:18:46.000Z\",\"isPartOf\":{\"@id\":\"https://docs.levelrail.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.levelrail.com/migrating-from-cloud-run#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.levelrail.com/migrating-from-cloud-run#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Migrate\",\"item\":\"https://docs.levelrail.com/migrate-to-levelrail\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Migrating a service from Cloud Run\",\"item\":\"https://docs.levelrail.com/migrating-from-cloud-run\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.levelrail.com/migrating-from-cloud-run#article\",\"headline\":\"Migrating a service from Cloud Run\",\"name\":\"Migrating a service from Cloud Run\",\"description\":\"A runbook for moving a Google Cloud Run service to Levelrail: concept mapping, deploying the same image, secrets, Cloud SQL, domains, jobs and what you give up.\",\"url\":\"https://docs.levelrail.com/migrating-from-cloud-run\",\"mainEntityOfPage\":{\"@id\":\"https://docs.levelrail.com/migrating-from-cloud-run#webpage\"},\"image\":\"https://docs.levelrail.com/public/og/default.png\",\"dateModified\":\"2026-10-19T16:18:46.000Z\",\"publisher\":{\"@id\":\"https://docs.levelrail.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.levelrail.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Levelrail\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Levelrail\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/migrating-from-cloud-run.md","siteName":"Levelrail","nav":{"global":null,"tabs":[{"tab":"Get started","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/rocket-launch.svg","pages":[{"title":"Get started","href":""}]},{"tab":"How-to guides","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/book-open.svg","groups":[{"group":"Essentials","pages":[{"title":"Troubleshooting","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/lifebuoy.svg","sidebarTitle":"Troubleshooting","href":"/troubleshooting"},{"title":"Doctor","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/lifebuoy.svg","sidebarTitle":"Doctor","href":"/doctor"},{"title":"Doctor and import from the command line","sidebarTitle":"Doctor and import CLI","href":"/doctor-and-import"},{"title":"Email notifications","href":"/email-notifications"},{"title":"Email templates and messages","href":"/email-templates"},{"title":"Alert inbox","href":"/alert-inbox"},{"title":"Event webhooks","href":"/event-webhooks"},{"title":"Off-host heartbeat","href":"/heartbeat"},{"title":"Attention center","href":"/attention-center"}]},{"group":"Deploying","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/cloud-arrow-up.svg","pages":[{"title":"Deploying and managing apps","sidebarTitle":"Deploying apps","href":"/deploying-apps"},{"title":"Deploy from your computer","sidebarTitle":"Deploy from CLI","href":"/deploy-from-cli"},{"title":"Drop deploy for static sites","sidebarTitle":"Drop deploy","href":"/drop-deploy"},{"title":"Compose apps","href":"/compose-apps"},{"title":"Runtime options","href":"/runtime-options"},{"title":"App files","href":"/app-files"},{"title":"UDP published ports","href":"/udp-ports"},{"title":"New app wizard","href":"/new-app-wizard"},{"title":"Importing apps","href":"/importing-apps"},{"title":"Connect a Git source to an existing app","href":"/connect-git-source"},{"title":"Static pages","sidebarTitle":"Pages","href":"/pages"},{"title":"Static site routing rules","sidebarTitle":"Static routing","href":"/static-routing"},{"title":"Deploy safety","href":"/deploy-safety"},{"title":"Publish lock","href":"/publish-lock"},{"title":"Deploy failures","href":"/deploy-failures"},{"title":"Status reasons","href":"/status-reasons"},{"title":"Deploying through git host outages","href":"/git-host-outages"},{"title":"Deploy trace","href":"/deploy-trace"},{"title":"Deploy event timeline","href":"/deploy-event-timeline"},{"title":"Build performance","href":"/build-performance"},{"title":"Build center","href":"/build-center"},{"title":"Scheduled deploys","href":"/scheduled-deploys"},{"title":"Pull request comment commands","href":"/pr-comment-commands"},{"title":"Scheduled jobs","href":"/scheduled-jobs"},{"title":"Scheduled and background functions","href":"/scheduled-functions"},{"title":"Jobs","href":"/jobs"},{"title":"Image auto-update","href":"/image-auto-update"},{"title":"Build hooks","href":"/build-hooks"},{"title":"Sleep when idle","href":"/sleep-when-idle"},{"title":"Functions","href":"/functions"},{"title":"Canary deploys","href":"/canary-deploys"},{"title":"Split testing","href":"/split-testing"},{"title":"Deployments page","href":"/deployments-page"},{"title":"Images","href":"/images"},{"title":"Deploy previews","href":"/deploy-previews"},{"title":"Framework presets","href":"/frameworks"},{"title":"Deploy a Next.js app","sidebarTitle":"Next.js","href":"/nextjs"},{"title":"Next.js image cache volume","href":"/nextjs-image-cache"},{"title":"Next.js shared cache for multiple replicas","href":"/nextjs-shared-cache"},{"title":"Next.js skew protection, deploy side","href":"/nextjs-skew-protection"},{"title":"Deploy URLs","href":"/deploy-urls"},{"title":"Deploy links and badge","href":"/deploy-link"},{"title":"Deploy timeline","href":"/deploy-timeline"},{"title":"Deploy receipts","href":"/deploy-receipts"},{"title":"Preview environments per pull request","sidebarTitle":"Preview environments","href":"/previews"},{"title":"Chat-interactive deploy approvals","sidebarTitle":"Chat approvals","href":"/chat-deploy-approvals"},{"title":"Supply chain visibility","href":"/supply-chain"},{"title":"Secret scanning","href":"/secret-scanning"},{"title":"Deploy status badge","href":"/deploy-status-badge"},{"title":"Dashboard screenshots","href":"/screenshots"},{"title":"Running Levelrail in Docker","href":"/docker"},{"title":"Zero-downtime deploys with Docker: readiness-gated cutover and rollback","href":"/zero-downtime-deploys"},{"title":"Rollout control","href":"/rollout-control"},{"title":"Preview environments","href":"/preview-environments"},{"title":"Deploy contexts: env and build settings per kind of deploy","href":"/deploy-contexts"}]},{"group":"Networking and multi-node","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/globe-hemisphere-west.svg","pages":[{"title":"Domains and ingress","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/globe-hemisphere-west.svg","sidebarTitle":"Add a domain and HTTPS","href":"/domains-and-ingress"},{"title":"Standalone domains","href":"/standalone-domains"},{"title":"Domain setup stepper","href":"/domains"},{"title":"Dynamic DNS","href":"/dynamic-dns"},{"title":"DNS zones and records","href":"/dns"},{"title":"DNS zones and nameserver delegation","href":"/dns-zones"},{"title":"Mail DNS","tag":"Experimental","href":"/mail-dns"},{"title":"Mail server template","tag":"Experimental","href":"/mail-template"},{"title":"Mailboxes, aliases and the mail queue","tag":"Experimental","href":"/mail-mailboxes"},{"title":"Mail backup and restore","href":"/mail-backup"},{"title":"Mail storage","href":"/mail-storage"},{"title":"Diagnose a domain","href":"/domain-diagnosis"},{"title":"Domain traffic controls","href":"/domain-traffic-controls"},{"title":"Ingress abuse defense","href":"/abuse-defense"},{"title":"CDN and caching","href":"/cdn-and-caching"},{"title":"Forms","tag":"Beta","href":"/forms"},{"title":"Firewall","href":"/firewall"},{"title":"Verifying real ACME issuance against a live domain","href":"/acme-verification-runbook"},{"title":"Multi-node: adding and managing nodes","tag":"Beta","href":"/multi-node"},{"title":"Server patching","href":"/server-patching"},{"title":"Multi-node quickstart","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/hard-drives.svg","tag":"Beta","sidebarTitle":"Add a second server","href":"/multi-node-quickstart"},{"title":"Add a node anywhere","tag":"Beta","sidebarTitle":"Add a node anywhere","href":"/add-node-anywhere"},{"title":"Add a server over SSH","tag":"Beta","sidebarTitle":"Add a server over SSH","href":"/add-node-over-ssh"},{"title":"Run Levelrail on home hardware","sidebarTitle":"Home hardware","href":"/home-hardware"},{"title":"Resource-aware placement","tag":"Beta","href":"/resource-aware-placement"},{"title":"Node scheduling: taints, tolerations, affinity and score mode","tag":"Beta","href":"/node-scheduling"},{"title":"Autoscaling","tag":"Beta","href":"/autoscaling"},{"title":"Node provisioning","href":"/node-provisioning"},{"title":"Multi-cloud provisioning quickstart","href":"/multi-cloud-provisioning"},{"title":"Network topology view","href":"/network-topology"},{"title":"Private app tunnel","href":"/app-tunnel"},{"title":"Project topology graph","href":"/service-topology-graph"},{"title":"Canvas","href":"/canvas"},{"title":"Build node routing","href":"/build-node-routing"}]},{"group":"Databases and storage","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/database.svg","pages":[{"title":"Managing databases","href":"/managing-databases"},{"title":"Managed databases from the command line","sidebarTitle":"Managed databases","href":"/managed-databases"},{"title":"Postgres connection pooler","href":"/postgres-pooler"},{"title":"Database upgrades","href":"/database-upgrades"},{"title":"Database version catalog","href":"/database-version-catalog"},{"title":"External databases","href":"/external-databases"},{"title":"Connecting apps to databases","href":"/connecting-apps-to-databases"},{"title":"Backup targets, registry credentials, and app volume backups","sidebarTitle":"Backups and storage","href":"/backups-and-storage"},{"title":"Backup copies","href":"/backup-copies"},{"title":"Volume files","href":"/volume-files"},{"title":"Prove your backups work","href":"/prove-your-backups-work"},{"title":"Object storage","href":"/object-storage"},{"title":"Network shares","href":"/network-shares"},{"title":"Log explorer","href":"/log-explorer"},{"title":"Custom dashboards","href":"/custom-dashboards"},{"title":"Tracing","href":"/tracing"},{"title":"OTLP logs and metrics ingest","href":"/otlp-ingest"},{"title":"Error tracking","href":"/error-tracking"},{"title":"Loki-compatible log API","href":"/loki-api"},{"title":"Log pipelines","href":"/log-pipelines"},{"title":"Log volume budgets","href":"/log-budgets"},{"title":"Data export","href":"/data-export"},{"title":"Traffic export","href":"/traffic-export"},{"title":"Audit event schema","href":"/audit-event-schema"},{"title":"Audit log","href":"/audit-log"},{"title":"Control plane backup and restore","sidebarTitle":"Control plane backup","href":"/control-plane-backup"},{"title":"Whole-server recovery","href":"/whole-server-recovery"},{"title":"Archives","href":"/archives"},{"title":"Disaster recovery","href":"/disaster-recovery"},{"title":"Control plane recovery","href":"/control-plane-recovery"},{"title":"Upgrade safely","href":"/upgrade-safely"},{"title":"Database access and network","href":"/database-access"},{"title":"Private networks and allow rules","href":"/private-networks"},{"title":"Database explorer and fleet overview","href":"/database-explorer"},{"title":"Database viewer","href":"/database-viewer"}]},{"group":"CI/CD and automation","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/git-branch.svg","pages":[{"title":"Deploying from GitHub Actions","href":"/github-actions"},{"title":"Use any CI","href":"/use-any-ci"},{"title":"Pipelines","href":"/pipelines"},{"title":"Pipelines: OIDC federation","href":"/pipelines-oidc"},{"title":"Git integrations","href":"/git-integrations"},{"title":"Azure DevOps","href":"/azure-devops"},{"title":"Git reliability","href":"/git-reliability"},{"title":"Wait for CI before deploying","href":"/ci-gate"},{"title":"Deploy with git push","href":"/git-push-deploy"},{"title":"Import a repository","sidebarTitle":"Import a repo","href":"/import-a-repo"},{"title":"Monorepos","href":"/monorepos"}]},{"group":"Security and access","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/shield-check.svg","pages":[{"title":"Sign-in engine","href":"/auth-engine"},{"title":"Host firewall","href":"/host-firewall"},{"title":"Exposure audit","href":"/exposure-audit"},{"title":"Security center","href":"/security-center"},{"title":"Compliance evidence","href":"/compliance-evidence"},{"title":"Emergency access","href":"/emergency-access"},{"title":"Master key rotation","href":"/master-key-rotation"},{"title":"Secret rotation policies","href":"/secret-rotation"},{"title":"Vault and OpenBao secret references","href":"/vault-secret-references"},{"title":"Your account","href":"/account"},{"title":"Access control","href":"/access-control"},{"title":"Labels and namespaces","href":"/labels"},{"title":"Teams and roles","href":"/teams-and-roles"},{"title":"Team and project quotas","href":"/team-and-project-quotas"},{"title":"Environments","href":"/environments"},{"title":"Promotions and release notes","href":"/promotions-and-releases"},{"title":"Identity and access: users, roles, and IAM policies","href":"/identity-and-access"},{"title":"SAML single sign-on","href":"/sso-saml"},{"title":"OAuth and OIDC single sign-on","href":"/sso-oidc"},{"title":"SCIM provisioning","href":"/scim"},{"title":"Session policy","href":"/session-policy"},{"title":"Projects, organizations, and environments","href":"/projects-and-organizations"}]},{"group":"Scale and operations","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/chart-line-up.svg","pages":[{"title":"Managing apps at scale","href":"/managing-apps-at-scale"},{"title":"Tags","href":"/tags"},{"title":"Resource console","href":"/resource-console"},{"title":"Command palette","href":"/command-palette"},{"title":"Keyboard shortcuts","href":"/keyboard"},{"title":"Cost estimate","href":"/cost-estimate"},{"title":"Usage and cost","href":"/usage-and-cost"},{"title":"Cost explorer and budgets","href":"/cost-explorer"},{"title":"Spend caps","href":"/spend-caps"},{"title":"Integrations","href":"/integrations"},{"title":"Cloud integrations","href":"/cloud-integrations"},{"title":"Rolling back the control plane","href":"/rollback"},{"title":"Pre-deploy database snapshots","href":"/predeploy-snapshot"},{"title":"Resilience: what survives a control plane crash","href":"/resilience"},{"title":"Resilience, in short","href":"/resilience-summary"},{"title":"Chaos test coverage","href":"/chaos-coverage"},{"title":"Observability: metrics, logs, and alerts","href":"/observability"},{"title":"Traffic observability: rate, errors and duration","href":"/traffic-observability"},{"title":"Prometheus scrape endpoint","href":"/prometheus-scrape"},{"title":"Web vitals","href":"/web-vitals"},{"title":"Public status page","href":"/status-page"},{"title":"Monitors","href":"/monitors"},{"title":"External monitoring","href":"/external-monitoring"},{"title":"Scheduled maintenance","href":"/scheduled-maintenance"},{"title":"Deploy policies","href":"/deploy-policies"},{"title":"What's new panel","href":"/whats-new-panel"}]},{"group":"AI and agents","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/sparkle.svg","pages":[{"title":"Working with AI agents","href":"/agents"},{"title":"AI control","href":"/ai-control"}]},{"group":"Templates and catalog","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/squares-four.svg","pages":[{"title":"Service template catalog","tag":"Beta","href":"/templates-and-registry"},{"title":"Private registries","href":"/private-registries"},{"title":"Template upgrades","href":"/template-upgrades"},{"title":"Template catalog","href":"/template-catalog"},{"title":"Deploy button","href":"/deploy-button"},{"title":"Template status","href":"/templates-status"},{"title":"Catalog index","href":"/catalog-index"},{"title":"Add a template","href":"/add-a-template"},{"title":"Arm64 compatibility","href":"/arm-compatibility"},{"title":"Starter kit templates","href":"/templates"}]},{"group":"Migrate","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/arrows-left-right.svg","pages":[{"title":"Migrate to Levelrail","sidebarTitle":"Migration overview","href":"/migrate-to-levelrail"},{"title":"Migration wizard","sidebarTitle":"Migration wizard","href":"/migration-wizard"},{"title":"Migrate from Coolify","sidebarTitle":"From Coolify","href":"/migrate-from-coolify"},{"title":"Coolify exit gap report","sidebarTitle":"Coolify exit gaps","href":"/coolify-exit-gap-report"},{"title":"Move a Coolify one-click service to a Compose app","sidebarTitle":"Service to Compose","href":"/coolify-service-to-compose"},{"title":"Migrate from Dokploy","sidebarTitle":"From Dokploy","href":"/migrate-from-dokploy"},{"title":"Migrate from CapRover","sidebarTitle":"From CapRover","href":"/migrate-from-caprover"},{"title":"Migrate from Dokku","sidebarTitle":"From Dokku","href":"/migrate-from-dokku"},{"title":"Migrate from Docker Compose","sidebarTitle":"From Docker Compose","href":"/migrate-from-docker-compose"},{"title":"Import Kubernetes manifests","href":"/import-kubernetes"},{"title":"Migration reference","sidebarTitle":"Reference","href":"/migration-reference"},{"title":"Migrating from Coolify, Dokploy, or CapRover","sidebarTitle":"Moved: migration guides","href":"/migrating-from-coolify-dokploy-and-caprover"},{"title":"Migration agent threat model","sidebarTitle":"Migration agent threat model","href":"/migration-agent-threat-model"},{"title":"Migrate on the same server","href":"/migrate-same-server"},{"title":"Move a domain with no downtime","href":"/move-a-domain-with-no-downtime"},{"title":null,"href":"/migrate-over-ssh"},{"title":"Migrate a project from Vercel","href":"/migrate-from-vercel"},{"title":"Migrating a Next.js app from Vercel","href":"/migrating-from-vercel"},{"title":"Migrating a static site from Netlify","description":"A runbook for moving a Netlify site to Levelrail: build settings, netlify.toml mapping, redirects and headers, forms, a DNS cutover and gaps.","href":"/migrating-from-netlify"},{"title":"Migrating a service from Cloud Run","href":"/migrating-from-cloud-run"}]},{"group":"Infrastructure as code","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/flask.svg","pages":[{"title":"IaC quickstart","tag":"Experimental","description":"Describe an app and a database as YAML, preview the change, apply it, and export what exists. Five minutes.","href":"/iac/index"},{"title":"IaC templates","tag":"Experimental","href":"/iac/templates"},{"title":"How IaC apply works","tag":"Experimental","href":"/iac/how-it-works"},{"title":"IaC in CI","tag":"Experimental","href":"/iac/ci"},{"title":"Git sync for stacks","tag":"Experimental","href":"/iac/git-sync"},{"title":"Connect a cloud account","tag":"Experimental","href":"/iac/cloud-connect"},{"title":"IaC resource kinds","tag":"Experimental","href":"/iac/resources"},{"title":"Compose projects as code","tag":"Beta","href":"/iac/compose"},{"title":"Reference","href":"/iac/reference"},{"title":"Errors","href":"/iac/errors"},{"title":"Platform as code","tag":"Experimental","href":"/platform-as-code"},{"title":"Stacks and GitOps","tag":"Experimental","href":"/stacks"}]},{"group":"Beta and experimental","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/flask.svg","pages":[{"title":"AI assistant integration: levelrail-mcp","tag":"Beta","href":"/ai-assistant"},{"title":"MCP tools, token budget and write mode","tag":"Beta","href":"/mcp"},{"title":"Connect an AI assistant safely","href":"/mcp-safe-setup"},{"title":"MCP recipes","tag":"Beta","href":"/mcp-recipes"},{"title":"In-app AI assistant chat","tag":"Experimental","href":"/ai-assistant-chat"},{"title":"AI models","tag":"Experimental","href":"/ai-models"},{"title":"Load balancing across replicas","tag":"Experimental","href":"/load-balancing"},{"title":"Leave anytime","sidebarTitle":"Leave anytime","href":"/leave-anytime"},{"title":"Resource advisor (beta)","tag":"Beta","href":"/resource-advisor"},{"title":"Cloud connections (preview)","href":"/cloud-connections"},{"title":"CLI console (beta)","tag":"Beta","href":"/cli-console"},{"title":"Feature flags","href":"/feature-flags"},{"title":"Log archive","tag":"Beta","href":"/log-archive"},{"title":"Automatic cleanup","tag":"Beta","href":"/janitor"},{"title":"Cleanup center","tag":"Beta","href":"/cleanup-center"},{"title":"Unified search","tag":"Beta","href":"/search"}]}]},{"tab":"Reference","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/code.svg","pages":[{"title":"Reference","href":"/app-spec-reference"}]},{"tab":"Concepts","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/lightbulb.svg","pages":[{"title":"Concepts","href":"/product-tour"}]},{"tab":"Self-host gallery","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/squares-four.svg","pages":[{"title":"Self-host gallery","href":"/self-host"}]},{"tab":"Appendix","icon":"https://mintlify.s3.us-west-1.amazonaws.com/levelrail/assets/icons/books.svg","pages":[{"title":"Appendix","href":"/roadmap"}]}]},"basePath":"","title":"Migrating a service from Cloud Run - Levelrail","buildId":"dpl_G2Qd45vZZ7MkBiGF9yYx8ZsbbKXX","deploymentId":"dpl_G2Qd45vZZ7MkBiGF9yYx8ZsbbKXX","dynamics":[],"chunks":[]}