You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement GCP Google Kubernetes Engine GKE NodePort Service
Step-00: Pre-requisites
Verify if GKE Cluster is created
Verify if kubeconfig for kubectl is configured in your local terminal
# Configure kubeconfig for kubectl
gcloud container clusters get-credentials <CLUSTER-NAME> --region <REGION> --project <PROJECT>
# Replace Values CLUSTER-NAME, ZONE, PROJECT
gcloud container clusters get-credentials standard-public-cluster-1 --region us-central1 --project kdaida123
# List GKE Kubernetes Worker Nodes
kubectl get nodes
# List GKE Kubernetes Worker Nodes with -o wide option
kubectl get nodes -o wide
Observation:
1. You should see External-IP Address (Public IP accesible via internet)
2. That is the key thing for testing the Kubernetes NodePort Service on GKE Cluster
# Deploy Kubernetes Manifests
kubectl apply -f kube-manifests
# List Deployments
kubectl get deploy
# List Pods
kubectl get po
# List Services
kubectl get svc
Step-05: Access Application
# List Kubernetes Worker Node with -0 wide
kubectl get nodes -o wide
Observation:
1. Make a note of any one Node External-IP (Public IP Address)
# Access Application
http://<NODE-EXTERNAL-IP>:<NodePort>
http://104.154.52.12:30080
Observation:
1. This should fail
# List Kubernetes Worker Node with -0 wide
kubectl get nodes -o wide
Observation:
1. Make a note of any one Node External-IP (Public IP Address)
# Access Application
http://<NODE-EXTERNAL-IP>:<NodePort>
http://104.154.52.12:30080
Observation:
1. This should Pass
Step-08: Clean-Up
# Delete Kubernetes Resources
kubectl delete-f kube-manifests
# Delete NodePort Service Firewall Rule
gcloud compute firewall-rules delete fw-rule-gke-node-port
# List Firewall Rules
gcloud compute firewall-rules list