An example repository for python microservice with k8s
Isolate the dependencies using the python virtual environment.
python -m venv .venv
source .venv/bin/activate
Building the docker image
docker build -t webapp:1.0 .
docker run -d -p 5000:5000 --name web webapp:1.0 # to start
kubectl apply -f deployment.yml
kubectl apply -f service.yml
kubectl get pods
kubectl get service # http://localhost:30180/
To stop all the services in the directory
kubectl delete -f .
To get the service url
kubectl get pod && kubectl get service # k get pod,service
minikube service web-service
cd src && python app.py
MIT © Murshid Azher.