Hi ,i have deployed a pod and service… however,i am not able to access it using its ip address in the browser… how to acces it in the browser??do i need to set any proxy… i checked answers in community gorup…but didn’t help. kindly help
Hi,
Please share the lab link, I’ll check it!
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:- containerPort: 80
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 8080
targetPort: 80
type: ClusterIP
,i created a pod and service annd trying to access the pod using viewport -gave 8080…not able to acces in brwoser …why …please help…
Hi @narendra-jatti,
Raymond asked for the playground lab link, not the application access link.
I see you’ve created the ClusterIP service. To access the application through the “viewport”, you need to create a NodePort service and provide the node port for it.
Regards,
++ you can’t access the application through a ClusterIP service directly in the browser because ClusterIP is only accessible within the k8s cluster.
HI Tej,i am using lab only,not playground…can we access in using with playground?
In the post, you’ve mentioned playground.
Anyway, you can access the application in any lab where Kubernetes is installed. Please create the correct service as suggested below.
yes,Tej sorry…it was type…i can access now…thanks for pointing out nodeport mistake…kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 172.20.0.1 443/TCP 4m15s
nginx-service NodePort 172.20.71.120 8080:30007/TCP 7s,i can acces service …by putting 30007 in view port…but can’t access in browser with http://172.20.71.120:30007/..any idea?
That’s a private IP address, not a public.
got it thanks Tej…appreciate

