Deploy a Machine Learning model (Miniature GPT with movie reviews dataset) with Docker, Kubernetes, Flask API.
- Create a hub on Docker - https://hub.docker.com/ (As of current version, Kubernetes will take public image. )
- Login to docker
docker login
- Build Docker image (current port is 5002).
docker build -t tagname
docker push image:tagname
- In deployment.yaml, rename image (line 32) with the image name from your Docker Hub.
Optional: To have Docker image exits and removes itself, rundocker run -rm <IMAGE_NAME>
- Run kubernetes
kubectl create -f deployment.yaml
kubectl apply -f deployment.yaml
(this will trigger deployment and load balancer) - Run minikube
minikube start
minikube service list
(get the list of current service. get the service running your name)
minikube service <SERVICE_NAME>
- Test the API with Postman
- Connect Kubernetes with private Docker image
- Add CI/CD
- Add monitoring