https://github.com/framequery/liftoff
Simple split traffic rolling deployments for GCP cloud runs
https://github.com/framequery/liftoff
canary-deployment gcp gcp-cloud-run go-cli
Last synced: about 1 month ago
JSON representation
Simple split traffic rolling deployments for GCP cloud runs
- Host: GitHub
- URL: https://github.com/framequery/liftoff
- Owner: FrameQuery
- License: mit
- Created: 2025-05-13T12:37:59.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-06-04T23:27:56.000Z (9 months ago)
- Last Synced: 2025-07-05T20:49:36.851Z (8 months ago)
- Topics: canary-deployment, gcp, gcp-cloud-run, go-cli
- Language: Go
- Homepage: https://pkg.go.dev/github.com/framequery/liftoff
- Size: 49.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Liftoff
Welcome to Liftoff ๐ Your goโto CLI for multiโregion Cloud Run canary deployments! This README will guide you through installation, configuration, and usage with plenty of examples and emojis to keep things fun ๐.
### ๐ฅ Pre-requisites
This CLI heavily relies on the GCLOUD cli tool. You must have it installed.
If you don't, follow [this guide](https://cloud.google.com/sdk/docs/install)
### ๐ ๏ธ Installation
Make sure you have Go 1.20+ installed and your `GOPATH` configured. Then:
```bash
# Install the CLI
go install github.com/framequery/liftoff/cmd/liftoff@latest
# Verify installation
liftoff --help
```
You can also build from source:
```bash
git clone https://github.com/framequery/liftoff.git
cd liftoff
go build -o liftoff ./cmd/liftoff
```
---
### โ๏ธ Configuration
By default, **liftoff** saves your settings to `$TMP/liftoff_config.json`. You can override options via flags or environment variables.
| Option | Env Var | Description | Default |
| -------------- | -------------------- | -------------------------------------------------------- | ------------------------ |
| `--project` | `LIFTOFF_PROJECT` | GCP project ID | **none** (required) |
| `--service` | `LIFTOFF_SERVICE` | Cloud Run service name | **none** (required) |
| `--image` | `LIFTOFF_IMAGE` | Container image URL for the canary revision | **none** (required) |
| `--regions` | `LIFTOFF_REGIONS` | Commaโseparated GCP regions (e.g. `europe-west2,europe-west4`) | `europe-west2,europe-west4` |
| `--percentages`| `LIFTOFF_PCTS` | Traffic percentages (e.g. `10,50,100`) | `10,50,100` |
| `--intervals` | `LIFTOFF_INTVLS` | Seconds between rollout steps (e.g. `300,300`) | `300,300` |
| `--ingress` | `LIFTOFF_INGRESS` | Kinds of allowed ingress | `internal-only` |
| `--env-vars` | `LIFTOFF_ENV_VARS` | Comma-separated KEY=VALUE pairs | **none** |
---
Once you have **liftoff** installed, here are some example workflows:
### ๐ฏ Default canary rollout
```bash
liftoff canary \
--project=my-gcp-project \
--service=my-service \
--image=gcr.io/my-gcp-project/my-app:canary
```
- Deploys no-traffic revisions in `europe-west2` & `europe-west4`.
- Routes 10% โ wait 5m โ 50% โ wait 5m โ 100%.
### ๐ Custom regions & speed
```bash
liftoff canary \
--project=my-gcp-project \
--service=api-service \
--image=gcr.io/my-gcp-project/api:v2 \
--regions=us-central1,asia-northeast1 \
--percentages=5,25,50,100 \
--intervals=60,120,180
```
- Targets `us-central1` and `asia-northeast1`.
- Gradually shifts traffic 5% โ wait 1m โ 25% โ wait 2m โ 50% โ wait 3m โ 100%.
### ๐ณ Environment variables
```bash
liftoff canary \
--project=my-gcp-project \
--service=api-service \
--image=gcr.io/my-gcp-project/api:v2 \
--regions=us-central1,asia-northeast1 \
--percentages=5,25,50,100 \
--intervals=60,120,180 \
--env-vars=GOOGLE_PROJECT_ID=canary,DEBUG=true"
```
### โก Instant full rollout
```bash
liftoff canary \
--project=my-gcp-project \
--service=static-site \
--image=gcr.io/my-gcp-project/site:latest \
--percentages=100 \
--intervals=0
```
- Skips staging phases and sends 100% traffic immediately.
### โ๏ธ Config & Defaults
```bash
# Save defaults for 'internal-api'
liftoff config set internal-api \
--project=my-gcp-project \
--image=gcr.io/my-gcp-project/internal-api:canary \
--regions=europe-west2,europe-west4 \
--percentages=10,50,100 \
--intervals=300,300
# View all saved configs
liftoff config view
```
- You can set/view default config settings per service video with the config command
---
### ๐ Flags & Commands Reference
```
liftoff --help
```
```
liftoff canary --help
```
Key flags for `canary`:
- `--project, -p` : GCP project ID (required)
- `--service, -s` : Cloud Run service name (required)
- `--image, -i` : Container image URL (required)
- `--regions` : Regions list
- `--percentages` : Traffic split percentages
- `--intervals` : Seconds between shifts
### โค๏ธ Contributing
We โค๏ธ pull requests!
1. Fork โ
2. Create a feature branch ๐ฟ
3. Write tests ๐งช
4. Send PR ๐ฌ
Please follow our [Contributing Guidelines](CONTRIBUTING.md).
---
### ๐ License
[MIT](LICENSE)
Enjoy safe liftoffs! ๐
Made by [Framequery](https://www.framequery.com/)