Skip to main content

No project description provided

Project description

Build Status Code Coverage PyPI Downloads Latest PyPI version License

This CLI provides an opinionated, high-level wrapper for the “Autobahn” deployment API:

  • It only provides high-level commands

    • Only support what CI/CD pipelines need

    • Low-level access to Kubernetes provided by zkubectl

  • It uses Mustache for templating

    • Familiar to Zalando users: we already use it in Senza

    • Language-agnostic: users could switch to other tools without changing their manifests

Steps required by CI/CD Pipeline

  • Apply stateful resources

    • Cloud Formation templates

    • Kubernetes manifests

    • Should be possible for a whole directory

  • Create Kubernetes deployment

  • Switch “traffic” / scale deployments pod by pod

    • Needs to check pod “readyness”

  • Delete old deployments

  • Scale deployment (manually triggered)

Why another CLI?

The CI/CD pipeline could also call the “Autobahn” deployment API directly, but:

  • CI/CD pipeline (Jenkinsfile) would contain a lot of code and logic to interact with Autobahn API directly

  • Hard to test interaction with Autobahn API without running CI/CD (Jenkins)

  • No standard templating for Kubernetes manifests — first approach relied on another 3rd party tool (sigil)

  • Switching to another CI/CD would require reimplementing logic from Jenkinsfile

Usage

All commands interacting with the “Autobahn” deployment API either need the --execute flag (for immediate approval and execution) or additional calls to approve and execute.

$ sudo pip3 install -U zalando-deploy-cli
$ zdeploy configure \
    --deploy-api=https://deploy-api.example.org \
    --aws-account=aws:7.. \
    --aws-region=eu-central-1 \
    --kubernetes-cluster=aws:7..:kube-1
$ zdeploy apply ./apply/my-service.yaml --execute \
    application=kio version=cd53 release=12
$ zdeploy create-deployment deployment.yaml kio cd53 12 --execute
$ zdeploy wait-for-deployment kio cd53 12
$ zdeploy switch-deployment kio cd53 12 2/10 --execute
$ zdeploy wait-for-deployment kio cd53 12
$ zdeploy switch-deployment kio cd53 12 3/10 --execute
$ # ..
$ zdeploy switch-deployment kio cd53 12 10/10 --execute
$ zdeploy delete-old-deployments kio cd53 12 --execute
$ zdeploy scale-deployment kio cd53 12 15 --execute # manual scaling

You can also just use the Mustache template interpolation manually:

$ zdeploy render-template my-manifest.yaml foo=bar var2=123

Configure for Cluster

You can automatically set Kubernetes Cluster specific configuration using the cluster’s alias:

$ zdeploy configure-for-cluster ALIAS

New configuration:
  aws_account: aws:7..
  kubernetes_api_server: https://kube-1.example.org
  kubernetes_cluster: aws:7..:kube-1

If you don’t have zkubectl configured you also need to provide the Cluster Registry URL:

$ zdeploy configure-for-cluster --cluster-registry-url https://registry.example.org ALIAS

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zalando-deploy-cli-0.32.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

zalando_deploy_cli-0.32-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file zalando-deploy-cli-0.32.tar.gz.

File metadata

File hashes

Hashes for zalando-deploy-cli-0.32.tar.gz
Algorithm Hash digest
SHA256 acc2d0a9b8a2f6dd350f0941a3a796817483c1c57d5e739023e4f56075fb3009
MD5 3962307806f24ba567f25fe4c38f1112
BLAKE2b-256 4c63b68b898fcba7e7096ee331adcec0cd2882f8fe64d150e6985144ec21817e

See more details on using hashes here.

File details

Details for the file zalando_deploy_cli-0.32-py3-none-any.whl.

File metadata

File hashes

Hashes for zalando_deploy_cli-0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 b04c87ce4da3cd064a71b44811efb576012c1ca1001d53c5e4318935bc75c1c9
MD5 6ec7a72de2e0ec2a09dac5b92531d4f6
BLAKE2b-256 1a157ace0c48ac9b74fcc0de22d432b4ac172de4dc115840a9a7794a05e5fc26

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page