I created web applications(visual studio code - asp.net core) which ran successfully on docker and then I exposed these applications with the following commands in ubuntu terminal:
(1) kubectl expose deployment websa-node --name=websa-node --type=LoadBalancer --port=80
(2) kubectl expose deployment websc-node --name=websc-node --type=LoadBalancer --port=3030
(copied and pasted 0.0.0.0:3030 in chrome after running it in docker)
The results on chrome which I started the services for both of these applications are:
(1) http://192.168.99.100:30235
(2) http://192.168.99.100:32632
Neither ip addresses mentions the port I used to expose the applications with, how is that possible?
kubectl get all -o wide output:
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod/kubernetes-bootcamp-69fbc6f4cf-czm8w 0/1 Error 11 32d <none> minikube <none> <none>
pod/weba-node-7496f9496d-tnftl 0/1 Completed 15 41d <none> minikube <none> <none>
pod/weba1-node-55764787cb-z6q9x 0/1 ContainerCreating 0 18d <none> minikube <none> <none>
pod/webc-node-56874984f9-tcf4m 0/1 ContainerCreating 0 15d <none> minikube <none> <none>
pod/websa-node-7f967b8b8b-k7gmf 0/1 ContainerCreating 0 13m <none> minikube <none> <none>
pod/websc-node-768686c85b-hn8qh 0/1 ContainerCreating 0 13m <none> minikube <none> <none>
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 196d <none>
service/kubernetes-bootcamp NodePort 10.98.39.22 <none> 8080:31744/TCP 31d app=kubernetes-bootcamp
service/weba-1node NodePort 10.107.139.153 <none> 7070:32478/TCP 18d app=weba1-node
service/weba-node NodePort 10.102.89.241 <none> 5010:31187/TCP 41d app=weba-node
service/webc-node LoadBalancer 10.106.96.209 <pending> 8080:32534/TCP 15d app=webc-node
service/websa-node LoadBalancer 10.106.237.178 <pending> 80:30235/TCP 13m app=websa-node
service/websc-node LoadBalancer 10.110.89.87 <pending> 3030:32632/TCP 13m app=websc-node
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
deployment.apps/kubernetes-bootcamp 1/1 1 1 32d kubernetes-bootcamp gcr.io/google-samples/kubernetes-bootcamp:v1 app=kubernetes-bootcamp
deployment.apps/weba-node 1/1 1 1 41d weba docker.io/lincdoc01/weba app=weba-node
deployment.apps/weba1-node 0/1 1 0 18d weba weba app=weba1-node
deployment.apps/webc-node 0/1 1 0 15d webapp webc/webapp app=webc-node
deployment.apps/websa-node 0/1 1 0 14m websa websa app=websa-node
deployment.apps/websc-node 0/1 1 0 14m websc websc app=websc-node
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
replicaset.apps/kubernetes-bootcamp-69fbc6f4cf 1 1 1 32d kubernetes-bootcamp gcr.io/google-samples/kubernetes-bootcamp:v1 app=kubernetes-bootcamp,pod-template-hash=69fbc6f4cf
replicaset.apps/weba-node-7496f9496d 1 1 1 41d weba docker.io/lincdoc01/weba app=weba-node,pod-template-hash=7496f9496d
replicaset.apps/weba1-node-55764787cb 1 1 0 18d weba weba app=weba1-node,pod-template-hash=55764787cb
replicaset.apps/webc-node-56874984f9 1 1 0 15d webapp webc/webapp app=webc-node,pod-template-hash=56874984f9
replicaset.apps/websa-node-7f967b8b8b 1 1 0 13m websa websa app=websa-node,pod-template-hash=7f967b8b8b
replicaset.apps/websc-node-768686c85b 1 1 0 13m websc websc app=websc-node,pod-template-hash=768686c85b
minikube ip:
192.168.99.100