FireHydrant needs to make sure our deploys are consistent ▸ 80% of the time an incident opens, it’s due to a deploy of bad code (based on 3rd party research) ▸ If things do break, we need a quick way to mitigate either by rolling back or forward ▸ Having a reliable deployment pipeline is critical for us
usually YAML) ▸ Describe the desired state of your Kubernetes cluster apiVersion: apps/v1 kind: Deployment metadata: name: rails namespace: laddertruck labels: owner: infra spec: replicas: 20 strategy: type: RollingUpdate
the “workloads” API in Kubernetes ▸ The Kubernetes deployment object is a “wrapper” of sorts ▸ It controls the creation of replica sets, which control the creation of pods ▸ ReplicaSet’s created have an ownership ref on them https://thenewstack.io/kubernetes-deployments-work/
all “controllers” ▸ These object types will maintain a history of revisions. ▸ Revisions are only created when you modify the PodSpec portion of your deploy (updating the image, env vars, volumes, etc) ▸ Revisions are stored depending on the revisionHistoryLimit parameter
HONESTLY ▸ A simple kubectl command from Jenkins could look like: kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.9.1 ▸ Then wait for it to finish * $ kubectl wait -n laddertruck deploy/rails --for condition=available deployment.extensions/rails condition met * This won’t catch pods that didn’t actually come online
do everything you need for a continuous deployment process ▸ Deploys, Rollbacks, Scale ups, Advanced Pipelines ▸ Authentication ▸ Web UI ▸ So. Many. Things.
▸ Spinnaker is a completely new tool that your engineering team will have to learn in order to deploy ▸ It’s very complicated to setup and run effectively (especially across multiple environments) ▸ Configuration is difficult to keep as code ▸ You will need a dedicated team of at least 2 people to install and get it going for your organization in a timely fashion ▸ If you’re still interested, check out armory.io - They’re a managed Spinnaker consultancy and super smart folks
git repository containing your configuration ▸ Can watch a Docker registry for new images and apply the changes ▸ Can deploy any k8s object (CRD, Deployments, CronJobs, etc)
all of our Kubernetes manifests in repo called “k8s- manifests” ▸ We separate environments with a folder ▸ Folders for the separate applications and related manifest files
tests, builds a Docker image and pushes it to Google Container Registry (GCR) ‣ Tags are formatted as us.gcr.io/infrastructure-58ca87ae/ laddertruck:staging-123517023ede043c0d1987c106b822d9ac0ef26a ‣ Name of the branch and commit SHA ‣ Flux is looking for new images that match a pattern in our registry it doesn’t know about ‣ If a new image is pushed that matches, Flux clones and updates our GitHub repository of Kubernetes objects (YAML files) ‣ It then applies the change to the cluster it is running on K8S
objects to perform it’s deployment operations ▸ For example, we inform Flux which images we care about by using the annotation: flux.weave.works/tag.rails: glob:master-* ▸ Any images that match this pattern on the registry will be registered for a deployment in Flux ‣ us.gcr.io/infrastructure-58ca87ae/ laddertruck:master-123517023ede043c0d1987c106b822d9ac0ef26a
“flux.weave.works/tag.rails” maps to the container “rails” in our pod specification ▸ This is how Weave knows which container in the PodSpec it needs to update