Skip to content

Commit

Permalink
Merge pull request #42 from devdattakulkarni/minikube-steps
Browse files Browse the repository at this point in the history
Added steps to use minikube.
  • Loading branch information
devdattakulkarni authored Mar 7, 2020
2 parents 676e02f + 50b9844 commit 48f585c
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: greetings-deployment
labels:
app: greetings
spec:
replicas: 1
selector:
matchLabels:
app: greetings
template:
metadata:
labels:
app: greetings
spec:
containers:
- name: greetings1
image: greetings:v3
ports:
- containerPort: 5000
env:
- name: "PASSWORD"
value: testpass123!@#
- name: "DB"
value: testdb
- name: "HOST"
value: 35.193.11.106
- name: "USER"
value: root
50 changes: 50 additions & 0 deletions Containers/Kubernetes-examples/GCP/steps-minikube.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

1. Download Minikube
- https://kubernetes.io/docs/tasks/tools/install-minikube/


2. Connect your docker cli to the Docker daemon running inside Minikube VM
- eval $(minikube docker-env)

3. Minikube cluster
- minikube start --memory 4096

4. Build docker image for your application
- You can name it greetings -- no need to include the repository name in the image name
since you are going to deploy the image on the local minikube cluster.

5. Update the greetings-deployment-minikube.yaml with the image name
- Also, make sure that the env section in the yaml file contains
the appropriate values for the Gcloud SQL instance that you have spun up.

6. Deploy the application
- kubectl apply -f greetings-deployment-minikube.yaml

7. Expose the application
- kubectl apply -f greetings-service.yaml
The service is of type NodePort. This will cause a random port on the Minikube VM
to be exposed on the VM and reachale from outside world.
You can check the port number that is exposed by using following command:
- kubectl get service

8. Access the application
- For this you need to first find out the minikube VM's IP address and then you will
be able to access the application at the port that has been exposed available as
output of step 7.

9. Get the minikube VM's ip address:
- minikube ip

10. Access the application:
In the browser go to the following location:
http://<MINIKUBE_IP>:<exposed port>

11. Modify the code.

12. Rebuild the local image
- You can keep the image name as same, or you can change it.
Both should work. If you change the image name then make sure that you
modify the yaml file with the new image name.

13. Redeploy the application
- kubectl apply -f greetings-deployment-minikube.yaml

0 comments on commit 48f585c

Please sign in to comment.