Loading video player...
Hello everyone, welcome back to my
YouTube channel. So today we are going
to see how we can deploy our application
on AKS cluster using Helmshart. So for
that we are going to set up a CI/CD
pipeline. So before moving to our
demonstration part first we need a few
things which is required to set up this
complete workflow. So we should have
Azure account and subscription. So which
I already have. then we should have
Azure DevOps organization and project.
So I'm already having it. So uh if I
will go to Azure cloud.
So I have a subscription pay as you go
and if I will go to Azure DevOps I have
a organization which is learn Azure 1620
and Azure DevOps is my project. So these
two things I already have. So now the
next of the other thing which is AKS
cluster Azure container registry and a
service connection this I don't have. So
we are going to set up all these things
and then we have I already have a
application code and uh which include
docker file and helm charts as well.
Okay. Okay. So let's create a first
Azure container registry and AKS
cluster.
So uh during the creation of ACR and AKS
I'm going to use most of the thing as a
default options because uh we are not
going to focus on each part of like what
it does because I already explained in
my previous videos. So it will I'm going
little fast over here. So let me provide
a ACR name my ACR
and region central India which is fine
this is also fine.
Okay I'm directly going to review and
create.
So uh ACR is going to take couple of
minutes to create a container HD. So
meantime what we will do we will set up
a AKS cluster. So you can see my ACR is
ready. So status is okay and deployment
is also completed. Now similarly I will
go and create a Kubernetes services. So
let me create a Kubernetes cluster
and again I will choose my resource
group which is demo and cluster preset
configuration. I'm going to use dev and
test which is fine. And let me select my
cluster name and uh rest all the fields
I will leave it default.
Okay. So let me change the value of aset
pool here because we don't need this
much configured node size basically. So
uh here I will go with a series
and uh minimum node count I will go with
one and maximum two
because we are going to deploy a very
simple NodeJS application here. Okay.
Now let me go to networking part
networking part. So which is also fine
integration. So here I'm going to select
the uh Azure container registry which we
have set up. So
because we are going to deploy our
application image or docker image from
the ACR to AKS. So let me select my
container registry here and here I don't
need any monitoring here and alert rule
as well. So now let me check security.
So is this f it's fine. Okay. So rest
all the fields I'm keeping default. Let
me quickly hit review and create.
So AKS cluster is going to take couple
of minutes. So meantime what we will do
we will uh just review our application
code and Helm charts as well.
Okay. So deployment is initiated which
is fine.
Okay. So if I will go here. So the next
thing we have created ACR we have
created AKS cluster which is in progress
that's fine now we need to set up a
service connection. So service
connection is required to set up a
authentication between your Azure DevOps
and Azure cloud. So for that we need to
create a service connection. So how we
will create a service connections? You
have to go to your projects whatever uh
your project name and you will go to a
project settings here
and under pipeline section you will see
a option called service connection. So
this is what we are going to create. So
I already have a service connection. Uh
let me delete this one. Let's create a
new service connection.
Okay. Let me create a new service
connection here. I will choose Azure
resource manager
and here you can see you have a lot of
options. So I'm going with the very
first one which is app registration
automatic. So it is going to uh
authenticate using my email id and
password.
So let me select my email id here.
So once this credential is verified we
will see a subscription detail. So you
can see it is already loaded. So I'm
using pay as you go subscriptions and if
you want you can scope this app
registration at what level subscription
level management group level or machine
learning workspace. So these three
options so I'm going the default which
is a very first option uh which is
subscription level. Now I will choose my
resource group which is demo
and let me provide a service connection
name. So let me provide Azure service
connection. So once we will hit on save
button here what it is going to do it is
going to uh register this Azure DevOps
project as a application on Azure cloud
and where it will register. So for that
let me go to my intra id here
and under uh in id you will see a option
called app registration.
So if I will go to all applications. So
I already have uh this registration
which is fine. Let me uh click save here
and let me grant a permission as well.
Okay. So it is completed. If I will
refresh this, I will get a new service
principle or we can say a app
registration. So let me quickly delete
this one because we don't need it
otherwise it will be a confusing as
well.
Okay.
So we have created a service connection
but we are going to use because this
service connection is going to use
across our uh CI/CD pipeline. So this
service connection or service principle
basically should have access on Azure
container registries and AKS cluster as
well. So it can create resources or it
can deploy like for ACL it can it is it
should able to push the image on
container stream and similarly it is it
should able to deploy your application.
So for that we are going to use a
service principle which is automatically
registered when we set up a connection
between Azure DevOps and Azure cloud.
Another option we have we can create a
separate service connection for AKS and
u container registry as well. So for
that you can simply go to uh docker
registry here
and click next and here you can choose
azure container registries and you can
select the authentication type how you
want to authenticate and you can create
a separate registrations in uh real
world or best practices says you have to
create a separate service connections
for your ACR and AKS. So you can uh
basically define a limited permissions
but it's fine. It is just a
demonstration. So we are good to use
uh the only one uh service connection.
Okay. Next next thing what we need to do
we need to assign a permission or we
need to add this service principle to
our Azure container registry and Azure
Kubernetes services. So let me go to my
container HD because our Kubernetes
cluster is still in progress which is
fine.
Let me close this. And here I will go to
access control.
And here I will add a row assignment.
And here these are the options. So
basically we are going to use that
service principle to push and pull the
docker image. So you can simply add
these permissions and you have to always
follow a least uh privilege option
because like so you can you you will
have a better control but uh I'm going
to use a contributor
and here I will use a select members. So
here I will search for my service
principle which was learn Azure this one
and let me click and save it.
So now my service principle has the
permission on ACR. So it can push the
docker image on ACR. Similarly, we have
to add the service principle on AKS
cluster as well. Uh let's see the
progress. So it is in progress.
So AKS clusters always takes time
because in background it is going to
create a lot of things for us. So uh
okay we what we can do now. So meantime
it is in pro uh deployment is in
progress. We will go and review our
application code and hello charts. So
let me go to my repositories and I will
add this repositories in GitHub and the
link you will find in a uh video
description box. So if you want to do
hands-on from your own you can do that
as well.
Okay. So let's first understand the
application code.
So this is a very simple NodeJS
application which we are going to use.
So we already have two files here. The
very first file here is servers.js
file. So when we deploy our application
and when we will access our application
we are going to see this simple message
hello world from my app
and for that we need a some dependency.
So that's why we have used a
package.json file. So you can see this
section here which is required. So only
two files we have in our application
code. Next thing what we have is docker
file. So here we are going to use node
18 alpine image and here we are going to
set up a work directory inside the
container and we are going to copy this
package.j gesture file over here under
this particular directory and we are
going to install a dependencies using
run npm uh install command and finally
we are going to copy our application
code and these for exposing the port
and this is the startup commands or
arguments we can say because once the
container or the application port will
be initialized it is going to run this
particular file
Okay. So this is a very simple
application code. I hope you will get a
clarity on this.
Now let me go to my Helm charts. So here
I have helm charts. Uh let's see a
value. ML file first. So here I have
defined a values for replica kind
replica count sorry uh images. So you
can see we have created a image sorry
ACR with different name and here we have
a different name which is fine because
at a runtime we can override these
values and these are again few
parameters like pull policies tags tag
also we are going to override in
pipeline which is azure pipeline.mml
file and these are the service type and
ports why we are using value.mml file
because we want to keep our template
generic so we can use a same template
for multiple environments and for for
how you can deploy this application for
multiple environments. I'm going to
create another video for that detailed
video on that. So we are not going to
focus on multi-environment part first.
First first we are going to understand
how this helm chart is going to work
when we are going to deploy our
application.
And under chart we have a chart name,
descriptions, types, versions and etc
etc. So a lot of things
now this is the important files actually
all are the important files. So this is
our manifest file. So you can see
everything we are using here as a
variable or parameters. So the chart
name basically is coming from this
chart.ml file. So if I go here my chart
name is my app. So when we deploy our
application at a runtime basically it is
going to replace these values
and in replicas we have values
dotreplica count
and this meta data and also and you can
see the image also we are using from the
values.ml files. So, so if you are not
sure about these charts.mml file,
values.ml files, I have already created
a playlist on helum basic playlist. So
you will if you if you haven't if you
haven't watched yet, you can go and
watch it. So you will have a more
clarity about all these files.
So this is very simple deployment file
and similarly we have for service.ml
file because we want to expose our
application. So we can access from our
local internet sorry local system using
a public IP address. So we are going to
use a load balancer as a type and these
are the ports configurations.
So this is very again a very simple Helm
charts we are going to use here because
at least we will get an idea how we are
going to use Helm chart to deploy our
application.
Now this is ashure pipeline.ml file. So
this is uh interesting part here. So
again uh these are the variables which I
have declared. If you want you can uh
instead of putting in this directly in
this file you can go and create a
variables here. So for that you can
simply go to pipelines libraries and
here you can create a variable groups.
You can see these many variable groups.
So similarly if you want if you don't
want to put those things on a ML file
you can go and create a variable group
and you can store the values here. For
example you can create something like
that and you can use uh or sorry you can
reference this variable group in your
pipeline.
Okay let me go to my repo again and uh
Azure pipelines.
Okay. So these are the variables which I
have declared like image repository like
the repository name will be my app
docker registry service connections. So
this name we have to change because we
have created a service connection with
different name and similarly for AKS
service connection as well you have to
define your Helum chart path. So in my
case I have under helum/ my app if I
will expand it. So I have helum/my.
So that's what I have defined here. Helm
release name. You can give uh any name
which is mandatory. So I have given my
app release and name space where you
want to deploy your uh application in
which name space. So we as uh we we
don't have we are we are not focusing on
multi-environment part here. So we are
going to deploy our application on
default name space otherwise we will
create a separate name space draft QA
UAT and and all. So we can deploy our
resources accord accordingly.
Okay. So we have here two stages. The
very first stage is build and push. So
here we are going to
build our docker image and we are going
to push our docker image on azure
container registry
and then we are going to install helum
because which is required. Then here if
you can see so we are going to package
our applications.
Then we are going to publish our
application on pipeline because this
helm chart is going to use when we
deploy our applications because this is
what uh we have as a manifest file and
when we deploy our application at a
runtime we need all these files. So we
are going to pack these files here. So
this is the task and this is basically
we are going to publish this Helm chart
as a artifact on Azure pipeline
basically on Azure pipeline that we will
see and you can see the publish location
which is container
and next thing next stage we have a
deploy to AKS. So here what we are going
to do. So again it's a display name
whatever the name you want you can give
here depends on. So we are going to put
a condition here once this stage will be
successfully
completed then only execute this stage
and you can see a condition as well
succeeded. So once our build and publish
stage is successful then only this stage
will be executed or triggered basically.
Now we are going to use a deployment
chops here
and environment you can put any name
like dab, QA whatever you want. So
basically it is always a good practice
to use environment. So you can segregate
basically your uh uh releases. So this
environment basically this particular
part belongs to this here environment
sections. So you will have suppose this
is a simp single application which we
are going to deploy. uh if you have
multiple applications uh environment
specific then definitely use this
environment options here and we are
going to use a strategy which is run
once deployed. So and under steps. So
this is the first thing what we are
going to do we are going to download the
helm charts because here what we did we
have published our helm chart as a
artifact on Azure pipeline and we are
going to download this Helm chart here
from this option basically because we
need those charts to deploy our
applications and again we are going to
install Helm on agent because we are
going to use uh Azure hosted agents and
that isn't uh I'm not sure what all the
software it covers. So it is always a
good practice always install Helm charts
on Azure hosted agent. If you are going
to use self-hosted then it is fine
because you have already preconfigured
it.
So here we are going to deploy our Helm.
Now here basically we are going to
deploy our applications. So here you can
see the option called helum
upgrade/install.
So let me do one thing. Uh let me open
this pipeline.mml file in pipeline
itself. So it will be more clear as
well. So let me edit it.
And if I will come to this section and
uh
Okay, here it is more clear. So, okay,
now let's understand this particular
task.
So, here uh first thing
first input basically you can see Azure
subscription.
This is the service connection name
which we are going to use and the same
variable AKS service connections we have
declared here.
So let's uh change this value.
So let me go to
okay let me open another window here.
Let me go to project settings service
connection.
Okay. So it's the same name. Let me copy
it
and let me replace it.
Okay. So next thing
resource group again I have hardcoded
here but you can uh define as a variable
or in variable group. So I have resource
group called demo and kubernetes
cluster. So here you have to pass your
kubernetes cluster name. So in my case
my cluster name is my -y- AKS - clusters
and again you can use instead of hard
coding here you can create this
particular value in uh variable group or
or you can define in top of the file as
well. Commands we are going to use
upgrade chart type file path and this is
the path we are going to give. So this
is the system dotdefault working
directory. This is what we have uh
downloaded our Helm charts and then we
have a artifact name which is Helm chart
and my app - build ID with this name
from this this will be the name of our
chart and here we are going to use a
release name which we have declared at
the top level here again release name
and similarly name space. So name space
also we have declared at top of the file
and this is the argument which we are
going to use hyphen - install and here
you can use override values. So suppose
in values doml file if you have
something different so you can override
that particular value using this
particular argument which is override
value. So here we what we are going to
override we are going to override image
tag with the build.build build ID and
image repository name with this name
because in values.ml file we have my ACR
something and the actual ACR name is
different so you can override from here
as well and this is the image
repositories which we have already uh
declared here
uh if I'm not wrong yeah so image
repository will be my app so okay so
what else we need to change here.
So let me Okay. So this container HD we
need to change. So let me uh copy
this part
because we are not going to use a
separate service connection. So let me
change this value here.
Okay, let me remove this and this one as
well. Okay, so I think it looks fine
everything.
Okay, now we need to change few things
here because our container HD name is
different and cluster name is fine which
is my AKS cluster and we need to also
add a service principle as a in access
control role. So let's do that first.
Otherwise the service principle does not
have access to deploy resources on
Kubernetes clusters. So again I will go
with contributor role
and uh let me select member and let me
search.
Okay let me uh save it and review and
assign.
Okay so we have added a service
principle on AKS. Now next thing uh
let's take our ACR name which is my ACR
121
and uh let's change this value as well.
So actually we are not going to use this
docker reg service connection. Let me
comment it out. So what I will do?
Let me change the value here and one
more place because uh if I will come to
build and publish part. So here we were
using
okay not here. Okay here MS repositories
and AKS service connection. So actually
we have not create a created a service
connection for Docker registry sorry
container registries. So either we can
create a service connection for
container registry as well or we can
simply uh let me validate and save this
file first. So you can see input
container registry expect a service
connection of type docker registry. What
are the provided service connection?
Azure service connection. So is of type
of Azure RM. So what we will do? Let me
go and create a service connection for
container HT as well. So let me create a
new service connection and uh let me
select docker registry. Yeah, this one.
And here I will go to use Azure
container registries authentication type
service principle which is fine.
So again I need to authenticate uh with
my credentials here.
So what it will do? It will again
register a new service principle because
again this service connection will be
registered in your azure uh in id as a
app registration. So here let me give
any name. Let me copy the name from here
itself. Uh let me give a name. So now
let me uncheck sorry and comment this
one and let me provide the same name
here which is my ashure ACR. And again I
will grant a permission to all pipeline
here. Now uh let me save it.
So it is created another service
connection with the name of my Azure
ACR. If I will validate it now.
Okay. So let me copy this name from here
and change the value from here. So now
let's again validate it. Now you can see
pipeline is valid. Now let me save it.
So let me minimize this screen. Save.
Okay. I think now we are good to go uh
to run our pipeline. If it in case it
failed, let's we will see uh why it is
failing. Let's uh first run it. So now
let me go and run this pipeline
and uh let me go here settings not
settings sorry
repository
services. So as of now we don't have any
repo.
So let's see what all task it is going
to perform.
Okay. So you can see build and push is
push is completed. Let's verify.
So first thing it is pulling the node 18
Alpine image.
Pull completed. Now let's see push part.
So it is pushed our docker image or
application image on container HD. So
let's verify it. Let's refresh it. So we
can see the name is my app and this is
the tag which is latest which is fine.
So this ST is completed. Now let's see
another stage.
Okay. So you can see here
uh it is going to run helm upgrade in
default name space which is default and
we it is going to replace the values
because we have passed override argument
in our pipeline.mml file. So you can see
the image and tag name image
repositories which is uh my ACR121 and
let's see here
and this is the repo name which is my
app and here we are going to hyphen
install. So here this command basically
it's going to first unchip your Helm
charts and it is going to deploy your
Helm charts.
So you can see here status is deployed.
This is the name of our release. Last
deploy where it is deployed default name
space and revision is one which is fine.
So now let's do uh let's go and verify
in our AKS clusters.
So let me go to my EKS cluster first
and if I will go and check the workloads
here.
So here we can see the part my app
deployment which is up and running and
you can see we have defined only one
replica that's why we are seeing here
one out of one. If we have defined two
replica count then it will be two out of
two. So this is fine. If I go to ports
here. So you can see the port which is
my app deployment and there some random
uh number which uh is generate for a
unique identification purpose. Okay. Now
we are interested to see a services.
So it is created a service my app
services. Why? If I will go to repos
part and if I go to hello
template service.ml so you can see the
service name should be chart name hyphen
service and chart name in our case is my
app. So if I go back so this is the same
name my app which is a chart name and
hyphen service which we have passed in
our manifest file and you can see this
is the external IP. So we can from this
IP address we can access our application
and see if it's working or not. So let
me hit on click on it.
So you can see we're getting a response.
Hello world from my app. This is what we
need as a output uh to verify our
application is working fine because this
is what we have passed the message in
our service dot sorry not service my
mistake. uh so in server js file so this
is the message we want as a output in
our application and we are getting it so
it means the CI/CD pipeline is
configured successfully and it's
deployed our application using helmchart
so I hope uh it is clear in case if you
have any doubts you can definitely ping
me over comment box uh I will try to
reply as soon as possible and this
application code and halum charts.
Everything you can find in a GitHub link
under video description box. So that's
all for today. See you next video. Thank
you so much.
🚀 Azure DevOps CI/CD with Helm & AKS | Complete Step-by-Step Guide Want to learn how to set up a CI/CD pipeline in Azure DevOps for deploying applications to Azure Kubernetes Service (AKS) using Helm charts? In this video, I’ll walk you through the entire process step by step — from basics to advanced deployment automation. 🔹 What you’ll learn in this tutorial: ✅ Introduction to Azure DevOps CI/CD pipelines ✅ Setting up Azure Kubernetes Service (AKS) ✅ Creating and managing Helm charts ✅ Automating deployments with Azure DevOps Pipelines ✅ Best practices for DevOps, Kubernetes & Helm integration 💻 GitHub Repository: https://github.com/shubhamagrawal17/Tutorial/tree/main/aks-helm-deploy This video is perfect for beginners and DevOps professionals who want to master modern cloud-native deployments with Azure + Kubernetes + Helm. ✨ By the end of this guide, you’ll have a fully automated CI/CD pipeline running on Azure DevOps that continuously delivers applications into AKS using Helm. 🔔 Don’t forget to Subscribe for more tutorials on Azure, DevOps, Kubernetes, and Cloud Computing! #aks #cicd #Kubernetes #azuredevops #kubernetes #devops #azure #cloudcomputing #helm