🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Kubernetes Tutorial – Create AKS Cluster


# This demo will be run from c1-cp1 since kubectl is already installed there.
# This can be run from any system that has the Azure CLI client installed.
#Ensure Azure CLI command line utilitles are installed
#https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-apt?view=azure-cli-latest
AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
#Install the gpg key for Microsoft's repository
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
sudo apt-get update
sudo apt-get install azure-cli
#Log into our subscription
#Free account - https://azure.microsoft.com/en-us/free/
az login
az account set --subscription "Demonstration Account"
#Create a resource group for the serivces we're going to create
az group create --name "Kubernetes-Cloud" --location centralus
#Let's get a list of the versions available to us
az aks get-versions --location centralus -o table
#Let's create our AKS managed cluster. Use --kubernetes-version to specify a version.
az aks create \
--resource-group "Kubernetes-Cloud" \
--generate-ssh-keys \
--name CSCluster \
--node-count 3 #default Node count is 3
#If needed, we can download and install kubectl on our local system.
az aks install-cli
#Get our cluster credentials and merge the configuration into our existing config file.
#This will allow us to connect to this system remotely using certificate based user authentication.
az aks get-credentials --resource-group "Kubernetes-Cloud" --name CSCluster
#List our currently available contexts
kubectl config get-contexts
#set our current context to the Azure context
kubectl config use-context CSCluster
#run a command to communicate with our cluster.
kubectl get nodes
#Get a list of running pods, we'll look at the system pods since we don't have anything running.
#Since the API Server is HTTP based...we can operate our cluster over the internet...esentially the same as if it was local using kubectl.
kubectl get pods --all-namespaces
#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
#az aks delete --resource-group "Kubernetes-Cloud" --name CSCluster #--yes --no-wait
Subscribe
Notify of
guest


0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x