Skip to content

polinchw/devops-extreme-automation-guide

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 

Repository files navigation

devops-extreme-automation-guide

Description

This repo serves as a guide to fully (well, as close to fully as possible) automate building and deploying your microservices. It shows how to combine some great open source tools in a seperation of concerns manner.

This is a list of the most commonly used components involved in building and deploying apps along with links to external repos as examples. If you piece these compoents together you can let automation do most of the heavy lifting when it comes to devops.

Table of Contents

Containerize

Starting with your app you'll want to package it in a way that makes it easy to deploy as a container. This hello-github-webhook is a very basic python app that uses Github Actions to build and push a Docker image to Docker Hub.

Kubernetes Manifests

After the example hello-github-webhook app is containerized we'll want to tell Kubernetes how to deploy it. We want to place the Kubernetes manifests into a seperate git repository as a best practice to set ourselves up for the next building block of our automation (GitOps). This hello-github-webhook-cd repo will tell Kubernetes how to deploy the hello-github-webhook app.

GitOps

GitOps is a strategy of deploying apps to Kubernetes by using Git as the source of truth as to what is deployed. I'll be using ArgoCD as my GitOps solution to deploy the hello-github-webhook app to my Kubernetes cluster. I'll also be using ArgoCD's ApplicationSet to deploy a bunch of cluster add-on apps like Grafana, Cert-Manager, and Prometheus to my cluster.

Once ArgoCD is installed on the cluster it will be in charge of deploying the apps and keeping them in sync with what is in the hello-github-webhook-cd repository.

AutoPilot

ArgoCD can be installed manually if you like, there are lots of examples on how to do that. If you want to up your ArgoCD game and have it automatically install itself along with the apps you want ArgoCD to manage you can do that with ArgoCD AutoPilot. This auto-pilot repo will install the hello-github-webhook-cd manifests along with the Helm charts defined in this cluster-addons repo.

ArgoCD Image Updater

The auto-pilot repo has been configured for this example to use the ArgoCD Image Updater to watch for new releases from hello-github-webhook. The ArgoCD Image Updater will update the hello-github-webhook-cd repo when new docker images are posted to Docker Hub.

Infrastructure as Code

There are about 100 different ways to create a Kubernetes cluster. I've used Kubespray, RKE, individual cloud providers' uis to name a few. For this example I've choosen Terraform. The main reason I choose Terraform is you can tell it to create a Kubernetes cluster and do post install actions against that cluster, like boot strap ArgoCD AutoPilot. I saw combining Terraform with AutoPilot as the holy grail to automating everything with one Terraform command. This terraform repo shows you how to create a Kubernetes cluster on Azure AKS. It builds the cluster, installs ArgoCD Autopilot which will deploy the hello-github-webhook-cd manifests as an ArgoCD mananged app.

Diagram(s)

Sequence!