>> In the last episode,
you learned about SQL Server running in containers.
In this episode, we'll take it to the next level with Kubernetes,
this week on Data Exposed: MVP Edition.
[MUSIC]
>> Hi, I'm Anna Hoffman,
and welcome to this episode of Data Exposed: MVP Edition.
Today I'm joined once again by Anthony Nocentino.
Thanks for joining us again, Anthony.
>> Thanks to having me back.
>> Always a pleasure. Today we're going to talk about Kubernetes.
Now in the last episode,
which we'll put a link to in the description,
Anthony told us all about containers,
how easy they are to get set up,
and how fast they can be.
Now we're going to take it to the next
level by talking about Kubernetes.
We've been hearing this term a lot.
Can you tell us, what the heck is going on with Kubernetes?
>> In our last session, we talked about what a container is.
The last thing that we're going to do in our data center
is run around to a bunch of servers, and type "Docker Run".
What Kubernetes does for us is,
it's what's called a container orchestrator.
It's the thing that's going to help us manage
our containers in an enterprise way.
What we're going to do when we deploy
containers, instead of Kubernetes,
we're going to wrap them in this abstraction that is a Pod.
What a Pod is, is the running container,
but also any resources that that container needs to run.
In that last demonstration when we talked about containers,
you saw how I attached storage.
Well, that's one of the elements of a Pod.
It's going to be the container itself,
and also maybe the storage,
or other configuration elements,
wrapped up in a [inaudible] unit.
When we deploy applications in Kubernetes,
we're going to deploy them as Pods in a cluster,
and what a cluster really is,
is a collection of resources in a data center.
You can think of it as an aggregation of the servers,
or the CPU disk,
and RAM in our data center,
that we can deploy our applications onto.
That really gets us to one of the
key constructs behind Kubernetes,
is this idea of infrastructure abstraction.
We're going to care a little bit less
about where our application runs in our data center,
but we're going to aggregate those resources together and just
consume those resources in code.
When we talk about infrastructure abstraction
and being able to write code to deploy our applications,
specifically in Kubernetes, we're going
to use this declarative configuration model.
We saw how I used "Docker Run" in
the previous data expose episode,
what we're going to write code in YAML to deploy SQL Server,
or any application instead of Kubernetes,
and we're going to see that in our upcoming demonstration.
Now one of the core constructs behind
Kubernetes is this idea of desired state,
and so that code that I write that says,
''Hey, startup the SQL Server,'' well,
Kubernetes is going to make sure that we
stay in that state at all times.
So if a SQL Server crashes, well,
[inaudible] will figure that out
and it'll just start up another SQL Server.
That's a fantastic piece of
functionality that we're going to get out of our cluster.
It's not just for SQL Server,
but for any application that we deploy inside of Kubernetes.
>> Awesome, thanks. We got that Kubernetes 101 now,
how does this apply to the SQL world?
>> Here we are in Azure Data Studio,
and I have a notebook to walk us through the deployment,
and also the high availability options that we
have of deploying SQL Server inside of Kubernetes.
I'm going to go ahead and kick off this deployment here,
which is going to download
the declarative code to deploy SQL Server in my cluster.
Let's take a quick peek at what that looks like.
I don't want to get caught up in the details of the code here,
but know that what we're doing in this code
is we're deploying some storage.
We're going to create and deploy a SQL Server,
and also put that SQL Server
behind a load balancer inside of Azure.
With that code there,
I'm able to deploy a SQL Server
declaratively inside of my Kubernetes cluster.
Let's go ahead and see how we can connect to that.
On line 6 here, I'm just going to run
"Command" to get the version of SQL Server,
so we see select a diversion, run that code there.
Running that code there, you can
see we get the output at the bottom that we've
deployed SQL Server 2019 [inaudible].
We described it in code in that YAML manifest,
to deploy that inside of our Kubernetes cluster.
Now, one of the key aspects behind that,
is I have code that describes that deployment.
I can take that code, park that in source control,
and manage that configuration over time,
so I can make modifications to that,
and track those changes in my cluster when
I have software-defined code for my deployments of SQL Server.
Now what I do want to show you is this,
is inside of our cluster,
if something goes wrong inside of SQL Server,
well, Kubernetes will figure that out and recover.
What we have here is "Shutdown with Nowait",
which is a command that's going to crash SQL Server.
Kubernetes will see that SQL Server is no longer running,
and just a few seconds later,
will start that SQL Server up for me automatically.
Here we can see in the output at the bottom,
it's already recovered and brought SQL Server back online.
>> Awesome. In the previous video,
you showed us how fast we can get
SQL Server 2019 up and running in a container,
and now you're showing us with Kubernetes,
how fast we can kill
SQL Server and it just comes back up and it's running again.
Very cool stuff.
>> Yeah. In addition to high availability,
we also have the ability to build more complex systems in code.
We touched on that when we talked about containers,
that containers are going to be the building blocks
to those systems.
One of the systems we have on the screen here,
which is a Big Data Cluster.
Now I don't want to get caught up in
the details of what a Big Data Cluster is,
but if you look at the bottom of the picture here,
we can see that the underlying infrastructure,
supporting this complex system that is
a Big Data Cluster, is Kubernetes.
What that enables Microsoft to do is to build
these larger solutions in a software-defined way,
so that you can deploy those wherever you have Kubernetes.
It's not being dependent on your physical infrastructure.
Microsoft defines what a Big Data Cluster looks like in code,
and you're able to deploy that complex system,
just like I did in the demonstration today.
Moving forward into the next generation of
systems that we're seeing come from Microsoft,
is Azure Arc - Data Services.
Again, not focusing on what's going
on inside of Azure Arc - Data Services,
but if you look at Step 1 here,
it says, "Have Kubernetes in your infrastructure."
Again, being able to extend
those Azure services into your on-premises
or [inaudible] scenarios in a very easily software-defined way.
>> Awesome. Thanks Anthony.
This has been really interesting to see
how we've taken SQL Server really,
and we put it in containers,
and we put it in Kubernetes,
and now it's opened all these doors up for us.
It's really the foundation or
the underlying infrastructure that's going to support things
like Big Data Clusters and Azure Arc.
It's definitely something really excited and I think
probably a lot of people are looking forward to
seeing more of in the future.
>> Yeah. On a personal note for me
when I saw these products and it had come out,
that's when I really started paying attention to Kubernetes,
and being able to build these more complex systems to
solve more complex problems, and build solutions.
>> Awesome. Well, thanks so much for being on the show, Anthony.
We'll put some links to where to learn more,
where to see this notebook in the description,
and we hope to see you next time on Data Exposed.
[MUSIC]