All labs are stored in a separate Github repository – k8s-guide-labs
In order to interact with the lab, the following set of tools need to be pre-installed:
containerd
runtime. This is what you get by default when you install docker-ce.A number of additional tools (e.g. kind) will be installed automatically during the Setup phase
Some optional extras that may make your life a lot easier:
Installation instructions will depend on the operating system. Here’s an example bash bootstrap script for Ubuntu 20.4 LTS x86_64.
The main supported operating system is Linux. The kernel version can be anything that’s >=4.19
.
Most of the things should also be supported on Darwin. If you find a discrepancy and know how to fix it, please submit a PR.
Clone the k8s-guide-labs repository:
git clone https://github.com/networkop/k8s-guide-labs.git && cd k8s-guide-labs
To view the list of available operations do:
$ make
check Check prerequisites
setup Setup the lab environment
up Bring up the cluster
connect Connect to Weave Scope
tshoot Connect to the troubleshooting pod
reset Reset k8s cluster
down Shutdown
cleanup Destroy the lab environment
Check and install the required prerequisites:
$ make check
all good
Setup the lab environment with:
make setup
Finally, bootstrap the cluster with Flux:
make up
All labs are built in GitOps style using Flux as the controller that manages the state of the cluster.
The lab consists of a local Kubernetes cluster along with a caching pull-through Docker registry to speed up download times. The cluster is built with kind and the caching registry is a standalone container running alongside of it.
To build the cluster for the first time run:
make up
In order to stop the cluster (e.g. to free up resources) run:
make down
In order to rebuild the cluster (combined up
and down
) run:
make reset
To completely destroy the lab environment, including the caching registry run:
make cleanup
The lab cluster is setup with a couple of applications that will be used throughout this guide:
To connect to Weave Scope’s front-end, run make connect
and go to http://localhost:8080
To connect to a Pod running on a particular Node (e.g. k8s-guide-worker), run NODE=k8s-guide-worker make tshoot