Deploying Nginx container on Azure Kubernetes AKS

Deploy Nginx Container on Azure Kubernetes AKS

Azure DevOps Container Registries

Create Container Registry 1

Create Container Registry 2

Create Container Registry 3

Create Container Registry 4

Create Container Registry 5

Create Container Registry 6

Create Container Registry 7

Create Container Registry 8

Create Kubernetes Cluster 1

Create Kubernetes Cluster 2

Create Kubernetes Cluster 3

Create Kubernetes Cluster 4

Azure k8s 1

Azure k8s 2
az account set –subscription 97073a57-43cf-49f7-a905-2c76b9468b9f
az aks get-credentials –resource-group MyRG1 –name az-k8s
# List all deployments in all namespaces
kubectl get deployments –all-namespaces=true
prayag@Azure:~$ az account set –subscription 97073a57-43cf-49f7-a905-2c76b9468b9f
prayag@Azure:~$ az aks get-credentials –resource-group MyRG1 –name az-k8s
Merged “az-k8s” as current context in /home/prayag/.kube/config
prayag@Azure:~$ kubectl get all
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 10m
prayag@Azure:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
aks-agentpool-16581592-vmss000000 Ready agent 9m12s v1.21.7
aks-agentpool-16581592-vmss000001 Ready agent 9m5s v1.21.7
prayag@Azure:~$ kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
aks-agentpool-16581592-vmss000000 Ready agent 9m21s v1.21.7 10.240.0.4 <none> Ubuntu 18.04.6 LTS 5.4.0-1064-azure containerd://1.4.9+azure
aks-agentpool-16581592-vmss000001 Ready agent 9m14s v1.21.7 10.240.0.5 <none> Ubuntu 18.04.6 LTS 5.4.0-1064-azure containerd://1.4.9+azure
prayag@Azure:~$

Azure aks get credentials

Azure demo app

Azure demo app add code

Azure demo app add public key

Azure demo app add code 1
prayag@Azure:~/az/git/demo-app-1$ git config –global user.name “Prayag Sangode”
prayag@Azure:~/az/git/demo-app-1$ git commit -m “push code”
[master (root-commit) 5e3aea6] push code
8 files changed, 841 insertions(+)
create mode 100644 LICENSE
create mode 100644 LICENSE-CODE
create mode 100644 README.md
create mode 100644 app/.dockerignore
create mode 100644 app/Dockerfile
create mode 100644 app/package-lock.json
create mode 100644 app/package.json
create mode 100644 app/server.js
prayag@Azure:~/az/git/demo-app-1$ git push
Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.
Delta compression using up to 2 threads
Compressing objects: 100% (10/10), done.
Writing objects: 100% (11/11), 12.26 KiB | 2.04 MiB/s, done.
Total 11 (delta 0), reused 0 (delta 0)
remote: Analyzing objects… (11/11) (28 ms)
remote: Storing packfile… done (56 ms)
remote: Storing index… done (28 ms)
To ssh.dev.azure.com:v3/az-devops-demo11/demo-app-1/demo-app-1
* [new branch] master -> master
prayag@Azure:~/az/git/demo-app-1$

Azure devops demo app git config

Azure devops demo app code explorer

Azure devops create pipeline

Azure devops configure pipeline

Azure devops select repo

Azure devops configure pipeline 1

Azure devops deploy to Kubernetes

Deploy to Kubernetes service

Configure piepline yaml

Review pipeline yaml

Save and run pipeline

Setup CI with Azure pipelines
That’s it. I hope you found this to be useful in some way. I’ll be back with some more interesting new DevOps articles soon.