Skip to content

Commit 7829c10

Browse files
authored
Update README.md
1 parent 2bc7f83 commit 7829c10

File tree

1 file changed

+3
-26
lines changed
  • kubernetes/beginners/workshop/lab00-running-nginx-pod

1 file changed

+3
-26
lines changed

kubernetes/beginners/workshop/lab00-running-nginx-pod/README.md

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -134,39 +134,16 @@ kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 2d
134134
nginx ClusterIP 10.105.96.0 <none> 80/TCP 20h
135135
```
136136

137-
## Exposing your pods to the internet
137+
## Accessing it through localhost
138138

139139
```
140-
Ajeets-MacBook-Air:~ ajeetraina$ kubectl expose deployment my-nginx --port=80
141-
service "my-nginx" exposed
142-
Ajeets-MacBook-Air:~ ajeetraina$ kubectl get services
143-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
144-
example-service NodePort 10.106.252.68 <none> 8080:31477/TCP 19h
145-
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 2d
146-
my-nginx ClusterIP 10.101.119.153 <none> 80/TCP 4s
140+
IP=$(kubectl get svc my-nginx -o go-template --template '{{ .spec.clusterIP }}')
147141
```
148142

149-
## Introspection
150-
151143
```
152-
[node1 lab01-creating-nginx-pod]$ kubectl get pods
153-
NAME READY STATUS RESTARTS AGE
154-
my-nginx-7b64f649-258lb 1/1 Running 0 8m43s
155-
my-nginx-7b64f649-8zcdr 1/1 Running 0 8m43s
144+
curl $IP:80
156145
```
157146

158-
```
159-
[node1 lab01-creating-nginx-pod]$ kubectl get services
160-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
161-
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 33m
162-
my-nginx ClusterIP 10.106.231.19 <none> 80/TCP 4m47s
163-
```
164-
165-
```
166-
[node1 lab01-creating-nginx-pod]$ kubectl get deployments
167-
NAME READY UP-TO-DATE AVAILABLE AGE
168-
my-nginx 2/2 2 2 8m45s
169-
```
170147

171148
## Cleaning Up
172149

0 commit comments

Comments
 (0)