Skip to main content

Google Kubernetes Engine

Configure GKE cluster with kubectl

After creating a GKE cluster, we can configure kubectl to interact with the GKE cluster using:

GKE_CLUSTER_NAME=kgal-gke-cluster
GCP_PROJECT=kgal-dev
GCP_REGION=us-east4

gcloud container clusters get-credentials $GKE_CLUSTER_NAME --region $GCP_REGION --project $GCP_PROJECT

This will append a new user, context and cluster to ~/.kube/config.

Configure Ingress

kubectl create clusterrolebinding cluster-admin-binding \
--clusterrole cluster-admin \
--user $(gcloud config get-value account)
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.1/deploy/static/provider/cloud/deploy.yaml

See this for more info.