Managed Kubernetes
- Managed k8s refers to k8s hosted on the cloud.
- Cloud providers offer k8s as a service.
- k8s has master nodes (control plane) and worker nodes (nodes)
- Cloud providers manage control plane and for that they might charge hourly.
- The nodes will be charged according to vm sizes.
- Certain tasks become one-click
- upgrading k8s cluster
- backup of k8s cluster
- monitoring and logging etc
- cloud provider give sla’s
Give me k8s service on Cloud with sla's for each type of offering by popular clouds in tabular form
- In Addition to control plane manage k8s also give some features
- Network integration (VPC/VNET)
- Load Balancer support
- CNI options:
- AWS (VPC-CNI)
- Azure CNI
- third party CNI Options
- Storage integration
- CSI
- Disk storage
- File Share
- Blob Storage
- Extend CSI
- Secrets:
- Vault/secret managers integrations
- Container Registry
- Service Mesh
- GitOps integration (Argo)
- Observability (Prometheus, Grafana, fluentd/loki etc)
- Scaling options
AKS – Azure Kubernetes Service
- AKS: We will use the free tier
- Cluster: will have one node
- To create AKS cluster we will be using azure-cli
Azure CLI setup
- windows Refer Here
winget install --exact --id Microsoft.AzureCLI
- Mac
brew update && brew install azure-cli
- Azure cli login
az login
- Check
az group list
- Install kubectl
AKS setup using Azure CLI
- Refer Here
- Run the following commands in Azure Shell
export MY_RESOURCE_GROUP_NAME="myAKSResourceGroup"
export REGION="centralus"
export MY_AKS_CLUSTER_NAME="myAKSCluster"
export MY_DNS_LABEL="mydnslabel"
# create a resource group
az group create --name $MY_RESOURCE_GROUP_NAME --location $REGION
# create a cluster
az aks create --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_AKS_CLUSTER_NAME --node-count 1 --generate-ssh-keys --node-vm-size Standard_B2ms
- Configure credentials for kubectl on local laptop
az aks get-credentials --resource-group myAKSResourceGroup --name myAKSCluster
- This command creates a file in
~/.kube with name config.
- check the connectivity
kubectl version
kubectl get nodes
Lets deploy and create a service with type loadbalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-3
labels:
app: web
annotations:
kubernetes.io/change-cause: "nginx"
spec:
minReadySeconds: 5
replicas: 4
revisionHistoryLimit: 10
selector:
matchLabels:
app: web
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: web
env: dev
spec:
containers:
- name: web
image: nginx
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: ex3-svc
spec:
type: LoadBalancer
selector:
app: web
ports:
- name: web
port: 80
targetPort: 80
protocol: TCP
- To delete the aks cluster just delete the resource group
Useful prompts
Your are an expert in kubernetes. I want to understand in simple terms cost of running k8s cluster on Azure. Give me atleast 3 close to enterprise scenarios starting from simple to complex
Like this:
Like Loading...