Followers

Azure Container Registry, Container Instance

  Azure Container Registry It allows you to build, store and manage container images and artifacts in private registry for all types of cont...

 Azure Container Registry

It allows you to build, store and manage container images and artifacts in private registry for all types of container deployments.


Lab

Step 1: Create a virtual machine in Azure of ubuntu type to connect with Azure Container registry.

Step 2: Install Docker on the above VM.

             apt update

             apt install docker.io -y

Step 3: Create a container registry by searching container registries on Azure portal. Registry name I am using myreg100

Step 4: Install Azure CLI on your vm and push docker image to azure registry.

Install Azure CLI

curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor |  sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null



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

sudo apt-get update

sudo apt-get install azure-cli

Login to Azure using CLI (After running this command you need to follow the instruction to connect with Azure CLI)

sudo az login

Log in to your container registry

sudo az acr login --name myreg100

Pull a Docker image and push it docker registry      

sudo docker pull nginx
sudo docker tag nginx myreg100.azurecr.io/mynginx

Push the image to Azure Container registry and once pushed then check the container registry ---> Repositories and you will find mynginx image is available.

sudo docker push myreg100.azurecr.io/mynginx

Container Instance

To deploy an application in azure as container you can use Container instance.

Step 0: Goto Container registry and select your repository (myreg100) and select Access keys and enabled for Admin user

Step 1: Go to Azure portal and search for the container instance.

           Select container registry image :- myreg100

           Open Port no: 80

Step 2: Once Container is created it will give you the Public IP address and use this IP address on the browser you will be able to see nginx web page.

AKS (Azure Kubernetes Cluster )

To Deploy Containers on AKS we follow the below steps

Step 1: Search for Kubernetes service on the Azure portal.

Step 2: Create Kubernetes cluster by using container image - myreg100

            It will take around 5-10 mins to create the cluster

Step 3: Once Cluster is created then Select Workloads--> Create-->ADD Yaml for deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx-app
  template:
    metadata:
      labels:
        app: nginx-app
    spec:
      containers:
      - name: nginx-container
        image: myreg100.azurecr.io/mynginx
        ports:
        - containerPort: 80


Step4: Add another yaml file for services

apiVersion: v1
kind: Service
metadata:
  name: my-service
  labels:
    app: nginx-app
spec:
  selector:
    app: nginx-app
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 80

Step 5: In Services and Ingress you will find an External IP for your deployment use that IP address to access the deployment.










COMMENTS

Name

Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker Quiz,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,git quiz,1,Git Worksheet,1,Jira,3,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SDLC Quiz,4,SonarQube,3,Splunk,2,vagrant kubernetes,1,YAML Basics,1,
ltr
item
DevOpsWorld: Azure Container Registry, Container Instance
Azure Container Registry, Container Instance
DevOpsWorld
https://www.devopsworld.co.in/2022/05/azure-container-registry.html
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/2022/05/azure-container-registry.html
true
5997357714110665304
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content