[MUSIC PLAYING]
BRIAN DORSEY: I'm Brian Dorsey from Google Developer
Relations.
And this is Eric Johnson--
ERIC JOHNSON: Hi.
BRIAN DORSEY: --also from Google.
And we have with us today from SaltStack Joseph Hall.
JOSEPH HALL: Hey, guys.
BRIAN DORSEY: And we're going to talk
about how SaltStack and Google Compute
Engine work very smoothly together.
So Compute Engine itself is virtual machines
hosted on Google's infrastructure.
It's disk, network, and the virtual machines.
And what's SaltStack?
JOSEPH HALL: SaltStack is a configuration management
and automation framework.
And it's designed for ease of use and speed.
And it's geared especially for massive scale and flexibility.
BRIAN DORSEY: Massive scale is a good fit.
Let's go straight to the demo.
ERIC JOHNSON: Absolutely, OK, so for the demo today, what we're
going to do is use Salt to spin up four Compute Engine
instances and configure them as Salt minions.
We'll install Apache and a custom index dot HTML page.
We'll open up port 80 to allow HTTP traffic in.
We'll set up a Compute Engine load balancer.
And then we'll demo that out, make sure
that everything's working correctly.
So if you're interested in wanting to repeat this,
we have a Get Help repository set up.
And I'll show you links at the end of this.
But this goes through all of the details on what we
did to get this demo set up, including
all of the configuration that you would need to have set up.
But what we'll do for the purposes of this
is we'll just skip right down to Demo Time.
And the first command I'll show you
is how we can use Salt Cloud, which
is a utility baked into Salt, to go ahead and create
four Compute Engine instances.
So why don't you tell us a little bit
about Compute Engine.
BRIAN DORSEY: Awesome, OK, so, like I said,
this is virtual machines on Google's network
infrastructure, Google's infrastructure
all the way through.
And the whole system is designed to be fast.
And this is fast and consistent.
So we've got instances booting right now.
In fact, they just booted.
So that was four instances that allocated new block storage
devices, copied over the boot image
to those-- the latest image-- actually booted from them
and handed off to a script to run whatever software
you want to run.
And in this case, that is Salt.
So, Joseph, what's going on here?
JOSEPH HALL: So once the Salt Cloud
determines that the machine is up and running
and ready to be connected to, then it's going to log in.
And it's going to upload this bootstrap script for Salt.
That's going to detect the operating
system that it's running on.
It's going to configure the repositories for that OS,
and download and install Salt, and get it up and running,
and get all the keys accepted and ready to go
so that we can start throwing Salt Cloud
commands at the instance.
And since Salt itself is an automation framework
and remote execution engine, then
we can throw commands at it to figure which packages need
to be installed, to find which files need to be laid down
in the system and what they need to look like, and also
throw remote execution commands at it
and have it perform just our regular tasks that we perform
on a regular basis.
BRIAN DORSEY: Nice.
ERIC JOHNSON: Yeah, so I think it looks like we're probably
just waiting here for the last couple ones to finish.
And there they come in.
So what we should end up seeing is a list
of attributes for each of these instances
once it goes ahead and displays.
And sure enough, there's the JSON output for each of these.
So what we're going to want to do next
is show you a little bit about Salt's remote execution.
And we'll use this command over here.
And what I'll do is paste that in.
And what this is going to do is it's going to use Salt.
And the asterisk there means to match all of the minions.
And it's going to execute a command with the command dot
run module, or the command module.
And it's just going to execute the uname-a function
across each those or the command,
and then automatically return those results back.
So you can see it executed all those in parallel.
We didn't have to wait for each one of those to complete.
We got all of the data back.
So that verifies that everything was provisioned correctly.
The minion is listening for commands from the master.
So the next thing I want to do is go ahead
and use the high state command.
And what this is going to do since I have this already
configured ahead of time-- what those configuration files
I have set up ahead of time, it's
going to go ahead and install Apache
on each of these instances, and then
lay down a custom index dot HTML file.
The index dot HTML file that we lay down
is going to have the host name of that instance baked into it.
The next thing I want to do is I just
want to make sure that since I'm going
to be doing this is a web server-- so I want to make sure
that port 80 traffic is allowed.
So we'll go ahead and use the Salt Cloud utility to configure
Compute Engine's networking firewall
rules to allow TCP colon 80.
And it looks like that command is completed successfully.
And the next thing I want to do is use Salt Cloud again
to configure Compute Engine's load balancer.
Let me just paste that in there.
And then hopefully Brian can tell us
a little bit about load balancing.
BRIAN DORSEY: Yes, this load balancer
were configuring right now is actually
a Google data center level load balancer.
So if you're interested in more this
is a very powerful load balancer.
It's aware of the health of the instances as they come and go.
And we published a blog post recently
where we documented testing this out
to 1 million queries per second without any pre-warming at all.
So it's really powerful.
ERIC JOHNSON: Great, and so we've already got
it configured.
And one of the attributes that comes back from here
is the public IP address for this load balancer.
And so it's a single IP address.
Now, in this case, I only have four instances,
but let's say I have 200 instances behind.
I can still send all my traffic just to that single IP address.
So let's go ahead and see what happens.
If things worked correctly what we should be able to do here
is see the web page for each of our instances served up
through our load balancer.
So it should--
BRIAN DORSEY: Nice, as the color-- oh, just changed.
ERIC JOHNSON: Yeah, so hopefully, we've seen what?
One and three.
There's four and two.
So it looks like all four of them
are provisioned, being successfully behind the load
balancer.
And we did all of that with Salt.
BRIAN DORSEY: Excellent.
ERIC JOHNSON: Here's some links for more information.
So as I said, there's a Get Help repository
if you want to replicate all of this on your own
as well as a link over there to the documentation that
shows all of the functionality that is available to you
for Compute Engine from Salt, and more information
about the Google Cloud Platform and SaltStack.
And I'd like to say a very special thank you
for Joseph Hall for joining us today to talk about this.
JOSEPH HALL: Thanks, guys.
BRIAN DORSEY: And thank you for watching.