SAKTHI VETRIVEL: Hey, everyone.
I'm Sakthi Vetrivel,
and today I'll be doing a quick demo
of Azure Service Operator for you.
Azure service operator helps you provision
Azure resources and connect
your applications to them from within Kubernetes.
This is great for Azure users who'd prefer to manage
their public Cloud resources using
Kubernetes tooling and primitives.
For example, kubectl apply.
The Azure Service Operator does
this using two components,
the custom resource definitions,
also known as CRDs for each of
the Azure services a Kubernetes user can provision.
The second piece is
the Kubernetes controller that manages
the Azure resources that are
represented by the custom resources.
This controller attempts to
synchronize the desired state in
the custom resource with
the actual state of that resource in Azure.
That means creating it if it doesn't exist,
updating it if it has been changed,
or even deleting it.
In this demo, we'll go over the installation process for
Azure Service Operator in
a Kubernetes cluster, provision in
Azure resource group from within
the Kubernetes environment and use
Azure Service Operator within VS Code
using the AKS VS Code extension.
So, let's go ahead and get started.
Here's our GitHub project that
houses Azure Service Operator.
In the past we've had two versions,
but today we'll be focusing on V2.
Now the main difference here in
Version 2 is that it supports code
generated CRDs based on Azure OpenAPI specifications.
This allows us to really quickly add
any new resources as soon as they're requested by users,
and it also gives us better uniformity
across all of the Azure resources.
So let's go ahead and take a closer look at Version 2.
Today, the project is in an alpha.
We follow the Kubernetes definition of alpha.
We also have a list of
the different Azure resources we
currently support in Version 2.
You can take a look at the sample YAML files we
have or sample definitions for these Azure resources.
Here's one for storage accounts.
So, you can see we have our location,
the SKU type,
the name, every parameter that
you need when initially creating a storage account.
So with that, I'm going to head over to VS Code to show
you a bit about the AKS VS Code extension.
So, I already have this installed in
VS Code and this allows you to do a few different things.
You can view your AKS clusters in
the Kubernetes extension Cloud Explorer,
add your AKS clusters to
the kubeconfig in your environment,
run diagnostics checks, etc.
But today, I'll be talking about
installing Azure Service Operator on your AKS cluster.
So over here,
I can see the subscriptions that I have in Azure
and I already have
a Kubernetes cluster up and running called aso-demo.
So, I'm going to merge this into
the kubeconfig for my local environment.
And you can see that the cluster,
along with all of its cluster information,
pops up in the Kubernetes extension.
Now using the AKS VS Code extension,
I'm going to go ahead and install Azure Service Operator.
Through the VS Code extension,
we have a pretty simple wizard for the installation.
All I need to do is provide the details for
a service principle that has
contributor permissions for the subscription.
This is what allows Azure Service Operator to create and
manage resources in your subscription on your behalf.
So, I've already created a service principle
with the necessary permissions.
I'm going to go ahead and copy and paste
that information into this window,
going to go ahead and hit "Submit",
and start that installation process.
So over here in the right hand corner,
you can see all of the steps starting to take
place for Azure Service Operator installation.
Once that's complete, you'll get
the full output of what's happened.
So, now that our installation was successful,
let's go ahead and take a look at what is
running in the operator's namespace.
So, e're still waiting for the CLI to pick up this change.
But in the meantime,
let's go ahead and check out
the namespaces section of the Kubernetes extension.
Here we see that the operators namespace
does indeed exist.
We'll double click on that,
get some details about the namespace.
Nothing really going on in here quite yet,
and if we go ahead and check the log output,
we'll see that the operator's namespace
was indeed created as the last step of the installation.
So, let's go ahead and run that command again.
We see that we have two pods
running as a part of
the Azure operator controller manager.
So, nowthat we have the operator running,
let's take a look at
an example of actually using the operator.
I already have a YAML definition
for an Azure resource group.
I'll go ahead and open that up.
You'll see here the definition is pretty basic.
I've got the resource group name and the location.
So, we're going to create a resource group
called aso-sample-rg in westcentralus.
Now, in order to create this resource group,
I'm just going to use kubectl
apply and apply this YAML definition.
Then the Azure operator controller
will pick up that information and create
a resource group in
my Azure subscription that
matches this Kubernetes object.
Now, let's take a look at the details of
the resource group Kubernetes object that was
created by the ASO controller.
So, we see that it has all of the details that we specified.
It has the name.
Its location is indeed in West Central US.
Just for confirmation, let's take a look at
the Azure resource that
this Kubernetes object represents.
So, in the Azure portal,
I can see I have a few resource groups
under my subscription,
and aso-sample-rg is indeed one of them
and it's got that West Central US location
that we specified.
So, clean up is also very easy then as your Azure service operator.
All we're going to do is delete
the Kubernetes object that backs that Azure
resource and it will also
delete that object in Azure as well.
I'm going to go ahead kubectl
delete resourcegroup/aso-sample-rg.
Let's open the Azure portal back up,
refresh the page,
and we see that the resource indeed no longer exists.
So that's how Azure Service Operator
works within the AKS VS Code extension.
In this demo, we looked at how Azure Service Operator
abstracts the Azure specific knowledge
needed to use Azure resources.
This does this by simplifying
Azure resources to YAML definitions
and allows you to easily provision and bind
resources to your AKS cluster.
In Version 2 by using code generation
to create custom resource definitions,
we now have easy maintenance and support
of a wide range of Azure resources.
And through the AKS VS Code extension,
we can now have development and
creation of Azure resources through
these YAML definitions live side by side in VS Code.
If you'd like to learn more
about Azure Service Operator,
check out our GitHub repository,
which has more documentation and our product roadmap.
If you'd like to learn more about Kubernetes on
Azure or see more demos from this event,
check out the links below.
So with that, thanks for your time and I'll see you around.