►
From YouTube: Getting Started Tutorials: ytt Part 1
Description
Getting Started Tutorials: ytt Part 1
▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
0:01 – Introduction to ytt
0:56 – What problems is ytt solving?
5:25 – Ytt in action - Playground
6:00 – Simple Hello World
6:55 – Extracting variables
8:10 – Using functions
9:45 – Using data values
11:45 – Using for loop
15:10 – Using if conditionals
18:30 – Ytt in action - Locally
A
A
A
A
So
what
is
ytt
is
a
yaml
templating
tool.
Yaml
is
a
data
serialization
language
that
is
widely
used
for
writing
configuration
files.
What
is
meant
by
templating
templating
is
a
static.
Config
templating,
a
static
configuration
file
means
extracting
parts
that
I
know
my
end.
User
will
likely
want
to
change
or
add
logic
to,
but
why
do
you
need
templating
at
all
and
what
problems
is
why
it
is
solving.
A
Another
Advantage
is
like.
Are
you
tired
of
counting
spaces
and
indentations
to
make
sure
you
have
valid
yaml
and
repeating
this
for
each
and
every
configuration
file?
What
if
you
have
thousands
of
yaml
files,
ytt
templating
is
useful
for
avoiding
parsing
errors.
Ytt
operates
on
yaml
structures
instead
of
text
based
templating.
The
first
thing
ytt
does
when
it
is
processing
a
yaml
template
it
parses
that
file
as
yaml,
why
it
detect
CML
in
and
renders
guaranteed
valid
yaml
out.
A
This
eliminates
the
need
to
count
spaces
or
Escape
codes,
including
pipes
and
filters
for
indentations,
as
in
traditional
text-based
templating.
So
users
can
now
focus
on
their
configuration
needs.
Instead
of
issues
associated
with
text,
templating
ytt
uses
yaml
comments
to
annotate
structures
so
that
it's
no
longer
text
templating
but
structure,
aware
yaml,
templating,.
A
Another
issue:
you
might
be
well
aware
of
pain,
of
maintaining
patches
or
edits
and
configuration
files
manually
by
following
same
steps.
Every
time
you
do
the
deployment,
for
example,
say
if
there
is
a
third
party
yaml,
and
you
need
to
make
changes
to
that,
yaml
that
you
don't
own.
A
Another
problem
you
might
have
faced
is
when
you
need
to
template
and
apply
patches
together.
You
need
to
learn
and
work
with
different
tools
for
that
which
obviously
increases
the
complex
setting.
So
ytt
allows
you
to
template
and
Patch
as
needed
together
to
easily
make
your
configurations
reusable
and
extensible.
One.
A
A
Why
did
the
execution
environment
is
hermetic
and
side
effect
free
with
no
access
to
file
system,
Network,
timed
Randomness
and
operating
system
interfaces?
This
guarantees
that
templates
produce
identical
output
with
the
same
input.
Your
configuration
changes
only
when
you
change
it
now,
let's
start
playing
with
ytg
on
ytd's
playground.
This
is
the
interactive
playground
and
we'll
start
by
working
with
simple
hello.
World
example.
Then
we'll
just
slowly
introduce
extracting
variables
using
functions,
loading
data
values
using
conditionals
events
and
using
for
Loops.
So
let's
get
started,
I'll
open
my
playground
here
and
share
that
window
here.
A
This
is
the
interactive
playground
to
see
ytt
in
action
if
you
are
new
to
YTD.
These
are
some
examples,
organized
by
topics
so
that
you
can
familiarize
yourself
with
white.
It
is
key
features
if
you
are
more
advanced
user
and
if
you
need
a
quick
way
to
validate
how
ytt
would
render
your
files,
then
you
can
put
your
files
using
add
file
option
over
here
and
run
it
through
ytt
and
see
write
it
in
action.
What
what
output
you
will
get.
A
In
this
example
on
left,
we
have
SIMPLE
template
and
we
are
attaching
a
string
to
the
title
hello
world
welcome
to
IIT,
as
you
can
see
when,
when
that
renders
you
get
just
a
string
now,
if
you
notice
that
spacing
and
indentation
is
added
on
the
left
side,
that
is
been
taken
care
by
ytt
and
so
no
need
to
escape
output,
no
need
to
worry
about
indentations
and
no
need
to
ensure
that
well
formatted
output,
because
ytt
does
that
for
you,
it
brings
out
the
valid
EML.
A
Also,
if
you
notice
this
is
the
comment
and
it
gets
omitted
in
the
final
output.
A
A
So
hash
at
skips
into
ytd's
programming
language
that
is
Star
Lab
starlock
is
a
dialect
of
python.
Here
we
Define
local
variable
name.
The
variable
is
scoped
just
to
this
file
within
this
yaml
document
to
set
the
value
of
given
yaml
node,
we
start
with
hash,
add
and
followed
by
the
Starla
code,
resulting
in
the
desired
value
of
name.
B
I'll
bring
I,
have
the
name
in
this
values.
File.
A
B
For
loops,
so
this
is
our
example.
Now
what
if
I
have
multiple
Services
added
in
data
values,
file.
B
And
I
have
another
service
call
backend
and
I
want
to
generate
the
configurations
for
these.
B
For
this
service
I'll
add
a
for
Loop
here
for
before
that,
I
have
to
add
hash,
add
or
c
service
in
data.values
Dot
services.
B
This
is
how
I
will
add
a
for
Loop
and.
B
So,
for
name
instead
of
taking
it
directly
from
data
values,
name
I'll,
add
service
So,
based
on
a
name.
So
now
this
name
is
getting
rendered
from
data
values.
File
and
I
got
two
separate
configurations:
one
for
front-end
service,
one
for
backend
service.
This
front
end
is
appearing
because
I
have
it
hard
coded
I'll
update
it
here
as
well.
B
B
B
Let
me
update
the
version
as
well,
so.
B
B
Not
for
backend,
let
me
first
add
few
the
lines
over
here
for
HTTP
and
https.
B
B
B
B
B
Service
dot
allow
http
through
then
show
this
chunk,
and
so
now,
as
you
can
see
here,
I'm
configuring,
the
the
services
I'm
configuring-
how
these
services
are
being
exposed.
B
The
chunk
chunk
of
yaml
optional.
A
Can
use
various
features
of
ytt,
let.
B
So
now
we
saw
a
few
examples
in
on
interactive
playground.
There
is
another
way
you
can
try
out.
Ytt
examples
is
through
the
terminal.
A
So,
to
see
ytt
in
action
locally,
you
need
to
do
few
steps
like
follow
few
steps,
as
mentioned
here.
These
are
available
on
the
website
too.
B
B
This
command
git
clone
and
from
GitHub
cargo
ytt,
and
then
let's
go
to
Carvel
YTD
examples,
I
think
I'm
already
in
that.
A
B
Of
these
examples
so,
for
example,
LCD
to
example,
plane.