Sample Django application deployed with Kubernetes
- Build app image
docker build -t kubernetes-django .
- Create deployment
kubectl apply -f deployment.yml
- Expose service
kubectl expose deploy kubernetes-django-deployment --type=NodePort
- Get mapped port for the app
kubectl get service
- Visit
http://localhost:<PORT>
in the browser.
- Make changes in to the app
docker build -t kubernetes-django:v2 .
- Update image at the
deployment.yml
filespec.template.spec.containers.image
to thekubernetes-django:v2
kubectl apply -f deployment.yml
- App should be updated to the new version now.