Git Product home page Git Product logo

ship-it's Introduction

Ship it! Build Status Go Report Card

Ship it! is Wattpad's tool for continuous deployment to Kubernetes.

The technical background and architecture of Ship-it can be found in the overview documentation here

Operations

Continuous Deployment

Ship-it watches HelmRelease custom resources in the namespace in which it is deployed. Whenever a HelmRelease resource is created/updated/destroyed, Ship-it performs the appropriate install/upgrade/delete Helm operation on the associated Helm release.

An example of a minimal HelmRelease definition:

apiVersion: shipit.wattpad.com/v1beta1
kind: HelmRelease
metadata:
  name: my-release-name
  annotations:
    helmreleases.shipit.wattpad.com/autodeploy: "true"
spec:
  releaseName: my-release-name

  chart:
    repository: my-chart-repository
    name: my-chart-name
    version: my-chart-version

  values: {}

As a quick overview, there are 4 important sections to take note of.

  • metadata.annotations enrich the HelmRelease with additional information. Annotations are always optional, however the HelmRelease will not autodeploy as the default is false. All annotations recognized by Ship-it are prefixed by helmreleases.shipit.wattpad.com/
Annotation Description Default Value
autodeploy Toggle auto-deployment of the release "false"
code Source code URL ""
datadog Datadog dashboard URL ""
squad Squad owner of the release ""
slack Slack channel of the owner ""
sumologic Sumologic query URL of the release ""
  • spec.releaseName defines the desired name of the Helm release

  • spec.chart provides the desired chart name and version

  • spec.values provides the desired chart values. In this example the service does not provide any overriding values for the chart, however the field is still explicitly required

A much more thorough documentation of the HelmRelease custom resource can be found in the resource definition, or by kubectl describe crd/helmreleases.shipit.wattpadhq.com in a cluster namespace where the CRD exists.

Automatic Rollback

Ship-it initially has limited support for automatic rollbacks. When a Helm release enters the FAILED state, Ship-it will perform a Helm rollback operation to the most recent successful release version. Most often, this will be the immediately previous release version.

Developers should take note that a FAILED Helm release is caused by deployment errors, not application runtime errors. Some non-exhaustive examples are: incomplete chart values or corrupted manifests produced by invalid templates, failure to create resources in the desired namespace, or tiller internal error. A Helm release will not fail because a Pod crashes after its deployment is successfully rolled out.

In the future, we plan to add support for more advanced rollback strategies such as rollbacks triggered by failing liveness/readiness health probes or developer defined conditional expressions on service metrics.

Local Development

This project uses kind for local development and testing. To get started, you'll need to install these tools to your development machine:

  1. Create a new kind cluster
$ make kind-up
  1. Update kubectl's cluster context
$ export KUBECONFIG=$(kind get kubeconfig-path --name="ship-it-dev")
$ kubectl config current-context
kubernetes-admin@ship-it-dev
  1. Build local images
$ TARGET=ship-it-api make build
$ TARGET=ship-it-syncd make build
$ cd operator && make docker-build
  1. Deploy local ship-it images
$ make kind-deploy
  1. Connect to the service's node port (check the chart values)
curl -i http://localhost:31901/api/releases

or

open http://localhost:31901
  1. Destroy cluster when finished
make kind-down

ship-it's People

Contributors

cfmtam avatar crdueck avatar dependabot[bot] avatar jrhouston avatar rashadsookram avatar tomyanz avatar yfatmah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

vietwow

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.