Created 3 node GKE cluster.
From cmd prompt local logged into gcloud.
apiVersion: v1
kind: Pod
metadata:
name: basicpod
labels:
type: webserver
spec:
containers:
- name: webcont
image: nginx
ports:
- containerPort: 80
curl http://<pod-ip>
but getting timeout. my question is why iam getting timeout ? the same curl command work if execute inside pod. like kubectl exec -it basicpod -- /bin/sh and then inside pod execute curl http://<pod-ip>
<br>
GKE cluster details: <br>
Networking <br>
Private cluster Disabled
Network default
Subnet default
VPC-native traffic routing Disabled
Cluster pod address range (default) X.X.X.X/X
Service address range X.X.X.X/X
Intranode visibility Disabled
NodeLocal DNSCache Disabled
HTTP Load Balancing Enabled
Subsetting for L4 Internal Load Balancers Disabled
Control plane authorized networks
Disabled
Network policy Disabled
Dataplane V2 Disabled
Security <br>
Binary authorization Disabled
Shielded GKE nodes Enabled
Confidential GKE Nodes Beta Disabled
Application-layer secrets encryption Disabled
Workload Identity Disabled
Google Groups for RBAC Disabled
Legacy authorization Disabled
Basic authentication
Disabled
Client certificate DisabledCurling from inside cluster should work, curling from outside (browser as an example) you need to make sure firewalls are set up. + you need to expose the service through a LB as an example
Curling inside the cluster it works. create service and expose it then do curl it works fine.
apiVersion: v1
kind: Service
metadata:
name: basicpod-svc
spec:
selector:
type: webserver
type: LoadBalancer
ports:
- nodePort:
port: 80
targetPort: 80