►
From YouTube: ytt An Alternative to Text Templating of YAML Configuration in Helm Nima Kaviani, IBM & Dmitriy K
Description
Join us for Kubernetes Forums Seoul, Sydney, Bengaluru and Delhi - learn more at kubecon.io
Don't miss KubeCon + CloudNativeCon 2020 events in Amsterdam March 30 - April 2, Shanghai July 28-30 and Boston November 17-20! Learn more at kubecon.io. The conference features presentations from developers and end users of Kubernetes, Prometheus, Envoy, and all of the other CNCF-hosted projects
ytt An Alternative to Text Templating of YAML Configuration in Helm Nima Kaviani, IBM & Dmitriy K Pivotal
A
And
we
would
like
to
present
it
as
an
alternative
to
the
text
templating
that
we
do
using
go
text
templating
in
help.
My
name
is
Nemo
Cavani
and
I
am
a
software
engineer
with
IBM
and
I'm
here
with
my
friend
Demetri
Kalinin,
who
works
at
pivotal
and
also,
as
a
software
engineer,
all
right
so
with
kubernetes.
You
know
becoming
the
platform
for
deploying
applications
to
the
cloud
and
it
being
like
a
declarative
system
in
which
you
know
a
lot
of
the
configurations
are
expressed.
A
So
as
I'm
gonna
go
through
these
and
you
know,
do
a
quick
comparison.
I've
lost
all
of
us
all
of
these
I
want
to
just
do
a
check
in
the
room
and
see
who's
used,
which
one
of
these
tools
in
the
system
so
go
text
templating.
Obviously,
all
right,
I
think
pretty
much.
Everyone
here
is
used.
Help
right,
who
has
used
like
overlay
tools
like
customized
great
how
about
configuration
languages
like
Dahl
and
JSON?
Oh
cool,
and
there
are
also
this
decays
right,
plumie
right.
A
Anybody
using
clue,
nice
and
finally,
like
you-
can
do
everything
with
a
with
a
full-blown
language
right,
Python
or
Ruby.
Anybody
has
tried
it
great
all
right,
so
we're
gonna
do
a
quick
comparison
of
all
these
different
tools,
and
you
know
just
a
disclaimer.
It's
subjective
right.
It's
based
on
our
perceived
way
of
you
know
how
each
one
of
these
tools
basically
solves
the
problem.
So
text
templating,
you
know
all
of
you
are
familiar
with.
You
know
text
inflating
using
go
text
templating,
but
you
can
also
do
it
with
ginger
I.
Think
app.
A
It
on,
for
example,
uses
ginger
for
the
templating.
The
one
primary
thing
with
text
templating
is
that
they
treat
these
configuration.
Documents
is
text
right,
which
essentially
means
that
you
have
to
do
things
like
indentation.
You
have
to
do
character,
escaping
etc,
etc,
and
then
it
becomes
hard
when
you
want
to
actually
include
like
provide
modulation,
and
you
know,
make
libraries
and
include
them
in
one
another.
A
If
you're
familiar,
for
example,
with
the
way
home,
does
it,
you
probably
have
seen
a
lot
of
curly
braces
around,
you
know
functions
that
you
have
to
import,
and
another
problem
is
that
you
know
once
you
start
templating
these
documents,
they're
the
syntax
that
you
use
for
templating
diverts
from
the
syntax
of
the
document
itself.
So
you
end
up
with,
for
example,
writing
code
go
code
inside
a
llaman
document,
not
ideal
right,
but
that's
one
option,
certainly,
and
you
know,
helm
being
a
super
popular
tool.
A
They're
domain-specific
languages
like
Josh,
sonnet
and
doc,
and
typically
one
of
the
big
problems
with
these
is
that
you
have
to
learn
the
new
language
right.
It's
and
because,
like
there
is
no
proper
community
support
for
it.
Usually
it's
that
there
is
no
editors
and
that
you
can
actually
use
write.
So
there's
not
that
much
tooling
built
around
it,
but
you
know,
like
people
seem
to
like
JSON,
for
example,
and
they've
been
using
it.
A
So
it's
certainly
out
there
and
has
its
own
group
of
people,
and
the
other
group
is
SDKs
right
and
pull
Umi,
for
example,
is
one
of
the
popular
ones
and
I.
Think
the
thing
with
Pulu
me
or
like
SDKs
is
that
they
have
a
steep
learning
curve.
They
are
way
beyond
providing
configurations
right
in
case
of
parlament.
You
can
do
an
entire
deployment
of
the
system
to
blue
and
because
the
learning
curve
is
steep,
it's
kind
of
hard
for
people
to
on
board
and
also
kind
of
moves
away
from
that
declarative.
A
Nature
of
is
specifying
configurations,
and
you
start
actually
writing
program,
so
it
becomes
more
finally,
programming
languages,
right,
Python
and
Ruby.
Nothing
stops
you
from
actually
explaining
or
describing
the
entire
configuration
using
maps
and
arrays
in
Python
and
Ruby,
and
then
dumping
it
out
as
JSON
or
Yammer
files
right.
But
then
one
of
the
primary
problems
is
that
there
is
no
sandboxing
around
the
configuration
that
you
develop.
So
you
have
to
be
super
careful
if
you
want
to
run
someone
else's
configuration
about
what
this
configuration
is.
Gonna
do
to
your
host
machine,
for
example.
A
Right
also,
you
know
it's
not
very
convenient
to
to
basically
design
more
complex
configurations
in
the
form
using
you
know,
like
maps
and
arrays
in
a
custom
programming
language
because
they
were
just
not
meant
for
it.
So
with
all
of
that,
I
think
what
we've
developed
is
ytt,
which
is
kind
of
an
alternative.
A
It's
still
like
a
templating
language,
but
the
difference
is
that
you
know,
unlike
goat
and
text
templating
or
other
text,
templating
language,
its
structure,
where,
in
the
sense
that
it
understands
the
structure
of
a
young
document
in
a
sense
they
know
they
don't.
You
know
it
understands
their
Maps
and,
as
a
result,
it
kind
of
solves
some
of
the
problems
that
you
had
to
deal
with.
Otherwise,
like
you
know,
for
example,
indentation
or
skipping
of
characters,
it
uses
a
pythonic
language
for
templating
and
we
believe
by
using
Python,
because
Python
is
a
quite
popular
language.
A
It's
actually
easy
for
people
to
get
on
board
and
start
using
ytt.
It
supports
both
declarative
and
imperative
constructs.
You
can
have
more
complex,
conditionals
and
loops
in
your
templating
very
similar
to
how
actually
it's
done
in
go
tech
go
tech
templating
in
hell.
It
allows
for
modular
ization
of
configurations,
you
can
actually
write
functions
and
then
you
can
have
functions
in
separate
libraries
and
export
and
reuse
them.
A
It
supports
data
injection,
so
you
can
actually
provide
data
to
the
configure
to
the
templated
configurations.
It
supports
the
structure
emerging,
so
it
actually
provides
facilities
to
do
things
that
you
can
do
with
customize
like
adding
overlays
and
injecting
data
and
removing
elements
from
configurations
and
finally
provides
assertions
and
that
you
can
use
in
order
to
do
validations
in
your
configurations.
A
B
B
After
the
node
now
we've
decided
to
assign
some
meaning
to
those
comments,
so,
as
you
may
be
familiar
with
annotations
within
Java
right,
there's
a
little
add
symbol,
so
we
kind
of
stole
that
and
we've
decided
to
kind
of
break
down
what
a
typical
llamó
comment
would
look
like,
but
it
has
some
meaning
to
it
right.
So
we're
broken
down
annotation
into
two
pieces,
the
the
name
port
and
some
kind
of
a
value
part
now
we'll
get.
B
You
know
we'll
get
shortly
into
why
this
is
useful,
but
this
is
how
it
would
look
like
if
this
would
be
I
guess
white.
It
is
internal
representation
of
what
it
what
it
sees
in
llamó
now
this
is
what
typically
a
human
would
write.
So
the
the
defaulting
for
the
annotation
name
is
happening
automatically,
and
you
know,
as
you
can
see
over
here,
this
example
always
saying
is:
there
is
a
conditional.
B
The
conditional
is
wrapping
the
entire
Yamanote
and
we
have
a
value
that
we're
trying
to
assign
to
the
name
node
right
now
give
it
our
annotations
are
fairly
flexible.
You
know
we
can
have
different
types
of
annotations,
so
this
example
annotation
that
allows
us
to
say
that
it's
okay
to
specify
the
same
key
twice
within
the
same
map.
So
in
this
case
yeah
Mon
map
key
override,
is
there
annotation.
Some
annotations
may
also
take
arguments
to
what
they
do
right.
B
So
with
your
annotations
as
function
calls,
and
so
in
this
particular
example,
we
try
to
match
some
particular
node
by
value
of
the
UID
key
within
that
array.
Element
so
you'll
see
a
full
example
in
a
second,
so
yeah,
so
how
do
we
actually
get
to
use
that?
So
this
is
a
simple
kubernetes
example
that
that
demonstrates
some
of
this.
Some
of
this
usage
so
in
this
particular
slide,
we're
showing
you
over
here.
This
is
how
you
set
the
value
to
map
map
item.
The
value
comes
out
over
here.
A
B
Is
developed
by
google,
they
used
it
in
puzzle
as
well
a
puzzle
build
system,
so
it
allows
us
to
give
that
nice
syntactic.
You
know
properties
to
the
templating
language
itself,
so
here's
another
example
of
setting
a
value
to
an
array
item
this
time
over
here,
note
that
it
automatically
gets
escaped
and
that's
just
the
property
of
using
the
llaman
library
to
serialize.
You
know
what
we
have
on
the
left
side
right.
So,
as
a
user,
you
don't
have
to
worry
about
putting
quotes
around
it.
B
C
C
B
In
this
particular
example,
we
have
a
single
node,
restart
policy.
Now
imagine
if
you're
doing
a
lot
of
conditionals
in
your
template,
it's
a
little
bit
annoying
right.
To
put
you
know
if,
at
the
top
and
the
end
at
the
bottom
right,
so
we
decided
to
introduce
this
special
syntactic
sugar.
There
are
others
to
do
it
in
a
single
line
and
because
we
attach
the
metadata
to
the
Yamanote,
it's
only
it's
only
applicable
to
the
restart
policy
map
item
over
here.
Alright.
B
So
going
on
to
the
next
example
of
year,
we
have
a
for
loop
for
loop.
It
similarly
is
only
attached
to
a
single
array
item,
so
it
gets
looped
over
here
and
given
that
there
is
a
to
services
right
on
the
right.
We
generate
two
service
array
items,
so
nothing
too
fancy
so
far,
now
a
lot
of
times
right
to
actually
configure
your
all
kinds
of
services,
not
you
wanna
share
some.
You
know
content
in
between
them
right,
so
here's
we
have
an
ability
how
to
use
a
function
or
define
a
function.
B
This
function
over
here
defines
two
map
items
and
it's
being
used
once
in
this.
In
this
example
right
now,
you
can
use
it
as
many
times
you
want
and
even
better
you
can
even
split
that
off
into
its
separate.
You
know
file
and
you
know,
use
it
in
any
file
that
you
import
it
over.
You
might
be
familiar
with
if
you're
familiar
with
puzzle
build,
you
might
see.
You
know
a
similar
kind
of
a
load
instruction
to
load
this
kind
of
external
functions
as
new
mansion.
B
The
earlier
on,
you
know,
overlay
tools
like
customize,
have
you
know
particular
uses
right
and
configuration
landscape,
they're,
typically
useful
for
consumers
of
configurations
to
you
know
to
customize
their.
You
know
whatever
they've
taken
up
from
upstream
right.
Typically,
you
know,
you'll
see
it.
You
know
by.
It
may
be
like
changing
a
particular
portion
of
a
llamo
to
maybe
a
in
kubernetes
wall
to
change
the
image
or
change
something
else
right.
B
So
we
have
a
library
called
overlay,
that's
built
into
y
TT
and
decided
to
take
advantage
of
this
annotation
functionality
within
ytt
to
give
a
more
consistent
way
of
how
to
insert
update
and
remove
notes
within
Yunel
documents.
Now,
if
you're
familiar
was
customized,
there's
a
different
syntax
right
between
updating
and
inserting
versus
how
you
remove
a
note
right,
because
there
is
no
way
for
customized
to
actually
as
a
part
of
a
document,
to
indicate
that
they
are
gonna.
Remove
a
note
now
in
in
case
of
ytt.
We
actually
can.
B
You
know,
introduce
that
information
so
we'll
get
to
that
in
a
second.
In
this
particular
example,
though,
we
have
a
way
to
update
a
note,
write
a
note
over
here
that
we're
first
indicating
which
documents
should
be
selected
for
the
update
right.
So
we
have
kind
ingress
and
by
default
will
only
match
a
single
document.
But
if
you
want
to
match
multiple
documents
within
your
document
set,
then
you
can
add
additional
arguments
to
this
annotation
to
say
it's
okay
to
much
multiple
rain.
B
So
here
we
select
metadata
annotations
and
then
finally,
we
find
this
key
over
here.
Engine
X
ingress,
coronaries
limit
RPS
with
white.
It
is
knowledge
of
the
structures
were.
Actually,
we
actually
expect
that
these
keys
exist
on
the
left
side
right,
so
you
can
kind
of
view
the
overlaying,
as
there
is
a
right
side,
which
is
your
updates
and
then
there's
the
left
side,
this
existing
content
right.
So
within
those
structures
we
expect
that
those
keys
exist.
B
So
let's
say,
if
I
type
over
here
metadata
without
an
A,
it
will
actually
fail
and
tell
me
that
hey
I
can
find
that
key
key
on
the
left
side.
Now,
in
this
particular
case,
because
on
the
left
side,
everything
exists,
metadata
annotations
engine
X
ingress
annotation
of
year,
it
will
successfully
update
now
for
inserting
and
outright
as
I
mentioned,
because
it
will
fail
to
to
find
a
node.
B
We
actually
have
to
indicate
that
hey
this
key
is
missing
and
that's
okay,
you're
also
able
to
kind
with
select
and
I
guess
indicate
that
the
entire
subset
of
tree
may
be
missing
right.
So
this
this
avoids
a
lot
of
typos.
Given
our
background
working
with
cloud
foundry
configuration
whatnot
with
both
felt
that
it's
important
to
give
that
user,
give
the
guardrails
to
the
user
as
much
as
possible
and
finally
for
the
remove.
B
So
this
is
one
of
the
I
guess
more
unique
features
right,
because
we're
able
to
add
this
annotations
to
the
documents
were
able
to
indicate
in
the
same
type
of
format
that
hey
you're,
able
to
remove
a
particular
node
out
of
the
you
know
out
of
the
left
side.
So
it's
not
in
any
way
different
from
inserting
or
updating
just
have
to
add
additional
notation.
A
Alright
I
think
by
now
you
know
that
essentially,
ytt
combines
templating
and
overlays,
and
one
of
the
primary
reasons
we
decided
to
provide
both
functionalities
in
ytt
was
that,
as
we
were
thinking
about,
you
know
the
users
of
the
tool
we
identified.
Two
separate
personas
one
is
the
providers
of
the
configuration
and
one
is
the
consumers
of
the
configuration
and
for
the
providers.
You
can
think
of
them
as
people
who,
actually
you
know,
provide
these
configurations
and
put
them
out
and
essentially
what
they
need
is
like.
A
Stronger
and
language
constructs
write
more
powerful
language
constructs
because
they
want
to
give
their
users
options.
That's
why
they
need
facilities
like
loops
and
conditionals
in
venice,
specifying
their
configurations
and
the
templates
right.
But
on
the
other
hand,
we
have
the
consumers
and
one
of
the
primary
things
with
consumers
that
we
notice
in
the
community
is
that
oftentimes.
A
So
when
using
templating,
for
example
like
the
way
ytt
is
actually
implemented
to
use,
templates
and
overlays,
is
that,
for
example,
you
can
think
of
downloading
the
upstream
configurations
that
the
provider
is
already
supplied,
and
then
you
provide
your
own
values
and
that
allow
you
to
basically
adjust
the
provider
configuration
to
your
own
needs.
But
if
you
want
to
add
extra
customizations
through
overlays,
it's
going
to
be
yet
another
set
of
files
that
you're
gonna
pass
to
ITT,
and
the
combination
of
all
three
will
eventually
produce
the
sort
of
configurations
that
you
require.
A
Now
the
variant
we
think
currently
it
is
possible
with
home-
is
that
you
have
to
do
helm.
Template
of
your
chart,
get
the
configurations
and
then
I
applied
by
TC
video
overlays
that
you
require
in
order
to
do
the
modifications.
One
of
the
ideal
cases
that
we
envision
is
that
if
at
some
point
it
is
allowed
for
this
type
of
functionality
to
be
included
in
hell,
you
can
actually
combine
all
three
in
one
step
right.
You
can
do
the
same
templating
and
applying
of
the
values
and
then
pass
your
overlays.
A
In
fact,
what
is
interesting
and
I
think
I
want
to
bring
it
to
your
attention.
Is
that
a
while
ago,
Demetri
and
I
submitted
a
proposal
to
make
the
templating
engine
pluggable
for
helm,
and
the
goal
was
that
if
and
this
becomes
possible
and
when
this
becomes
possible,
hopefully
we
can
take
the
go
text
templating
out
and
replace
it
with
ytt,
so
that
all
the
features
that
we
explain
here
and
we
believe,
is
gonna-
make
the
life
serve.
The
users
of
helm
easier
can
be
used
by
basically
using
the
plug-in
in
all
right.
B
Dad
I
don't
know
how
much
I
think
five
more
minutes
is
all
the
God.
So
I
just
gonna
point
out
to
a
few
examples
that
we
have
in
a
repository
and
if
you
guys
are
curious,
you
know
take
a
look
at
all
of
these
examples
are
under
K
14
s,
that's
our
kind
of
a
little
open
source
umbrella,
where
we
just
put
lots
of
tiny
projects
under
so
ye.
T
examples,
that's
the
directory.
B
So
the
example
that
I
think
might
be
useful
to
to
show
is
a
quite
common
question
that
shows
up
in
kubernetes
slack
or
just
from
my
co-workers
is
a
I.
Have
a
I
have
a
username
in
the
password
I
need
to
for
docker
registry
I
need
to
make
kubernetes
llamo
configuration
for
it.
I
don't
want
to
run
a
separate
command,
cube,
CTO
whatever
to
create
it
because
I'm
using
all
of
this
configuration
files
and
whatnot,
how
do
I
do
it
so
with
ytt?
B
As
you
can
see
over
here
this,
this
template
just
uses
JSON
base64
and
data.
There
is
the
library
that
we
used
to
read
the
values
in
from
what's
been
injected
into
the
templates,
and
it
was
just
basic
configuration
that
typically
people
either
do
manually
or
through
bash
script
or
by
using
the
cube
city
I'll,
create
registry
I,
think
secret
yeah.
B
All
this
is
really
doing
is
just
throwing
in
base64
encode
with
the
values
that's
been
injected
and
then
throwing
it
into
a
little
map
over
here
and
then
finally
encoding
it
again
and
I,
guess
after
it
to
JSON
encoded
this.
So
this
is
an
easy
example
that
solves
potentially
annoying
problem
of
automation
for
at
least
some
of
the
users
of
kubernetes,
and
it
was
somewhat
teddies
for
me
delightfully
easy
to
to
do
in
ytt
when
I
first
did
this
as
an
example
for
someone
else,
I
think
maybe
I'll
scroll
through
a
few
examples
over
here.
B
So
recently,
I
was
taking
a
look
at
a
vault
helm.
Chart
I
think
that
was
recently
released
by
Hoshi
Corp,
so
I
pulled
out
a
few
examples
that
I
was
kind
of
I
was
kind
of
looking
at
and
seeing
kind
of,
how
does
the
goat
jump
learning
compares
with
the
ytt
templating
so
plus
is
just
indicated
separator
kind
of
before
after
so
this
is
a
basic
little
example
right
you're,
just
trying
to
you
know,
add
little
prefix
with
a
string
and
use
a
function.
That's
how
that
works
out.
B
C
B
Got
a
few
I
guess:
config
map
operations
going
on
over
here
I
when
I
was
doing
some
help
charts
when
I
was
creating.
My
charts
I
always
find
it
annoying
to
figure
out
where
the
indentations
are
and
if
I
screw
up
tabs
and
spaces
on
that.
So
that
kind
of
gets
rid
of
some
of
this
stuff
over
here
cleans
that
up.
C
B
Then
you
know
there's
some
conditionals
that
you've
seen
before
not
too
exciting.
What
else
is
going
on
here
is
some
looping
and
adding
the
you
know.
X
number
of
array
items
based
on
whatever
user
has
entered
into
their
extra
environment
variables,
that's
I,
don't
I,
don't
know
if
there's
anything
exciting
going
on
here.
This
is
actually
a
very
interesting
example.
B
So
I
noticed
when
I
was
converting
the
wall
helm
chart
to
Waititi
that
all
over
the
place
there
was
a
conditional
add
to
every
single
file
that
had
you
know
if
global
is
enabled,
then
do
the
code.
Otherwise
don't
do
anything
right.
So
supposedly
someone
just
needed
for
some
reason,
some
global
flag
to
turn
the
entire
ring
to
turn
the
to
turn
off
the
entire
thing
off.
So
one
one
interesting
combination
they
can
do
is
wait.
It
is
you
can
actually
apply
an
overlay
to
remove
all
of
the
documents
out
of
the
document
set.
B
That's
been
rendered
read
and
that's
kind
of
a
short
way
of
doing
it
right.
If,
if
you're
not
enabled,
then
match
all
of
the
documents
and
then
finally
remove
them
and
that's
pretty
much
it
so
I
found
that
kind
of
neat
example
of
that
so
yeah
I,
don't
think
I,
guess
maybe
one
more
example.
If
I
have
a
little
bit
of
time,
so
I've
experimented
with
pulling
out
some
of
the
generic
configuration
for
a
typical,
stateless,
app
into
a
separate
library.
We
call
that
Kate's
Lib.
B
What
you
can
do
is
this
right
is
because
ytt
you
know,
is
able
to
load
your
libraries
from
your
file
system.
Right
is,
you
know,
git
clone
the
super
repo
kind
of
enter
it
in,
and
you
know
included
in,
and
this
library
provides
a
handy
method
of
saying
app
that
make
an
app
that
make
takes
a
name
and
takes
your
container
configuration
of
a
right
container.
Configuration
could
be
as
simple
as
that
and
take
support.
Now
what
that
gets.
B
You
is
that,
gets
you
a
deployment,
horizontal
pulled
out
to
scaler
service
ingress,
all
of
the
typical
stuff
that
an
organization
may
want
right.
The
idea
is
not
necessarily
for
everyone
to
use
this
as
a
as
a
library,
but
rather
you
know
one.
You
can
kind
of
decide
for
your
own
organization.
What
that
library
could
be
right
and
have
all
your
team's
use
it
generically
and
to
is
maybe
even
just
to
to
have
something
more
I
guess
abstract
right
than
your
own.
You
know
individual
applications.
Now
you
may
have
a
question.