Spin up a basic deployment and service serving a basic hello world node app
- Download and install Docker for desktop: https://www.docker.com/products/docker-desktop/
- Under the dashboard settings for Docker for desktop, select Kubernetes and check the enable Kubernetes box
- From the Kubernetes section of the application drop down, ensure
docker-desktop
is selected
If on MacOS:
brew install kubectl
Or install from binary:
- Download the release based on your OS and Arch here: https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/
- Make the binary executable with:
chmod +x ./kubectl
- Move the binary to a location on your system PATH
sudo mv ./kubectl /usr/local/bin/kubectl sudo chown root: /usr/local/bin/kubectl
Verify the cli is installed by running kubectl get pods -A
Basic configs are provided in the starter folder if you want a jumping off point. Or if you prefer you can try making the manifests from scratch!
There is a provided Dockerfile built and pushed to Dockerhub you can use which just logs and echoes back the path you send to the server. The image is mitchhamm/kubernetes-workshop:1.0.0
Upon creating the resources correctly, visiting localhost:<service-port>
should give you a hello world prompt followed by the path you specified.
If you've got the application running locally on kubernetes successfully, try increasing the replica count on the deployment to spin up more pods. From here you can grab logs from each of the pods to see that the requests are actually being routed to different pods each time to spread the load across the pods