>> Hi, I'm Donovan with another episode of Azure Friday.
I'm here with Brendan and we're going to learn how
to use Visual Studio Code to
develop a Node.js App and
deploy the Kubernetes. Welcome to the show.
>> Thanks for having me.
>> So, Node and Kubernetes to me just seems like
a slam dunk but have we done
some improvements in Visual
Studio Code to make that easier?
>> Yes. I think one of the great things about node is how
approachable it is and how easy it is to get started.
And so, I think oftentimes,
this may be the first thing
somebody has deployed to the cloud.
And so, I think it's important going through
a container of learning
commodities can be a little complicated.
>> Sure.
>> You want to smooth that path a little bit.
May not be what somebody sticks with for forever,
but really get him started in a really easy to use way.
>> All right, cool, so show me how it works.
>> Yeah, no problem at all. So, go over here
and we have a simple Node.js application.
It's using express, pretty standard.
>> Yeah.
>> And so, this is the thing
somebody might have pulled off a,
Hello World or some tutorial.
And they've also installed the extension,
the Kubernetes extension that
Microsoft has built for a Visual Studio Code.
And so, now if we want to actually
get this up and running in Kubernetes,
we actually just pull up and say, Kubernetes run.
>> Okay.
>> Now, you can see a bunch of things going over here.
First thing that happened was
a Docker image was built for it.
That's going to push it up to the registry and
then it's going to deploy it to Kubernetes.
So, in one key command,
it actually encapsulates a lot of
the instructions that I needed or there a lot of
the steps needed to take
this app and put it up and running in Kubernetes.
>> Great. And is this going to be running locally and
mini cubers is going to be
an AKS where this is actually going to be?
>> So, the extension itself actually just
looks at whatever clusters you have configured?
And so, right now this one is actually
up and running in AKS.
But if you are using
Mini Cube on your own computer locally,
maybe an airplane like it will use that config as well.
>> Got it.
>> And in fact, it actually makes it super easy for
you to create a Kubernetes cluster.
You can actually just say, "Kubernetes create cluster."
And it's going to walk you
through a pretty to use easy flow.
So, maybe you start with Mini Cube,
get it up and running.
You want to get to the cloud. Don't even leave VS Code.
You're creating a Kubernetes cluster.
So, it's pretty handy and it
obviously integrates so then,
deploying works and things like that.
But, I want to show another thing over here which is
the little tab down here that says, Kubernetes.
So, if we expand that tab,
then I'm going to scroll it
up a little bit because we need a little bit of space.
I now see this tremendous cluster that I have
configured and if I preview into this,
now you're going to start seeing all the
objects that are in that cluster.
>> Okay.
>> And in particular, I don't know if you noticed,
but it said down in the lower right
that it created a deployment
called Simple Node and that was going to
deployed that code up there.
And in fact, if we go in here to the deployments,
what you'll see here is this
deployment called Simple Node.
>> Okay.
>> And now actually when I click on it,
I'm actually seeing the JSON
that is associated with that object in Kubernetes.
Now, if I'm a new node developer,
I suddenly gone from JavaScript which
I maybe comfortable with this spew of JSON,
I'm a little wigged out by.
So, one of the things that the extension will do,
is you can actually say, "Kubernetes describe."
And now it's actually in describe mode.
Sorry, that's wrong. That was the command.
Kubernetes explain and describe.
Now, it said they explained API as activated and
now as I highlight different things,
I'm actually going to get a little pop up.
It's going to show me this is what
this field and this JSON is.
So, now it's still big in
Amsterdam if I learn about it but I
can learn about it piecemeal,
if I'm curious about a particular thing like replica,
as I'm going to go see get
a little description of what that field is.
So, for every what field I might want to edit here,
I can actually begin to
understand what the actual API objects are.
>> Just give me some really rich tool tips that are
going to help me make sure I don't make
a mistake or I understand what
this value is and I'm about to change or manipulate.
>> Right.
Because that means if you have your perspective,
I just deployed this container.
And suddenly there's all these fields
and some of them are important.
Maybe like replicas is important because if I
change that I'm going to get three or four or five.
>> Sure.
>> Some of the others maybe like
the generation or the resource version,
that's really just used by Kubernetes.
This is not something I necessarily need to mess around
with especially in a getting started scenario.
>> Nodes like API have deep links
into more reading for some of us.
>> Yes so, it links into
the Git repo and a lot of stuff like that.
So, really is an easy way
to get oriented to the Kubernetes API.
>> Okay.
>> But even cooler, we can actually go over
here and find the container itself.
So, if I have my pods over here,
here's the actual container that's up and running.
I mean I actually closed this.
It's not what we need to
do but actually if we right click on this,
well you're going to see here is actually we have
a bunch of contextualized menu items.
So, I can look at the API object that actually with
the container there is a bunch of more
interesting things that I can do.
For example, I can get a terminal inside that container.
And so, now it's going to
happen is it's actually connecting up to
that cluster and now it looks like it's a terminal.
And it is. But it's actually
running in that container up in the cloud.
>> Nice.
>> And so, if I actually do LS I'm
going to actually see that server.
It's a very simple container
so less is actually not installed that is cat.
>> Yeah.
>> There's my code up and running, right?
>> Awesome.
>> And actually the fact that less wasn't
installed really shows you
it's not running on my computer.
>> Sure.
>> It is installed on my computer and we
can use this for debugging or whatever.
>> I saw that. It is that attach debuggers
so I'm able to set breakpoints.
>> Yeah, with Node.js in particular,
you can attach breakpoints and integrated debugging.
And as well as if we pull out of the terminal,
we can actually go and we can see the logs.
And so,
now you can see that the server is up and running.
Inside this, I can actually say, can control.
So, I've actually created
a website. That's right click again.
>> Yeah, but there's
a services over here I could
have gotten the same information.
>> You could definitely
get the same information over there.
So, with the integrated command line
inside of the code, you can go either way.
>> Sure.
>> You're comfortable with the command line, go there.
If you want to explore more,
right click. You can do that.
So, now you can actually copy
that IP address on shift copy, I guess.
>> There's a point where you think, "Maybe I could
have typed it in faster.".
>> Maybe I couldn't just copy and paste it,
but that's all right.
We'll go over to our web browser and we'll
actually put that IP address in.
And there is our code up and running.
>> Sure.
>> And so, we've actually just maybe,
I'm not my sleeves are you actually taking our code and
deployed it up to Kubernetes up running in Azure.
And so, at this point, I'm actually
maybe done with what I'm doing and I'm
going to go over here and find
my deployment and I
can actually just say, all right I want to delete it.
So, we're going to delete that.
It's tearing it down.
>> Services pods, everything you're getting cleaned up.
>> Everything is getting cleaned up
and there's nothing left.
And at this point if I make code changes, I can redeploy.
>> Sure.
>> Just move through it that way.
So, it just shows you I think that simplifying the path
from code to cloud is
a really important piece of what
a developed environment does these days.
>> Sure.
>> And with this Kubernetes extension in VS Code.
I think we've really managed to make it
super easy for somebody to kick the tires.
But, actually learn about
Kubernestes along the way and get
that path into cloud development.
>> Yeah, because I mean it's one thing to give
me that quick on-ramp.
But, if you don't
teach me what happened, if you don't allow me,
then if something goes wrong,
I'm literally having to start over?
Because it did not understand. So, having those really
verbose and enrich tool tips.
>> Yeah.
>> Allow me to feel a little bit more comfortable
to go in there and make some of these changes.
>> Exactly. And I think we really want
to have that progression
from people using the magic if you will.
The stuff that we've built through learning
about the API and editing objects themselves.
I think that gradual learning and gradual progression as
people need the extra information
and their app becomes more complicated,
that's a really important piece of
what the IDE can do for you.
>> Cool. So, where do people go to learn more about
this extension and all these cool stuffs?
>> Sure. Yeah so, the extension itself is
as with VS Code is all open source.
It's up on GitHub under Azure VS Code Kubernetes tools.
There's a bunch of people actually from
around the world who've been contributing to it.
And if all you want to do
is install the extension and play around with it,
you can either go to the visual studio
website itself or within visual Studio Code.
You just search for Kubernetes and
install the extension from within visual Studio Code.
>> Awesome. Thanks for coming and showing us this stuff.
We're learning all about using Visual Studio Code to
deploy Node and Kubernetes here on Azure Friday.