Git Product home page Git Product logo

zalando-deploy-cli's Introduction

Zalando Deploy CLI

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

zalando-deploy-cli's People

Contributors

hjacobs avatar rafaelcaricio avatar

Stargazers

Balint Deak avatar GAURAV avatar Luke Cavanagh avatar

Watchers

Robin Wittler avatar

Forkers

hjacobs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.