Kubernetes Hands-on

Content:

Overview
1. Prepare the environment
2. Deploy ToDo app
3. Deploy MySQL
4. Connect ToDo with MySQL using Environment Variables
5. MySQL with Persistent Volumes
6. Connect ToDo with MySQL using ConfigMap
7. Connect ToDo with MySQL using ConfigMap and Secret
8. Kubernetes Dashboard

Overview

This hands-on lab is building upon the Docker 101 workshop.

In the Docker workshop, a Node.js based ToDo app is packaged as a Container image and then run on Docker, first stand-alone using a built-in database, and then as a multi-container app running MySQL as database in a second container.

Agenda

We will use the information contained in the Docker commands of the Docker 101 workshop to create equivalent Kubernetes configurations.

Building of Container Images is covered in the Docker 101. In this Kubernetes workshop we are using a Container image from my Docker Hub repository, but of course you can use your own.

The instructions in this lab are based on Minikube. They should work – with some modifications – with the Kubernetes that is part of Docker Desktop, with K3d, Kind, or any other Kubernetes distribution. Your mileage may vary …

Prerequisites

All executables must be copied to a location in your PATH.

bwLehrpool: All prerequisites are already installed in the bwLehrpool image.

You may not know stern: it allows you to tail (follow) the logs of multiple pods on Kubernetes and multiple containers within the pod. It keeps displaying the logs when a pod is stopped and restarted. Each result is color coded for quicker debugging.

Labs

The ToDo app we are going to deploy is based on Node.js. It can run “stand-alone” and will use a built in SQLite database then. Or it can be used together with MySQL. During the labs we add more and more Kubernetes features.