A playground for getting familiar with Kubernetes. Plan to address the following components:
- Ingress
- Deploy opensource microservices with Helm
- Monitoring with Kubernetes (Metric, Log, Trace)
- Taint & Tolerance
- Deploy own application by writing own Helm Charts
Here is the environment description when I am creating this stack.
- Windows 10
- Ensure WSL2 is installed if you want to follow. You can follow Microsoft's offical documentation for instructions on how to install WSL2.
- Install Docker Desktop for Windows if not already installed.
- For KinD installation, please refer to [#Setup-Instructions] setting
The dependencies like kind
, kubectl
can be installed and spin-up cluster inside WSL2.
- Clone the repository
git clone https://github.com/K-T-Ng/kubernetes-playground.git cd kubernetes-playground
- Install
make
sudo apt-get install make
- Install dependencies (
kind
,kubectl
andhelm
)make install-prerequisite get-helm-charts
- Spin up cluster, this requires some waiting time (based on your network speed, due to pulling images are needed)
make create-cluster make install-common check-common make install-monitor-backend check-monitor-backend
In order to make the Ingress
works (e.g. If you want to access application inside KinD using DNS name rather than IP & Port), you may need to config some DNS settings in Windows 10 side.
The principle of this setting is to fake the local DNS, route FQDN to 127.0.0.1. Then the chain is something like the following:
graph TD;
FQDN_FROM_BROWSER-->LOCAL_DNS-->CONTAINER-->NGINX_INGRESS_CONTROLLER-->SERVICE-->POD;
- You may find the
hosts
setting file inC:\Windows\System32\drivers\etc
. - Open
hosts
file, add the following content.127.0.0.1 grafana.local prometheus.local jaeger.local otel-collector.local
- Save it into somewhere you can access (e.g. Desktop)
- Drag the file to
C:\Windows\System32\drivers\etc
and replace the existinghosts
file. This enable us to access the UI/Endpoint using human readble DNS name.
Delete the KinD cluster by issuing the following command:
make delete-cluster
![./docs/kubernetes-playground.drawio.png]