MIKE COLEMAN: Hi, I'm Mike Coleman, a developer advocate
at Google Cloud.
In this video, I want to introduce you to Kf.
As your teams standardize on Kubernetes,
migrating applications from existing platforms,
like Cloud Foundry, is often one of the biggest challenges.
Kf was designed to help teams minimize any disruption
to developer workflows during the migration to Google
Kubernetes Engine and Anthos.
Kf offers developers the Cloud Foundry experience,
while empowering platform admins and operators
to adopt declarative Kubernetes practices.
It makes migrating Cloud Foundry workloads
to Kubernetes straightforward, and most importantly,
avoids major changes to application developer
workflows.
You can also eliminate commercial Cloud Foundry
licensing costs and take advantage
of the config and policy features of Anthos and GKE
for governance.
Before I show you a demonstration of Kf,
I wanted to talk a bit about the architecture
and how we map Cloud Foundry primitives and services
to Kubernetes.
Kf requires Kubernetes and other open source projects to run.
Some of the dependencies are satisfied
with Google-managed services.
For example, Google Kubernetes Engine
provides the Kubernetes backend.
In addition to Kubernetes, Kf leverages
Tekton to enable Kf build, which can handle both Buildpack
and Docker file builds.
To take care of setting up routes for applications,
Kf uses Anthos Service Mesh, which
is built on Google's Manage Istio offering.
By default, Kf includes native integration
with Google Cloud's Cloud Monitoring and Cloud Logging
services.
This integration lets you monitor your running clusters,
and help analyze your system and application performance,
using advanced profiling and tracing capabilities.
On the monitoring side, Kf has both an application performance
dashboard, which provides information
on metrics such as requests per second, round trip
latency, HTTP error codes, and more,
as well as a systems dashboard, which has data
on nodes, pods, containers, et cetera.
Kf installs several of its own Kubernetes custom resources
and controllers.
The customer resources effectively
serve as the Kf API, and are used by the Kf CLI
to interact with the system.
The controllers use KFCRDs to orchestrate
the other components in the system.
You can view these resources using kubectl.
Before we jump into our demo, I want
to talk for just a minute about service brokers.
Service brokers are software components
that provide an abstraction of manage service life cycles
across different platforms.
Kf supports service brokers that are
built according to the open service broker specifications.
Currently, Kf only supports credentialed services.
Special services, such as syslog drains,
volume services, route services, service keys,
and shared services aren't yet supported.
In the demo, I'll be using the Cloud Service
Broker to provision a memory store for Redis instance.
On that note, let's jump into the demo,
where I'll show you how to deploy the spring music
app to Kubernetes using Kf, as well as how
to provision and manage a Google Cloud based Redis service
as the backing data store.
As we start our demo, I've actually
already set up my cluster-running Kf,
so there are my nodes.
And I've also already configured the marketplace, or the Cloud
Service Broker.
So we're going to use this Redis service here later in the demo,
but I just want to point it out right now.
So the first thing we're going to do
is create a space to hold our app.
So I'll create sm-space for spring music space,
and then we'll go ahead and target that space.
And now, if we do a Kf spaces, you
can see the space we just created,
right there listed sm-space.
The other thing is if we go in and we kubectl
and we say get spaces, we can see the name space
for sm-space, so that's going back
to where Kubernetes primitives are being
mapped into Kf primitives.
So let's go ahead and push our app out,
so we'll just do a Kf push-- we're already
in the directory with the repo.
And that's going to go ahead and upload the source,
and going to compile it.
It's going to take a little bit, so I'll fast-forward the video,
and I'll rejoin you when it's done.
With the application deployed, let's go ahead
and visit it in the browser.
So clear the screen.
I'll do a Kf apps, and that will show me
the route to the application.
And I'm just going to go ahead and grab that URL right here,
and we're going to copy that, and we're
going to paste it into a new tab in our browser.
So I'll move up here, create a new tab, paste that in,
and there's our application running.
Now what I want to do is I want to come over here and point out
that we're not using any profiles or services.
We're going to add those in the next step.
But I do want to add a record so I can
have something in the database.
So I had this Paul McCartney record.
I'll scroll down, and you can see
that that has been written to the local data store.
So now what we're going to do is we're going to go back
and we're going to connect Redis into this.
So let's move back into the command line.
I'm going to go ahead and clear the screen,
and then what I'm going to do is I'm
going to issue the Create Service command,
and that's going to create that Cloud Service-backed Google
Redis database in a high availability mode,
and connect it up to our application
in the spring music space.
This is going to take a little bit,
so I'm going to pause the video, and I'll come back to you
when it's finished.
All right, the service has been created.
And if you look up here in the console,
you can see here in Google Cloud where we actually have created
that memory store with Redis.
So now the next step is to go ahead and bind that
into our application.
So let's do that right now.
So we'll clear the screen, and then
we'll do a Kf bind service here, and what we'll do
is we'll bind the spring music app to the Redis
database we just created, and that'll take just a second.
And then when that's done-- which it's done now--
we're going to go ahead and we're
going to restart our application.
So we'll do a Kf restart spring music.
That will allow that new binding to take effect.
So we give that a second, and then what we're going to do
is let's head back into the web browser,
back into our application.
I'll refresh it, and then we'll move over here,
and you can see now that we're using the Redis
profile and that database.
And if I scroll down, the record that I added to the local store
is no longer there, because we're using the new Cloud-based
Redis data store.
All right, let's move back into the Cloud Console.
And I want to show you just a couple more things
before we wrap up.
So the first is Kf bindings, just
so you can see the service bindings here,
and we'll list that out, and you can see that the database is
bound to the application.
So I'll clear the screen again.
The other thing that I want to show you
is that the vcap-services are all listed out,
so that standard methodology for mapping services to apps
is available to you, and there you
have the JSON for all of that.
There you have it.
That's Kf in a nutshell.
Now, if you need more information,
check out the links below, and don't
forget to like and subscribe so you'll be notified
when we create new content.
[MUSIC PLAYING]