/thesis

Source code and related resources for my thesis.

Primary LanguageGo

Upgrading HA Kubernetes clusters

This repository contains the source code and related resources for my thesis titled as "Upgrading HA (highly available) Kubernetes clusters".

The project builds upon earlier work I did for Banzai Cloud. Specifically, I have applied my knowledge about the topic, which I accumulated during the research I did for that project, and some of the final processes explained here (Web Archive link).

Tech stack

The project is built using the Go programming language and relies heavily on Temporal for resilient workflow execution.

For brevity, the project only supports Kubernetes clusters running on AWS (more specifically, EKS clusters), but a significant part of the upgrade flow is vendor agnostic, so adding support for other cloud providers is relatively easy.

Architecture

TBD

Setup

For an optimal developer experience, it is recommended to install Nix and direnv.

Installing Nix and direnv

Note: These are instructions that SHOULD work in most cases. Consult the links above for the official instructions for your OS.

Install Nix:

sh <(curl -L https://nixos.org/nix/install) --daemon

Consult the installation instructions to install direnv using your package manager.

On MacOS:

brew install direnv

Install from binary builds:

curl -sfL https://direnv.net/install.sh | bash

The last step is to configure your shell to use direnv. For example for bash, add the following lines at the end of your ~/.bashrc:

eval "\$(direnv hook bash)"

Then restart the shell.

For other shells, see https://direnv.net/docs/hook.html.

MacOS specific instructions

Nix may stop working after a MacOS upgrade. If it does, follow these instructions.


Start the Temporal server:

docker-compose up -d

Check if Temporal is accessible:

tctl namespace list

Start the worker (in a separate shell):

task run --watch

Usage

The primary purpose of the project is to demonstrate Kubernetes cluster upgrades on EKS.

That however requires a running EKS cluster.

Creating one manually is possible by following this document.

It's much easier to use the provided Temporal workflow:

tctl wf start --tq thesis --wt "CreateCluster" --if examples/cluster.json

Note

Make sure the global account prerequisites described here are met.

Similarly, you can also delete a cluster using the following command:

tctl wf start --tq thesis --wt "DeleteCluster" --if examples/cluster.json

To update a cluster, use the following command:

tctl wf start --tq thesis --wt "UpdateNodeGroup" --if examples/update.json