Skip to content

Commit

Permalink
Add service ui
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriySh committed Dec 24, 2017
1 parent a1dbdb2 commit 6c93889
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1042,20 +1042,18 @@ service "post-db" created
service "post" created

~kubernetes$ kubectl get services -o wide
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
comment ClusterIP 10.103.177.123 <none> 9292/TCP 12m app=reddit,component=comment
comment-db ClusterIP 10.99.107.79 <none> 27017/TCP 12m app=reddit,comment-db=true,component=mongo
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 55m <none>
post ClusterIP 10.110.243.67 <none> 5000/TCP 12m app=reddit,component=post
post-db ClusterIP 10.104.224.229 <none> 27017/TCP 21s app=reddit,component=mongo,post-db=true
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
comment ClusterIP 10.103.177.123 <none> 9292/TCP 28m app=reddit,component=comment
comment-db ClusterIP 10.99.107.79 <none> 27017/TCP 28m app=reddit,comment-db=true,component=mongo
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 1h <none>
post ClusterIP 10.110.243.67 <none> 5000/TCP 28m app=reddit,component=post
post-db ClusterIP 10.104.224.229 <none> 27017/TCP 28m app=reddit,component=mongo,post-db=true
ui NodePort 10.96.169.222 <none> 9292:32092/TCP 28m app=reddit,component=ui
```

- let's check out that `ui` could save posts and comments
```bash
~kubernetes$ kubectl port-forward <ui-pod> 8080:9292
Forwarding from 127.0.0.1:8080 -> 9292
~kubernetes$ minikube service ui
```

- Open URL [http://localhost:8080](http://localhost:8080)

1.3)
18 changes: 18 additions & 0 deletions kubernetes/services/ui-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: v1
kind: Service
metadata:
name: ui
labels:
app: reddit
component: ui
spec:
type: NodePort
ports:
- nodePort: 32092
port: 9292
protocol: TCP
targetPort: 9292
selector:
app: reddit
component: ui

0 comments on commit 6c93889

Please sign in to comment.