Working with Kubernetes

While running a production Kubernetes cluster may be a daunting job, developing applications to run under Kubernetes can put your code online with greater ease and with fewer problems than with earlier technologies.

This framework was designed for Kubernetes from the start. Here’s what you need to know.

Setting up a local dev environment

Install docker (desktop for Mac or Linux/Ubuntu) and enable kubernetes; if you’re on a Mac install homebrew to use the Makefiles provided by repos in this framework. Install helm to deploy into kubernetes.

Linux setup is beyond scope of this doc. Check out MicroK8s or Minikube, or set up an account at any of the cloud infrastructure providers.

Terminology and Concepts

Kubernetes and this framework embody an overall concept called the 12-factor App. While it may be hard to remember the full list of 12 buzzwords, a short summary is that each change you make to the source code and commit to a git repository should be sent to production seamlessly, with sufficient automatic checks to give increasing reliability and confidence over time.

Term Explanation
deployment a set of 1 or more pods running the same container
dockerfile a container definition (see reference)
helm chart the packaging standard for kubernetes resource definitions
image immutable application code and settings generated by a dockerfile
node a computer or virtual machine that runs k8s pods
pod a single running container
registry an online or local repository specialized for retrieving images
stateful set a special type of deployment with permanent storage attachments

Continuous Delivery

The images and documentation provided in this repo are published to the Internet using a simple and cost-free CI/CD process. You can follow the example here in your own projects: visit the Get started with GitLab documentation and clone this repo for an example .gitlab-ci.yml.