BUKOLA AYODELE: Many apps have a common boilerplate.
It would be great if there was a way
to reuse infrastructure templates
to deploy multiple services.
Let's see how kpt helps Bob manage this.
Bob is a lead on the application development team,
which is currently in a crunch.
They need to launch 10 apps for an upcoming deadline.
Most of the effort is in the common infrastructure,
but each app requires certain modifications
that are hard to manage in a consistent way.
Bob's first instinct is to copy and paste Kubernetes manifests
between projects.
But this has many downsides.
Manually having to make changes to copy-pasted code
is time-consuming and error-prone.
In an ideal world, Bob would be able to define
standardized configuration templates,
customize setting for each specific application,
and then modify them all as a unit.
What Bob needs is packaging.
And with deadlines looming, he needs it pronto.
Bob asks Charlie for help, who introduces him
to Ida, a developer on the platforms team.
Ida explains the benefits of config as data and shows
Bob how to use templates with kpt to reuse customized project
boilerplate, which dramatically accelerates Bob's work.
Kpt is an OSS tool for Kubernetes packaging, which
uses a standard format to bundle, publish, customize,
update, and apply configuration manifests.
Its git plus YAML architecture means
it just works with existing tools, frameworks,
and platforms.
Kpt is built around a config-as-data architecture
that bundles up Kubernetes resource configuration.
This format is readable for both humans and machines,
and is a source of truth for a declarative platform.
The benefit of reading and writing
the package content using standardized data structures
enables kpt to apply bulk updates, creation, and deletion
of projects, run user-defined functions
to apply custom behaviors to config files,
seamlessly integrate into the Kubernetes infrastructure,
and more, which is exactly what Bob's team needs.
Say we wanted to work with Kubernetes example repositories
for demo's sake.
We could run the kpt pkg get command
to fetch the entire directory.
This has a lot of files.
No fear, though.
We can use the kpt cfg count command
to summarize the files in a easier way to read.
You can do a lot more with filtering and listing resource
in different ways, but I want to take a second
to focus on using kpt to update and validate config files.
Let's take a look at an example.
If we used the kpt cfg list-setters command,
we can see which values were able to use the kpt tool.
So this package contains three setters
we can use with the kpt set tool and the current value
of the properties.
Let's set the number of replicas to 3.
Now one of the benefits of a tool like kpt
is its ability to use functions to apply changes
like this on a number of config files at once.
So I urge you to look into the resource link
below for a walkthrough on that.
And there you have it.
With kpt, you can easily create, and customize, and compose
configuration packages, while adhering
to the configuration-as-data philosophy.
With this knowledge, Bob is able to quickly get
his application spun up in time to meet the deadline.
So that's it for kpt.
Make sure to check out the description for links
to more resources on it, and Like
and Subscribe to the channel for more videos about Google Cloud.
Thanks for watching.
[MUSIC PLAYING]