I have a cluster created in the GCP cloud having a simple k8s YAML file.
apiVersion: v1
kind: Service
metadata:
name: lb-svc
labels:
app: lb-demo
spec:
type: LoadBalancer
ports:
- port: 8080
selector:
app: np-demo
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: np-deploy
spec:
replicas: 3
selector:
matchLabels:
app: np-demo
template:
metadata:
labels:
app: np-demo
spec:
containers:
- name: np-pod
image: nigelpoulton/k8s-deep-dive:0.1
imagePullPolicy: Always
ports:
- containerPort: 8080
Now; this YAML configuration has a LoadBalancer service which in return exposes an external IP address to the public. thus we can see the external IP address using:
kubectl get svc
The issue is, I can easily access the load balancer using curl within the cloud shell but couldn't reach it when trying to access it from outside (example browser).
Tried:
curl external-ip:8080
Any help?