Skip to content

Windows step-by-step guide to build and deploy a 3-tier app on Kubernetes with CD pipelines

License

Notifications You must be signed in to change notification settings

TomShirley/kavm

Repository files navigation

K8s-App-Vending-Machine (aka KAVM):

Describe an app -> run it locally in k8s -> push it to higher environments

app-vending-machine

What does KAVM do?

🔭 KAVM is a guide to help you setup a 3-tier application running in k8s on your local machine with flux as the CD tooling (for windows-based developers - steps are tailored for windows terminal)

Things to know before you get started

The CD approach to deploying apps will be done with Flux. Read the Flux Git-Ops docs for some context on what it does. The layout of this repo and approach with flux is described in more detail on flux's example repo. We'll be using Microk8s as the platform to install and manage kuberenetes locally.

Why use KAVM?

KAVM is an opinionated approach to platform engineering for microservices, providing a consistent way to release apps into higher enivronments, with the aim of reducing the pain as you increase the number of apps you have (in your vending machine) over time.

For more background on how k8s fits into the overall cloud architecture landscape, see the infoq article: k8s and cloud architectures. See the benefits section if you want to understand more on the value of using k8s with flux.

Get Started

Follow the steps below to build out your own kavm platform with this repo. At the end you'll have a sample 3-tiered .net core and angular application running inside of your local k8s environment, with a hands-off mechanism to deploy your apps through your enterprise k8s environments and into production.

3-tier-app-diagram

Run through each section (steps 1-4) to get everything setup locally on your pc:

  1. Install and configure Windows Terminal: Windows terminal guide
  2. Install microk8s: Microk8s guide
  3. Install and configure Flux: Flux guide
  4. Setup the sample api and ui applications: UI and API app guide

Optionally, if you want to play around with TLS (https) for the sample apps, follow the steps at (TLS guide)

When you've completed the guide, you'll have an Angular microsite: app-ui

that does api calls to your deployed .net 5 API microservice: api

Local Development

To create a new app, create your app under the apps directory and follow the guide on how to (setup flux to deploy your app)

Notes

If you're not on windows this guide won't be applicable in places. But most should work since powershell core is cross-platform.