#Instructions from this URL: https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu
# Create environment variable for correct distribution
CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
# Add the Cloud SDK distribution URI as a package source
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
# Update the package list and install the Cloud SDK
sudo apt-get update
sudo apt-get install google-cloud-sdk
#Authenticate our console session with gcloud
gcloud init --console-only
#Create a named gcloud project
gcloud projects create psdemogke --name="Kubernetes-Cloud"
#Set our current project context
gcloud config set project psdemogke
#Enable GKE services in our current project
gcloud services enable container.googleapis.com
#You may have to adjust your resource limits and enabled billing here based on your subscription here.
#Go to https://console.cloud.google.com
#From the Navigation menu on the top left, browse to Compute->Kubernetes Engine.
#Click enable billing. Click Set Account.
#Tell GKE to create a single zone, three node cluster for us. 3 is the default size.
#https://cloud.google.com/compute/quotas#checking_your_quota
gcloud container clusters create cscluster --region us-central1-a
#Get our credentials for kubectl
gcloud container clusters get-credentials cscluster --zone us-central1-a --project psdemogke
#Check out out lists of kubectl contexts
kubectl config get-contexts
#set our current context to the GKE context
kubectl config use-context gke_psdemogke_us-central1-a_cscluster
#run a command to communicate with our cluster.
kubectl get nodes
#Delete our GKE cluster
#gcloud container clusters delete cscluster --zone=us-central1-a
#Delete our project.
#gcloud projects delete psdemogke
#Get a list of all contexts on this system.
kubectl config get-contexts
#Let's set to the kubectl context back to our local custer
kubectl config use-context kubernetes-admin@kubernetes
#use kubectl get nodes
kubectl get nodes
Kubernetes Tutorials using EKS – Part 1 – Introduction and Architecture
Kubernetes Tutorials using EKS – Part 2 – Architecture with Master and worker
Kubernetes Tutorials using EKS – Part 3 – Architecture with POD – RC – Deploy – Service
Kubernetes Tutorials using EKS – Part 4 – Setup AWS EKS Clustor
Kubernetes Tutorials using EKS – Part 5 – Namespaces and PODs
Kubernetes Tutorials using EKS – Part 6 – ReplicationControllers and Deployment
Kubernetes Tutorials using EKS – Part 7 – Services
Kubernetes Tutorials using EKS – Part 8 – Volume
Kubernetes Tutorials using EKS – Part 9 – Volume
Kubernetes Tutorials using EKS – Part 10 – Helm and Networking
Latest posts by Rajesh Kumar (see all)
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024