|
| 1 | + |
| 2 | +1. Download Minikube |
| 3 | + - https://kubernetes.io/docs/tasks/tools/install-minikube/ |
| 4 | + |
| 5 | + |
| 6 | +2. Connect your docker cli to the Docker daemon running inside Minikube VM |
| 7 | + - eval $(minikube docker-env) |
| 8 | + |
| 9 | +3. Minikube cluster |
| 10 | + - minikube start --memory 4096 |
| 11 | + |
| 12 | +4. Build docker image for your application |
| 13 | + - You can name it greetings -- no need to include the repository name in the image name |
| 14 | + since you are going to deploy the image on the local minikube cluster. |
| 15 | + |
| 16 | +5. Update the greetings-deployment-minikube.yaml with the image name |
| 17 | + - Also, make sure that the env section in the yaml file contains |
| 18 | + the appropriate values for the Gcloud SQL instance that you have spun up. |
| 19 | + |
| 20 | +6. Deploy the application |
| 21 | + - kubectl apply -f greetings-deployment-minikube.yaml |
| 22 | + |
| 23 | +7. Expose the application |
| 24 | + - kubectl apply -f greetings-service.yaml |
| 25 | + The service is of type NodePort. This will cause a random port on the Minikube VM |
| 26 | + to be exposed on the VM and reachale from outside world. |
| 27 | + You can check the port number that is exposed by using following command: |
| 28 | + - kubectl get service |
| 29 | + |
| 30 | +8. Access the application |
| 31 | + - For this you need to first find out the minikube VM's IP address and then you will |
| 32 | + be able to access the application at the port that has been exposed available as |
| 33 | + output of step 7. |
| 34 | + |
| 35 | +9. Get the minikube VM's ip address: |
| 36 | + - minikube ip |
| 37 | + |
| 38 | +10. Access the application: |
| 39 | + In the browser go to the following location: |
| 40 | + http://<MINIKUBE_IP>:<exposed port> |
| 41 | + |
| 42 | +11. Modify the code. |
| 43 | + |
| 44 | +12. Rebuild the local image |
| 45 | + - You can keep the image name as same, or you can change it. |
| 46 | + Both should work. If you change the image name then make sure that you |
| 47 | + modify the yaml file with the new image name. |
| 48 | + |
| 49 | +13. Redeploy the application |
| 50 | + - kubectl apply -f greetings-deployment-minikube.yaml |
0 commit comments