Deploy Docker image to Kubernetes Cluster | CI-CD for Azure Kubernetes Service
Vložit
- čas přidán 9. 07. 2024
- Learn how to configure CI/CD pipelines to automatically push a docker image to Kubernetes cluster abstracted by Azure Kubernetes Services (AKS).
Learn how to pull a docker image from a public container registry, deploy your application to the docker image then push the image to a private container registry to get ready to be picked up by the release pipeline.
What will be covered in this video:
• Create Kubernetes cluster using Azure cli
• Create an Azure Container Registry (ACR), AKS and Azure SQL server
• Provision the Azure DevOps Team Project with a sample .NET Core application
• Configure application and database deployment, using Continuous Deployment (CD) in the Azure DevOps using Azure Pipelines
• Initiate the build to automatically deploy the application to Docker image, push the image to private Azure registry.
• Automatically trigger release pipeline to pull the docker image and push it to Kubernetes cluster
Main steps:
• Get the latest version of Kubernetes cluster so we can deploy it to Azure Kubernetes cluster
• Setting up the environment: Here we will configure three Azure resources namely Azure container registry, AKS, and Azure SQL server.
• Configure Build and Release pipeline: we will manually map Azure resources such as AKS and Azure Container Registry to the build and release definitions
• Trigger a Build and deploy application: Trigger a build manually and upon completion, an automatic deployment of the application will be triggered.
• Access the Kubernetes web dashboard in Azure Kubernetes Service (AKS): A short note on web dashboard in Azure Kubernetes that assists basic management operations.
Key Advantages of Azure Kubernetes Services (AKS)
• Hosts your Kubernetes environment.
• Quick and easy to deploy
• Hosted control plane
• Manages containerized applications without container orchestration expertise.
• Eliminates burden of ongoing operations and maintenance by provisioning, upgrading, and scaling resources on demand while keeping the application online.
• Continuous build option that creates Docker images for faster deployments and reliability.
• Create resources and infrastructure inside the Azure Kubernetes cluster through Deployments and services manifest files.
Useful links:
--------------------
Learning Git
• Mastering Git From Beg...
Learning Docker
• Docker For Beginners S...
Learning DevOps
• Introduction and High ...
About the Author
----------------------------
Video:
• Mohamed Radwan is a Pr...
Blog:
mohamedradwan.com
Linked-in
/ mohamedahmedradwan
GitHub
github.com/MohamedRadwan-DevOps
Twitter:
/ mradwan06
#docker #Azure_Kubernetes_Services #Kubernetes #Kubernetes_cluster #Azure_Container_Registry #DevOps #CICD_Pipelines_Kubernetes - Věda a technologie
I was searching answer who can explain Azure Kubernetes , you did it. Thank you. This saves lot of times for technical mergers.
Thanks Maria!
Awesome video about AKS. Thank you so much for the effort 🙂
Glad you liked it!
Awesome video even after 2 years of post :)
Thanks!
Excellent video, thanks so much for sharing!
Glad you enjoyed it!
Radwan! Thanks a lot, man... Waiting from a long time like this video
You have cleared all gaps and doubts what I have in deploying app using aks
Thanks Gandikota, happy it helpsyou.Thanks also for your kindly comment!
Very useful, Thank you
Really helped!! Thanks for sharing this video 😊
Glad it was helpful!
Fantastic video .. Really appreciate your efforts in making the video & helping the community .
Thanks!
Super helpful - Thank you so much Redwan !! #StayBlessednHappy
Great content ! keep the good work
Thanks you so much for this video
Thank you So much sir, ....Also could you please add more docker related videos ..Please keep it up.
Awesome...thank you Mohamed
Glad you liked it
Thank you!
Very well explained Video. Thanks for all your knowledge sharing initiatives.
Glad it was helpful!
Mohamed, Thank you so much :-)
You are welcome
GOOD STUFF HERE!!
Glad it was helpful!
Superb and Excellent.
Thanks a lot
i am lovin' it
Mohamed, this is what I needed. Thaaaank you! You made a small mistake when changing configuration variables - you left Y letter on the front.
No problem, yes, I know about it. many people notice this error, this is why what you see in the video is after long work and repeated many times ....You see the happy path not the hard one :-)
Hi, thank you for the demo! I am completely new to this topic. But I wonder how much the whole solution would differ, if our requirement is: "multiple ON-PREMISE client systems" and sole "Oracle DB 12c"? Azure cloud is used only as a source code storage. Can we still use AKS or it's for Azure cloud-based client systems deployment? What about DBMS, does it matter it's not MS SQL Server? Since "Kubernetes" itself is for free - can I avoid using "Kubernetes Azure Service" and do the same things (CI/CD deployment using Docker+Kubernetes) by using free tools?
Thank you for the detailed steps. I was able to follow and deploy an app. However mhc-front pod is going into Crashloopback off state. Is the MHC application code still up to date or need any changes..
HI Mohammed , thanks so much for this video :)
I have a question: when I launched run of release pipeline at the beginning I choose ubuntu 16.4 , I had this error message (The current operating system is not capable of running this task. That typically means the task was written for Windows only. For example, written for Windows Desktop PowerShell.)
.what is the solution for this problem ?
Thanks
Thanks Radwan. Brilliant tutorial. Takes us through all the steps. I am getting an error when following through the steps on the release task when the Execute Azure SQL DacpacTask runs. By default, when I go into the Release pipeline, when I was asked to select a agent, I selected a Linux based Ubuntu agent and looks like this task needs a Windows agent?
Thanks Venky, I am very happy you like it.
Yes, Dacpack needs Visual Studio which means it required Windows OS
While populating Service Principal ID in CLIENT_ID variable, "msi" is getting populated, is there any additional step involved for creating service Principal for AKS?
Any idea how we could run the pipeline on a locally hosted agent?
I successfully created the agent and ran the pipeline up to the Run Services Task. After that it failed on the docker-compose. Not sure what went wrong, if anyone has ideas i would gladly hear them.
Great
As of 2023, an error pops up when trying to create the Azure Kubernetes Service for westeurope region on Trial Account. It requires a quota increase on total regional vCPUs, however, this request for quota increase is not granted. Any ideas on how to get past this, or just upgrade to standard account?
EDIT: if the same command fails when creating the aks within your resource group, simple add --node-count 2 at the end of your input, this will only trigger 2 cores.
Thanks to a person who commented 2 years ago, this fix worked for me.
do i need only one container registry service for all enviorments(dev,int,prod).i.e 1 acr for all enviroemnts
thnx Radwan
Thanks a lot Mohamed! We are just migrating to Azure so this was perfect for me. Great job... just want to point out I needed to add access for the pods to the sql server firewall. Maybe I missed a step? ;) Regardless.. thanks again...
Thanks Danny! really appreciate your comment!
Thank you very much, it is very helpful,
we are planning to use cloud however we are afraid from the cost, is there any way that could help us estimate the cost before going cloud or is there any way to figure out which cloud provider (AWS or Azure) will be more cost efficient, any suggestion that could guide us?
again thank you very much
I am happy it helps. Thanks Motaz
For Azure, you can use Azure calculator to estimate the cost but I don't know for AWS
azure.microsoft.com/en-gb/pricing/calculator/
Excellent tutorial - In a real world of work - the auto demo generator AKS template wouldn't be there, so I take it I would have to create all the tasks from scratch emulating the AKS template generated? Also with regards to the AKS yaml file, can I use the same structure and tweak it for future developments?
Thanks!
Yes, you will need to do everything but you can use yaml file as template or even search for other templates, you will find many
Timecode:
1. Demo explanation begins at 12-10
2. Demo starts at 16-35
Thanks for your video. What is the cost of having this demo running for a month in azure?
awesome
Thanks!
Thanks a lot for this nice session. Is there a specific Devops training provided by you? I'm interested . Please let me know
Thank you! I am happy it helps.
All my training available in private, you can contact me using my blog
mohamedradwan.com/about/
For now, you can look on the following videos which can also provide great help
czcams.com/video/l-wdLGYwlVc/video.html
czcams.com/video/fRqUhj3mj70/video.html
what does -1 mean in Azure CLI commands ?
Its really a helpful Video for learner . Do I need to have vs subscription or i can just use Pay-As-You-Go azure subscription? Thanks.
Thanks. No, you can use Pay-As_you go
Thank you for this free complete tutorial.
Do you have or know of any video that does the same thing with github or gitlab and a private self hosted kubernetes?
Thank you.
No problem
For Git, see this video to the end. I am sure you will know things you didn't know before
czcams.com/video/ZgCCnv9LxzA/video.html
In my build pipeline - Run services - I'm getting the message: ##[error]Creating network "aks_default" with the default driver - ##[error]hns failed with error : The parameter is incorrect. - ##[error]The process 'C:\ProgramData\Chocolatey\bin\docker-compose.exe' failed with exit code 1
Thank you, This session was helpful, Can you please help on below query.
How you can move the image from Azure Registry container to AKS. As i don't see any ADO docker pull task.
This is in the YAML file, this is why we publish that to the artifact to give the deployment instruction
Hey Mohamed, I have a quick question ... I'm fairly new to AKS . My question is, once I deploy an ACR and attach ACR to my AKS, users will be forced automatically to download images though that ACR or they still can download images from anywhere ?
They can do from anywhere
Thanks for your Awesome Tutorial , can you please share how configuration network of virtual Box image easily ? Thanks
Thanks Marwen!
I am sorry, don't use Virtual box, I use Hyber-V
hi mohamad I want to ask you how can I run an image in command line I have an iso file and some dependencies how can I run it with the cmd (what is the command) that run the Iso with the dependencies ? thank you.
See this video
czcams.com/video/RONwkB6RN9E/video.html
Thanks! Is Azure Kubernetes the preferred way to deploy dotnet applications or azure web apps or azure service fabric? Is Azure Kubernetes in demand? Is it very difficult to manage the cluster?
If you use AKS, you don't have to manage cluster or in anohter word it become much easier.
@@MRadwanMSF thanks! Do you use any Reports dashboards, ELK stack with AKS? Or something similar?
Informational Video step by step for AKS.Please share the commands used
Thanks, here is the link for the post and the commands:
mohamedradwan.com/2019/06/08/getting-started-with-kubernetes-cluster-ci-cd-pipelines-for-azure-kubernetes-service/
Hi Radwan this is grate video, but i am unable to create AKS Cluster and Node, error pup-up
can you provide commands for hands on activity
32:15 Yours are pre-filled in, but as of today (June 2020), you need to fill this in:
DB deployment: vs2017-win2016
AKS deployment: ubuntu-16.04
I didn't try it soon but thank you so much for your comment! it's really helpful
@@MRadwanMSF -- Happy to help
Thanks, for me its very confusing to see deployment process on AKS... for sure this must be easy as we understand the flow.
Glad it was helpful!
Hi i am having azure azure devops docker and kubernetes full content along with pdf
Hi.. Just gone through this tutorial and Push services failed with error "denied requested access to the resource is denied" ##[error]/usr/bin/docker failed with return code: 1... can you help me what did I miss?
It seems you don't have enough permission on Azure Container Registry, try to get more permission
Hi Venkat could you fix the Push error ? I had the problem
Mohamed, There is no Azure Public Azure container registry as depicted in the diagram. Actually, you are pulling the image from docker hub so please modify the diagram to reflect its correct representation!!
Mohamed, thanks for sharing this info.
I have a task to complete.
I have an EAR/JAR file on a VM.
I have to deploy to AKS using azure Devops and docker. Can you please help me out.
How to create a pipeline where do i need to install docker or just add a task in azure pipeline.
Any help is much appreciated.
Nice video, if you don't mine can u make another video take a code from git hub and excute same procedure.
I will try
السلام عليكم
استأذن حضرتك لو تضيف ترجمه بالعربى حتى لو subtitle
ده النسخة العربية
m.czcams.com/video/z3Kz6Qax7Q4/video.html
Thanks for that. Would be really good, but just too many adverts I'm afraid. Overlays...that actual talk over your presentation, Banners blocking the screen, and then full adverts interrupting every couple of minutes.
CZcams is like any other advertising platforms, you can get no-ad for a low price membership
Not thorough