where have created a cluster "cluster-1", in this post, we will connect with GKE cluster from local machine and do some work.
gcloud auth login
This command will open your Gmail account in the browser window where you have to provide your credentials to access the GKE cluster. Remember you have to provide the same credentials which have created the GKE cluster.
Now, you can run all the commands from the local machine whatever you can run from gcloud inbuili shell. But I prefer to use inbuilt cloud shell as it supports the linux command. Anyway, Use whatever suits you better.
I am assuming you are using local Cloud Shell, In my case, It is Windows, Beware of the commands as variable declaration and usage are differ from OS to OS.
gcloud projects list
set PROJECT=gkelearn-123
gcloud config set project %PROJECT%
gcloud container clusters list
Linux Client:
gcloud projects list
export PROJECT=gkelearn-123
gcloud config set project $PROJECT
gcloud container clusters list
In the last post, we have scaled-down the GKS cluster cluster-1 to 0 which we can resize to default 3.
kubectl get nodes
gcloud container clusters resize cluster-1 --num-nodes=0 --zone=us-central1-c
Now, I am moving to cloud shell cli :-)
So now, Let's deploy a small application on our GKE cluster -
kubectl run hello-server --image gcr.io/google-samples/node-hello:1.0 --port 8080
Like the below page to get the update
Facebook Page Facebook Group Twitter Feed Telegram Group
Facebook Page Facebook Group Twitter Feed Telegram Group
No comments:
Post a Comment