►
From YouTube: Getting Started Tutorials: ytt Part 2
Description
Getting Started Tutorials: ytt Part 2
Are you new to ytt and would like to know where to start? Varsha Munishwar (@vmunishwar), a ytt maintainer, continues to walk you through the process of getting started with ytt. Make sure to check out Part 1 here: https://youtu.be/DvApsPy0IrI
▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
0:01 – Summary of Part 1
0:50 – Sample deployment configuration
1:16 – Labels and selectors
1:52 – Deployment on Kubernetes cluster
2:22 – Problem demo
3:50 – Solution using a ytt feature
4:26 – Implementation details
5:46 – Better world with more edits :)
A
Hello,
everyone
welcome
to
the
part
of
the
getting
started
with
YTD
tutorial
Series.
In
the
first
part,
we
saw
introduction
to
YTD
what
kind
of
problems
ytt
helps
to
solve.
How
templating,
with
variety,
helps
reduce
boilerplate,
and
we
saw
ITT
in
action
with
few
examples
on
playground
and
how
to
run
ytt
on
CLI.
We
saw
how
to
extract
variables,
use
functions,
to
extract
common
code
using
conditionals
and
for
Loops.
Now
in
this
tutorial,
let's
look
into
a
slightly
more
involved
scenario,
where
ytt
can
help
us
avoid
kind
of
a
problem.
A
Have
you
ever
made
the
same
edits
in
multiple
places
in
your
kubernetes
configuration
manually?
As
you
might
be
aware,
this
can
be
error
prone
and
can
lead
to
misconfigurations
here.
Ytt
can
help
us
avoid
this
kind
of
problem.
Let's
say
from
an
example,
so
here
is
a
manifest
file
ready
to
deploy
to
our
kubernetes
cluster.
It
has
two
objects,
deployment
and
Service.
As
you
might
know,
the
deployment
contains
a
section
that
is
a
template
for
all
the
parts
that
are
going
to
be
created
here.
A
The
deployment
also
has
a
selector
and
it
is
used
for
relocating
any
parts
that
it
should
manage
once
the
parts
are
up
and
running
the
corresponding
service.
It's
used
to
direct
traffic
to
those
parts.
It
does
so
with
a
set
of
selectors
that
matches
the
labels
or
the
subset
of
labels
on
those
parts.
A
A
A
A
So
after
the
deployment
I
can
see,
the
deployment
is
subsided,
I
can
see
the
status
and
when
I
get
endpoints,
I
can
see
that
there
are
no
end
points
generated
and
let's
look
at
the
browser
window
refresh
and
the
site
cannot
be
reached.
So
obviously
the
deployment
is
successful,
but
the
service
doesn't
know
which
parts
it
should
route
the
traffic
to
there
would
be
no
IP
addresses
or
output.
So
that's
why,
when
we
look
at
the
application
we
get
nothing.
Now,
let's
make
the
change
in
in
our
deployment
configuration
to
match
all
the
labels.
A
So
now,
after
matching
the
labels,
I
redeployed
and
now,
let's
look
at
the
browser
and
I
can
get
the
response
back.
So,
let's
get
back
to
the
deployment
configuration
notice
that
I
have
to
remember
to
make
the
changes
in
all
three
places,
and
so
the
problem
is
that
there
must
be
some
way
that
guarantees
that
all
these
changes
stay
in
sync-
and
we
can
do
this
in
YTD
by
extracting
the
yaml
fragment
into
a
function.
A
A
So
this
is
how
we
write
the
yaml
fragment
functions.
These
are
yaml
structures
that
are
wrapped
in
starlock
function,
definition,
and
these
are
different
than
starlock
functions.
That
we
saw
in
first
part
notice
that
there
is
no
return
statement
over
here
and
everything
inside
the
function
will
be
the
return
value
these
are
used
when
you
need
to
return
a
nestodium
structure
or
key
value
pairs.
A
A
So
let's
make
one
more
change
in
the
deployment
EML
configuration
now,
if
I
want
to
add
some
more
labels.
To
this,
let's
say:
I
will
add
version
to
this
notice
that
I
just
have
to
update
label
at
one
place,
and
we
can
see
that
the
labels
are
updated
at
all
places.
So
this
is,
our
configurations
can
be
in
sync
with
yaml
fragment
functions,
so
try
using
these
functions
and
let
us
know
if
you
have
any
questions
please
reach
out
to
us
through
our
kubernetes
slack
Channel.
Thank
you
and
see
you
in
the
next
one.