/kubernetes-tool-comparison

Demonstration showing how to deploy the K8s guestbook example using a variety of deployment tools.

Primary LanguageShellMIT LicenseMIT

K8s Tool Comparison

Build Status

This repository shows how to deploy the K8s guestbook example using a variety of deployment tools. For more details on the example check out the tutorial in the K8s docs.

Table of Contents

Use Case

guestbook.yaml contains the vanilla guestbook Kubernetes manifest, defining the following resources:

  • redis-master (Service, Deployment)
  • redis-slave (Service, Deployment)
  • frontend (Service, Deployment)

They can be deployed using:

kubectl apply -f guestbook.yaml

Now let us pretend we want do deploy all of these resources several times. In our example we need two completely separate installations of the whole stack, one for cats and one for dogs. Furthermore, as it is well known that cats are better conversationalists, we expect a higher load there and would like to give the respective redis-slave twice the resource requests.

Another natural reason for this duplication could be a deployment pipeline with promotion across stages like dev, staging and prod, where one also might prefer e.g. different resource requests or replica counts to save on resources for the earlier stages.

Tools

kubectl

kubectl is the included CLI of all Kubernetes clusters, supporting declarative deployments using YAML-based Kubernetes manifests.

There is not much more to do than manually duplicate everything when using plain kubectl:

kubectl apply -f kubectl/cats-guestbook.yaml
kubectl apply -f kubectl/dogs-guestbook.yaml

Note that the two files are very similar but not exactly the same. It is quite easy to see how a setup like this is not very maintainable.

Helm

Helm is a package manager for Kubernetes. Reusable pieces are packaged in Charts that can be customized during installation with values that are templated into the Kubernetes manifests.

helm install -f helm/cats.yaml helm/guestbook
helm install -f helm/dogs.yaml helm/guestbook