This repository is a POC to practice some kubernetes stuff. It contains a simple application with 3 services (alpha, beta and charlie).
- Docker
- Kind
- Kubectl
- Helm
For this POC we will use kind to create a kubernetes cluster. Kind is a tool that allows you to run local kubernetes clusters using docker container “nodes”. It is a great tool to test your kubernetes configuration.
export KIND_CLUSTER=poc-kube-practice-stuff
kind create cluster --name=$KIND_CLUSTER --config=./kind/cluster.yml
The alpha service is a simple web application that displays a sentences made of one noun and one adjective. The beta service is a simple web application that return a random adjectives. The charlie service is a simple web application that return a random noun.
Build docker images and add them in the kind cluster registry to simplify deployment
for service in alpha beta charlie; do docker build -t leofvo/$service:1.0.0 ./apps/$service && kind load docker-image leofvo/$service:1.0.0 -n $KIND_CLUSTER; done
Deploy the application in the kubernetes cluster
kubectl apply -f ./k8s
Now you can create a port-forward to the alpha service to access the application from your browser.
kubectl port-forward service/alpha-service 8080:80
The application is now available on http://localhost:8080