Tl;dr: A simple hello world
example to get started with Kubernetes.
Download Docker for Mac at https://docs.docker.com/docker-for-mac/install/. Install Docker Desktop and enable Kubernetes.
Clone the codebase from this repository.
cd app
pip install -r requirements.txt
python main.py
In the app/
directory, build the docker image with the following command
docker build -f ../docker/Dockerfile -t hello-api:latest .
To verify if image was created, run the following command:
docker image ls
docker run -p 3050:3000 hello-api
Now navigate to http://localhost:3050
to see the message.
What is my current context point to?
kubectl config current-context
Use kubectl
to send the YAML file to Kubernetes by running the following command:
kubectl apply -f deployment.yaml
To verify the pods are running, execute the following command:
kubectl get pods