I am learning GKE services and have created a GKE cluster
with below information
$ gcloud container clusters list
NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS
mycluster us-east1-b 1.14.10-gke.27 35.X.X.X n1-standard-1 1.14.10-gke.27 3 RUNNING
I created my own VPC subnet
with below range which I assigned to the cluster .
IP address range : 10.7.0.0/24
The below secondary IP range was assigned by GKE engine
Secondary IP range
gke-mycluster-pods-765b8f97 10.44.0.0/14
gke-mycluster-services-765b8f97 10.237.0.0/20
After creating the cluster the node information is as follows:
$kubectl get nodes
NAME STATUS ROLES AGE VERSION
gke-mycluster-default-pool-c2ddd83e-km5k Ready <none> 21m v1.14.10-gke.27
gke-mycluster-default-pool-c2ddd83e-trrl Ready <none> 21m v1.14.10-gke.27
gke-mycluster-default-pool-c2ddd83e-x4w3 Ready <none> 21m v1.14.10-gke.27
My deployment YAML is as follows which creates a nginx container:
apiVersion: apps/v1
kind: Deployment
metadata:
name: mywebapp-replicaset
labels:
app: mywebapp
type: front-end
spec:
template:
metadata:
name: myngix-pod
labels:
app: mywebapp
type: front-end
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
replicas: 3
selector:
matchLabels:
type: front-end
Below is my service definition
apiVersion: v1
kind: Service
metadata:
name: mywebapp-services
labels:
app: mywebapp
type: front-end
spec:
type: LoadBalancer
ports:
- targetPort: 80
port: 80
selector:
app: mywebapp
type: front-end
After creating the service using kubectl command , it looks like this
$ kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.237.0.1 <none> 443/TCP 23h
mywebapp-services LoadBalancer 10.237.12.141 <pending> 80:31102/TCP 6s
Now if I try to access the LoadBalancer IP
from Gcloud shell
it is timing out , am I missing something
$ curl http://10.237.12.141:80
curl: (7) Failed to connect to 10.237.12.141 port 80: Connection timed out