OLIVER KING: Hello. My name is Oliver,
and today I'll be talking about
our Kubernetes GitHub Actions.
Before we can talk about GitHub Actions,
we have to first go over GitHub workflows.
GitHub workflows automate test,
build, and deployment and other things.
They execute on hosted virtual environments.
Actions are like a step of the GitHub workflow.
Our AKS actions allow developers to easily
interact with their Kubernetes
cluster all from a GitHub workflow.
They can be used alone or together.
They make them very reusable and modularized.
Our starter workflows provide
templates for getting started
with deploying to AKS
and any Kubernetes cluster.
Workflows are run in response to events
such as pushing to a branch, adding a tag,
making a pull request. They can be run at CronJob,
they can be run by the user
itself with a workflow dispatch.
There's many options.
We're going to go through a demo.
We're starting with a new Kubernetes cluster
and we have a GitHub repository
with a simple voting app in it.
This voting app in GitHub repository
has Kubernetes manifest files.
And what we're going to do is we're going to deploy
to our AKS cluster using GitHub actions.
Then we're going to change our application
and we're going to deploy those changes.
So again, starting with an empty Kubernetes cluster,
you can see that here,
we have our GitHub repository.
And if you go to the Actions tab,
that's where you start all workflows
with the workflow dispatch event.
We can run it off and when we refresh,
we can see it.
Go back to your repository.
Let's look at how all this is set up.
There's a .github/workflows folder.
They're all configured with YAML.
So here we can see we have the name,
what's triggering on,
some environment variables and the jobs.
So under the job section,
we can see it's running on Ubuntu.
We got the steps,
so we check out this repository.
We log in with Azure.
We build and push to Azure Container Registry.
We get the AKS context,
essentially getting the kubeconfig.
We get the ACR credentials,
and we're going to create AKS secret.
We're going to use those ACR credentials
to pull images from ACR,
and then we can just deploy.
So let's go back up.
So how did we get all those steps?
To make it easy, we have starter workflows.
So if you go to the Actions tab and then hit "New",
you can see all our starter workflows.
In this case, we picked the deploy to AKS
one and you can configure it.
This makes it really easy to get started.
At the top you can see we have a comment
with a lot of instructions for getting ramped up.
Let's just go back to our action
and check in on how it's doing.
We can see the build.
And it's currently in the process of deploying.
We see some output
and we can see it's finished.
So our application has been deployed.
If you click into each individual step,
you get a lot of output.
You can really see what's happening.
You have a lot of visibility.
But let's go back to our Kubernetes cluster.
If we check the pods,
we'll see that they're brand new,
which lines up with us just making the application.
And let's check in on it.
So here you can see the simple voting app.
So say that we get bored of choosing
between Python and Java.
Let's change something to say, a pet voting app.
We're going to change our options in this repository.
This is the repository on GitHub.
We're going to commit it.
And we're going to push.
So if you go back to GitHub repository,
we can see our changes were pushed.
And let's just kick off another deploy.
This time we're going to speed it up a little bit.
You can see all the steps running.
You see the output, and it's deployed.
So let's check in on it.
We're going to go back to our application,
refresh, and boom.
We can see we now have the options of dogs and cats.
Alright, so as we can see, we can interact with
the Kubernetes cluster completely from GitHub.
It's really nice to be able to just work in one space,
keep everything confined to one environment, really.
What we didn't really see
demonstrated is actions are super customizable.
So all the action we use in this demo,
all have different options
that we can swap in, swap out.
GitHub workflows allow you
to insert any steps in between
so you can really make this your own
and fit your own workflow.
The deploy stuff in particular
has a lot of different strategies
that we didn't demo today.
What we demoed is basically
the most straightforward and simplest case,
but we support deployment strategies like Canary,
including Service Mesh Interface or Kubernetes only,
and also Blue-Green deployment strategies
where you can promote or reject a deployment.
We also have a Bake Helm, so as Azure/k8s-bake.
Basically this lets you use either Helm Kustomize
or Kompose to generate your manifest files dynamically.
So there's those two and a ton of other options.
You can learn more about
our GitHub Actions at this link.
There's a list of all our AKS
and Kubernetes actions.
We also have a link
to our starter workflows here
so you can get started.
So be sure to check out those resources.
If you look at each individual action repository,
it gives you a list of all the options available for it
and exactly how to use it.