I have following section in my kubernetes config yml:
kind: Service
apiVersion: v1
metadata:
name: afsa-ui-loadbalancer
labels:
app: afsa-ui
spec:
# type: NodePort
type: LoadBalancer
ports:
- port: 80
targetPort: 80
protocol: TCP
nodePort: 31000
selector:
app: afsa-ui
# ---
I connected to remote debian VM (running on 10.99.1.173, provided by out IT department) using ssh. And started this service on that VM. Kubectl now shows:
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
afsa-ui-9648866b9-dp252 1/1 Running 0 30m
afsa-ui-9648866b9-lcw8m 1/1 Running 0 30m
postgres-6bf6c4d88b-mkjd9 1/1 Running 0 95m
springboot-postgres-k8s-76798d6f6b-l5485 1/1 Running 0 10m
Minikube shows:
~/app/src/main/resources$ minikube service list
|-------------|-------------------------|--------------|---------------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|-------------|-------------------------|--------------|---------------------------|
| default | afsa-ui-loadbalancer | 80 | http://192.168.49.2:31000 |
| default | kubernetes | No node port |
| default | postgres | No node port |
| default | springboot-postgres-k8s | 8080 | http://192.168.49.2:30163 |
| kube-system | kube-dns | No node port |
|-------------|-------------------------|--------------|---------------------------|
But I am unable to access react UI rendered by afsa-ui-loadbalancer at http://10.99.1.173:31000
. I tried port-forwarding as suggested here and here:
$ kubectl port-forward service/afsa-ui-loadbalancer 31001:80
Forwarding from 127.0.0.1:31001 -> 80
Forwarding from [::1]:31001 -> 80
and tried accessing http://10.99.1.173:31001
. But still I am not able to access the UI. What I am missing?