Skip to content

Commit 48f585c

Browse files
Merge pull request #42 from devdattakulkarni/minikube-steps
Added steps to use minikube.
2 parents 676e02f + 50b9844 commit 48f585c

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apiVersion: apps/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: greetings-deployment
5+
labels:
6+
app: greetings
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: greetings
12+
template:
13+
metadata:
14+
labels:
15+
app: greetings
16+
spec:
17+
containers:
18+
- name: greetings1
19+
image: greetings:v3
20+
ports:
21+
- containerPort: 5000
22+
env:
23+
- name: "PASSWORD"
24+
value: testpass123!@#
25+
- name: "DB"
26+
value: testdb
27+
- name: "HOST"
28+
value: 35.193.11.106
29+
- name: "USER"
30+
value: root
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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

Comments
 (0)