►
Description
Get your espresso ready for our Kubernetes Operators series here at OpenShift Coffee Break as we welcome our special guests Christophe Laprun (Software Engineer, Red Hat) and Sebastian Blanc (Developer Advocate, Red Hat) to talk about how to write Java Operators on Kubernetes!
A
A
A
C
B
A
Good
morning,
everyone
all
good
all
good
welcome
to
openshift
tv
coffee
break
our
other
episode
today
today,
I'm
here
with
andrea
fabio,
christopher
sandy,
the
hot
topic
of
today,
and
there
is.
D
B
We
have
we
have
today
christoph
and
sebastian,
who
will
talk
about
the
java
operator
and
without
further
ado,
I'd
like
them
to
introduce
themselves.
C
All
right,
sir,
shall
I
start
or
sure
yep,
so
I'm
hi
everyone,
I'm
a
software
engineer
at
red
hat
and
I'm
one
of
the
lead
developers
on
the
java
operator
sdk
and
it's
corki's
extension,
and
I
think
that's
what
I
mean.
That's
what
we'll
be.
C
Today
so
I
hope
we'll
we'll
have
an
informative
session
and
for
you,
folks
and
and
we'll
have
good
questions
and
good
interaction.
D
And
I'm
sebastian
blanc,
I
work
for
reddit
as
well.
I'm
a
developer
advocate.
I
work
together
with
dali
over
there
and
the
rest
of
the
team.
We
have
an
awesome
team.
What
we
do
we
make
developers
happy.
We
show
them
cool
stuff.
Honestly,
when
I
discovered
the
the
the
java
operator
sdk,
I
really
felt
in
love
and
and
well
it's
such
a
great
thing
because
you
can
combine
it
with
quirks,
of
course,
but
I'm
sure
stuff
will
show
you
that
I
have
also
things
to
show
if
needed
so
yeah.
I'm.
B
Well,
a
question:
first
of
all,
we've
been
talking
about
operators
for
a
while
and
different
ways
of
building
creating
operators
and
coding
them.
Why
java
is
java.
C
C
We
have
to
to
realize
that
java
is,
is
one
of
the
most
used
languages
in
enterprise
development.
So
it
makes
sense
if
you
follow
the
devops
philosophy
that
you
would
like
to
have
your
application,
which
is
might
be
written
in
java
to
use
the
same
language
over
the
whole
life
cycle
from
development
to
operation.
C
That
said,
traditionally
speaking
java
was
for
a
long
time
not
very
well
suited
to
live
in
containers,
because
java
was,
I
mean,
has
been
optimized
over
its
long
lifetime
for
long-running
processes
running
on
on
big
huge
servers,
and
it
was
basically
used
to
take
a
lot
of
space
all
the
whole
space
for
itself
and
in
containers
that
doesn't
play
very
well,
but
lots
of
improvements
have
been
made
on
the
virtual
machine
on
that
front.
C
So
it's
it's
a
lot
more
suitable
and
then
a
couple
of
years
back
cork
is
happened
as
well.
C
Quack
use
for
people
who
might
not
be
aware
of
it
is
a
java
framework
developed
by
red
hat,
which
allows
among
other
things,
because
I
mean,
personally
speaking,
I
think
the
best
thing
about
caucus
is
not
the
native
compilation
but
the
developer
experience,
but
it
allows,
among
other
things,
easier,
an
easier
path
to
towards
native
compilation
of
java
code,
and
even
though
java
has
improved
in
to
leaving
containers,
it
still
makes
sense
to
sometimes
combine
down
to
native
binaries
to
squeeze
out
every
performance
possible
and
so
that
that
makes
a
lot
of
sense,
in
particular
with
respect
to
starting
time
and
and
memory
usage.
C
Go
as
traditionally
be
the
language
to
go
without
a
bad
pun,
but
it's
the
go-to
language
when
you
program
kubernetes,
because
the
ecosystem
is
written
in,
go
and
and
a
lot
of
libraries
are
in
go
so
it
made
sense.
But
we
feel
that
the
time
for
java
on
kubernetes
and
in
operators
has
come
and
and
we'll
see
why,
in
greater
details,
probably
later.
B
So
so,
in
a
sense,
if
you
have
a
team
that
has
chosen
java
as
their
language
of
choice,
to
build
their
applications
that
and
put
them
in
containers
the
fact
that
they
can
also
build
the
operator
that
takes
care
of
the
service
that
these
these
pods
are
providing
makes
it
easier
for
the
people
with
the
same
skills
they
used
to
build
the
applications.
Also
to
build
the
operator
that
maintains
configures
and
keeps
the
service
out.
C
Yeah
definitely
yeah,
that's
that's
exactly
the
the
idea.
Why
I
mean
go
is
is
not
a
difficult
language
to
to
learn.
You
can
jump
up
pretty
easily,
but
if
you
already
have
the
expertise
in
java
in
inside
your
company,
why
spend
that
time
retrain
your
employees
when
you
could
do
it
in
java
and
and
if
you
need
to
wire
your
folks
also
I
mean
go,
is
is
I
guess
more
and
more
people
are
fluent
in
go
but
there's
there's
a
wealth
of
java
developers
out
there
as
well.
C
So
you
can
leverage
that
that
pool
of
knowledge,
yeah.
B
D
And
I
would,
I
would
add,
as
well
when
it
comes
to
java.
What
is
really
important
when
you
create
an
operator
is
to
have
a
good
library,
a
good,
kubernetes,
client,
okay,
go
as
an
excellent
one,
and
the
fact
is
that
in
the
java
world
we
have
an
awesome
library,
the
fabric
create
kubernetes
client,
which
is
awesome
so
easy
to
understand.
So
that
really
helps
when
you
are
already
a
java
developer,
and
you
need
to
start
talking
with
your
with
your
cluster,
creating
pods
programmatically.
D
Listening
to
events,
we
have
already
an
awesome
library.
That
is
there,
though,
ready
to
use,
and
that's
a
really
important
piece
also
that
make
it
easier
for
us
to
to
to
use
java
to
create
operators.
Yeah.
E
You
have
any
comments,
questions
yeah.
I
was
thinking
about
an
application
lifecycle.
If
you,
you
are
building
a
complex
application
or
a
variety
of
applications
that
need
to
work
together
having
java
or
having
the
capability
to
leverage
java
to
build
the
operator
that
could
manage
that
application.
Slash
applications
can
reduce
the
effort
in
terms
of
governance,
also
from
the
developer
perspective.
It
also
ops
perspective.
B
And
also,
I
would
say,
if
I
may
add,
the
familiarity
of
the
developers
with
their
ide
their
debugging
techniques
that
they
can
use
both
for
the
application
and
for
the
operator.
D
Yeah
and
exactly
and
yeah
yeah,
we,
we
have
a
lot
of
java
teams
over
there
in
the
in
the
enterprise
world
and-
and
we
are
also
seeing
this
whole
devops
movement
where
developers
are
also
wants
to
get
included
in
the
ops
operation
and
yeah.
When
you
have
a
java
team
now,
if
they
need
to
create
an
operator,
they
can
also
do
it,
though
yeah.
B
Christoph
sebastian,
what
are
you
going
to
show
us
today.
C
We
can
show
to
get
started
with
with
the
operator
sdk.
Maybe
talk
a
little
bit
about
the
architecture
or
what
makes
the
java
for
operators
such
a
an
interesting
proposition
at
this
point
in
time,
because,
as
as
sebastian
was
saying,
we've
had
in
the
java
world,
we've
had
quite
a
compelling
client
for
a
bit
of
time.
But
writing
operators
is
is
a
lot
more
than
just
connecting
to
the
cluster
right.
C
So
if
you
take
the
analogy
with
what
happens
in
the
go
world,
the
the
equivalent
of
the
fabric
at
kubernetes
client
would
be
client
go,
and
so,
if
you
were
to
write
an
operator
on
using
only
client
go,
it
would
be
difficult.
I
mean
for
that
matter.
You
still
can
you
you
can
work
up
and
you
can
create
operators
which
pretty
much
any
language
as
long
as
you
can
do.
C
Rest
calls
on
the
on
on
the
kubernetes
server,
but
the
the
availability
of
of
frameworks
to
help
you
in
your
work
is
is
really
a
big
plus
and
what
was
missing
in
the
java
world,
at
least
until
recently
was
the
availability
of
such
frameworks,
and
that's
where
the
java
priority
sdk
comes
into
play,
which
would
be
kind
of
the
java
equivalent,
or
at
least
that's
what
we're
the
java
equivalent
of
controller
runtime,
but
for
for
java
and
so
maybe
yeah.
Maybe
I
should
show.
C
Yep,
so
the
good
thing
is
that
maybe
I
should
share
my
screen.
C
And
can
everyone
see
my
screen?
Okay,
maybe
I
should
think
it's
still
no.
B
C
So
recently,
we've
we've
been
adding
adding
a
plugin
to
the
to
the
operator
sdk
command.
That
allows
you
to
scaffold
a
java
operator
and
that's
done
using
the
operator,
the
traditional
operator,
init
operator,
sdk,
sorry
init
command
and,
as
you
can
see,
we
specify
a
plugin,
that's
named
quakers
because
it
will
use
the
operator
sdk
but
consume
via
the
its
focus
extension.
C
We'll
talk
a
little
bit
about
the
details
about
that
goes,
and
we
provide
a
domain
which
is
basically
scoping
for
our
custom
resource
and
things
like
that
and
then
a
project
name
and
that
scaffolds
a
nice
project.
So
if
we
look
at
what
got
generated,
you
will
see
that
that
is
a
typical
java,
maven
java
project.
C
You
will
see
that
there's
no
java
code
generated
just
a
pom
xml
and
a
couple
of
other
files
that
that
we'll
use
later,
but
at
this
point
in
time,
there's
no
java
code,
but
still
we
can't
start
the
crocu's
dev
mode
because
the
the
palm
file
includes.
Maybe
I
should
show
that
includes
the
the
quakers
proper
extension
which
is
defined
here.
C
C
I
mean
kind
of
live
code,
your
applications,
and
so
we
start
our
application.
Even
though
we
don't
have
any
java
code
in
in
our
in
our
scaffolded
project,
we
still
have
the
caucus
extension
started
and
it
tells
us
that
we
have
no
reconciliar
implementation.
So
basically
it's
not
doing
anything
because
we
haven't
written
any
code.
So
that's
that's
understandable.
C
C
And
the
way
we
do
the
the
way
we
do,
we
create
a
reconciler
using
the
the.
C
Operators
I
mean,
I
assume
that
most
people
are
familiar
with
the
concepts
right.
So
an
operator
is
an
an
api
that
is
made
realized
by
by
a
crd
custom
resource
definition
and
its
instances.
The
custom
resources
and
the
controller
that
encapsulates
the
logic
and
the
knowledge
associated
with
dealing
with
those
and
so
in
in
the
in
that
sense,
creating
what's
called
a
an
api
in
the
using
the
operator
sdk
that
that
is.
C
That
makes
sense
so
the
way
we
do
that
is,
we
call
the
create
api
command
and
we
specify
a
version
for
our
api
and
a
name
which
is
in
kubernetes
balance.
It's
called
a
kind
which
will
be
associated
with
our
custom
resource,
and
so
that
creates
more
files.
C
And
that's
weird,
oh
yeah,
and
so
you
can
see
that
the
I
don't
know
if
you've
noticed
that,
but
the
operator
sdk
has
started
has
restarted
the
application
automatically
because
it
realized
that
new
code
that
has
been
added
and
in
fact
it
uses
our
package
name
that
we
created
we
specified
earlier
and
it
created
a
couple
of
classes
which
we
will
look
at
and
if
we
look
at
what's
going
on
on
the
quarkx
side
of
things,
it
restarted
automatically
our
application.
That's
what
I
meant
by
live
coding.
C
You
can
develop
your
operator
live,
you
go
to
your
ide
and
you
you
keep
the
corkus
dev
mode
running
and
you
change
as
you
change
your
code,
then
the
qualcus
extension
takes
care
of
doing
things
for
you
in
particular,
as
you
can
see
here,
as
as
after
I
restarted
it
registered
the
classes
that
we've
created
automatically
for
reflection
and
that's
useful
for
native
compilation.
C
If
you
were
not
using
the
the
quarkus
extension,
then
you
would
have
to
do
things
manually
to
to
be
able
to
natively
compile
your
operator.
It
also
detected
that
you
now
have
added
what
we
call
a
reconciler
in
the
java
operator
world.
We'll
talk
a
lot,
we're
going
to
see
what
it
is
quickly
shortly
rather
and
it
generated
which
is
really
interested.
It
generated
a
custom
resource
definition
based
on
the
java
classes
that
we
have
we've
added.
C
So
if
you've
ever
had
the
pleasure
or
displeasure
to
write
a
custom
resource
definition
by
end
you'd
be
pretty
happy
to
know
that
it
can
be
automatically
generated
from
your
java
code
and,
obviously
right
now,
it's
not
if
I,
if
we
take
a
look
at
what
got
generated
it's
pretty
empty
because
our
classes
are
empty
themselves,
but
it's
still
it's
still
great,
but
that
it
does
it
automatically.
For
us
and
what's
more
important,
is
that
it
will
keep
the
crd
in
us
in
sync
with
your
java
code.
C
Another
interesting
thing,
maybe
or
actually
didn't
get
done
in
that
in
that
part,
because
we
can
see
here
and
that's
actually
something
we
will
change
the
default
will
change,
because
it
makes
more
sense
to
do
it
the
reverse
way.
But
right
now
it's
telling
us
that
our
crd
has
not
been
deployed
on
the
cluster.
D
C
We
will
change
the
default
because
in
for
the
dev
mode,
it
makes
sense
that,
because
anyway,
that
the
property
that
sebastian
is
talking
about,
there's
a
proper
that
we
can
activate.
If
we
look
at
the
the
application.properties
there
is
a
property
here
called
cracklist.operatorsdk.crd.apply.
C
And
it's
set
to
false
and
that
property
is
used
to
actually
tell
the
caucus
extension
to
automatically
apply.
While
you
are
running
in
dev
mode,
the
clock
is
dev
mode
because
you,
obviously
you
don't
want
to
do
that
in
production,
but
then
again,
you're
not
really
changing
your
crd
in
production
either
of
that.
But
what
we,
what
the
quarkxpress
extension
will
do
now
after
change,
that
file
is
that
it
will.
It
will
take
the
the
crd
that
got
generated
and
automatically
apply
it
to
the
cluster.
C
D
D
C
C
Let's
look
at
the
let's
start
with
the
reconciler:
can
everyone
see
in
the
screen?
Okay,
yep?
Yes,
yes,
so
in
in
the
java
operator
sdk
world,
we
use
the
concept
of
reconciler,
which
is
an
interface.
If
we
look
at
it,
it's
pretty
simple,
it
has
two
methods
reconcile
and
cleanup,
and
cleanup
is
not.
It
is
not
needed.
C
Most
of
I
mean
is
not
necessarily
needed
most
of
the
time,
so
the
code
that
got
generated
it
used
the
name
of
the
kind
that
we
specified
to
the
operator
sdk
command
to
basically
generate
a
whole
bunch
of
classes
that
are
named
with
xposed
app,
which
is
the
name
of
the
application.
The
operator
will
be
looking
at
today
and,
as
you
can
see,
the
reconciler
interface
is
parameterized,
with
the
xposed
app
class,
which
is
our
custom
resource,
which
is
the
class
that
represents
our
custom
resource
and,
typically
in
java
operator
project.
C
Usually
we
don't
touch
the
custom
resource
class
itself.
It
extends
the
fabricate
client,
kubernetes,
client,
custom
resource
class.
That
provides
a
whole
bunch
of
interesting
support,
focused
on
resources,
and
it
is
annotated
with
the
version
and
the
group
name
that
that
we
specified
when
we
created
our
api
using
the
operator
sdk
command.
C
Interestingly,
as
well,
it's
parameterized,
the
class
itself
is
parameterized
with
two
other
classes,
because
we
feel
we,
the
sdk
and
the
fabricate
client,
at
least
for
the
custom
resource,
support
kind
of
enforces
the
best,
the
best
practice
to
sp
to
split
the
desired
state
which
is
represented
by
the
spec
and
the
actual
state
which
is
represented
by
the
status.
So,
if
you
think
about
it
about
what
a
custom
resource
is,
is
that
you
have
the
desired
state
of
the
cluster,
which
is
under
the
control
of
the
the
user
and
kubernetes
the
best
practices
for
kubernetes.
C
C
So
our
operator
will
take
the
desired
state,
look
at
the
state
of
the
cluster
and
try
to
reconcile
that
both
states
and
and
see
okay.
What
is
different
between
the
desired
state
as
opposed
to
what
I
can
observe
from
the
the
state
of
the
cluster,
and
then
you
have
the
status
part
of
of
things
that
that
is
where
the
controller
associated
with
your
operator
can
can
let
the
user
know
what's
going
on
and
and
basically
a
different.
C
C
And
then
let's
go
back
to
our
reconciler,
so
we
have
the
reconcile
method
and
we
can
see
that
also
that
we
get
the
kubernetes
client
from
the
fabricate
kubernetes
client
got
is
injected
automatically
in
our
code.
C
And
to
write
a
an
operator
using
the
java
operator-
sdk,
that's
that's
pretty
much
all
there
is
to
do
you
don't
need
to
worry
about
watchers
or
informers.
If
you're
familiar
with
writing
operators
and
go
I
mean
you
still
need
to
be
cognizant
of
those
of
those
concepts,
but
you
don't
have
to
wire
these
manually
yourself
and
so
the
the
sdk,
the
java
operator
sdk.
C
C
B
And
while
it
restarts
so
yeah
when
you
implement
your
your
methods,
I
guess
what
all
you
have
to
know
from
a
java
perspective
from
a
developer's
perspective
is
how
to
invoke,
for
example,
kubernetes
apis
through
the
kubernetes
client,
so
understand
what
the
kubernetes
client
can
offer
and
that's
probably
what
they
but
yeah
and
correct
me.
If
I'm
wrong
that
doesn't
limit
you,
you
may,
in
your
methods,
interact
with
the
database
and
set
up
a
database
using
what
you
know
about
java
apis
to
do
that.
D
Yeah
yeah,
you
do
whatever
you
want.
The
the
first
sample
that
kristoff
wrote
for
the
quarkx
extension
is
a
a
a
joke
operator,
so
it
gets
a
request
from
a
joke
api
and
and
it
just
retrieves
you
the
joke.
You
know
because
it's
talking
to
an
api
maybe
later
on.
If
we
have
yeah,
we
still
have
some
time.
I
will
show
what
I've
been
playing
with
I'm
interacting
with
git
with
a
github
friend,
so
yeah
you
do
what
yeah
that's
the
beauty
of
operators.
You
do
whatever
you
want
in
this
method,.
C
So
yes,
as
you
can
see,
our
crd
got
added,
I
mean
got
modified.
I
added
a
string
field
to
my
to
my
spec
class
and
the
crd
got
regenerated
and
it
got
reapplied
to
the
to
the
client
to
the
cluster.
So
if
I
look
at
my
at
my.
C
There's
no
there's
no
custom
resource
now,
but
yeah.
Let's,
let's.
D
Apply
one
yeah,
so
did
you
plan
to
to
generate
also
maybe
a
simple
custom
resource
in
the
sdk,
because
I
know
for
the
operator
sdk.
It
also
generates
a
sample
cr,
based
on
your
crd.
Now.
C
C
So
we
will
create
a
as
the
custom
resource
here.
So,
let's
combat
sorry,
just
not
xml
and
I
will
just
paste.
C
That
custom
resource-
it's
a
very
it's
it
basically
is
the
it
specified
the
api
version
that
we
specified
and
the
kind
that
we
specified
for
our.
C
C
So
if
you
want
to
be
able
to
access
your
your
application,
that's
deployed
on
the
cluster
outside
the
cluster,
you
will
need
to
add
the
deployment
service
and
an
ingress
or
a
root
or
an
open
shift,
and
so
this
simple
operator
what
it
does
is
that
it
creates
all
of
that,
for
you
simply
based
on
the
image
ref
that
that
you
specify
it.
C
D
Yeah
and
while
it's
getting
applied,
I
I
see
that
andrea,
you
put
it
in
the
in
the
in
the
chat.
There's
the
link
to
the
kubernetes
client,
the
fabricate
coordinates.
Client.
If
you
go
on
the
repo,
you
have
a
cheat
sheet,
showing
you
all
the
common
stuff
that
you
would
like
to
do
like
creating
a
deployment
creating
a
service
and
there's
also
a
really
useful
comparison
between
cube,
ctl
commands
and
how
you
would
do
that
with
the
with
the
kubernetes
client.
So
for
me,
it's
really
the
bible.
D
I
every
time
that
I
play
with
this
library.
I
go
there
on
this
documentation.
It's
it's
really
useful.
C
But
now,
if
we
want
to
do
more
complicated
things,
you
might
be
wondering
also
why
we
return.
We
have
a
specific
return
type
that
basically
there
is,
is
telling
the
the
operator
sdk
what
to
do
after
the
reconcile
method
is
done
in
this
case.
We
return
no
update
because
nothing
happened,
but
you
can
also
modify
the
status
and
I
could
say
maybe
we
will
change
the
we'll
add
this
status
here
and.
C
And
we
just
want
to
put
the
status
of
our
resource.
C
And
just
update
the
status
to
want
to
add
the
name.
That's
pretty
stupid.
I
mean
that's
not
very,
very
useful,
but
that
just
to
show
what
happens.
C
And
we
return
so
in
this
case.
What
what
I've
been
doing
here
is
that
I've
been
updating
the
status
of
my
custom
resource
and
telling
the
the
the
sdk
that
I
want
the
status
of
my
resource
to
be
applied,
that
I've
changed
the
status,
and
so
it
needs
to
apply
my
custom
resource.
The
any
changes
that
might
have
happened
to
the
cluster
and
what
happened
yeah.
It's
because
since
it's
live
coding,
sometimes
it
gets
restarted
at
the
wrong
time.
B
When
they
receive
the
status
to
then
update
the
crd,
you
don't
have
to
do
it
yourself.
C
C
And
that
actually
shows
something
that
well
it
got
three,
but
that
that
showed
something
that
I
didn't
talk
about.
Is
that,
as
you
can
see
here,
it's
well
not
here,
but
somewhere
yeah
here,
so
my
code
was
wasn't
working
and
the
sdk
has
automatically
tried,
and
so
it
retried
it
retried
until
it
basically
exhausted
you
can
configure
the
or
sorry
you
can
configure
the
the.
C
C
I
mean
to
to
try
the
operation
again
until
it
either
succeeds
or
it
it
decides
that
there's
no
point
in
retrying
again,
so
you
look
at
our
custom
resource
now.
C
You
can
see
that
here
the
status
has
has
indeed
been
updated
and-
and
if
you,
if
you
recall
the
the
operator
started,
I
mean
got
restarted
automatically
for
me
and
I
added
the
field
to
my
status
to
my
custom
resource
and
the
crd
automatically
reapplied
generated
and
reapplied.
I
didn't
have
to
worry
about
it.
C
I
could
focus
really
on
my
java
code
and
that
and
for
me,
that's
a
great
experience,
because
I
I
was
a
little
flustered
with
my
with
my
code
and
that
wasn't
quite
working
and
I
didn't
have
to
worry
about
okay.
What
what's
going
on
with
my
cprd?
Did
I
forget
to
reapply
it?
C
B
C
To
write
test,
it's
indeed
some
one
of
the
weak
points
at
the
moment,
probably
with
the
sdk
is,
is
the
testing
support,
but
we
are
working
on
it
and,
like
I
said
we
have,
we
have
the
the
junit
extension
that
allows
you
to
to
interact
with
the
cluster
more
easily,
but
we
could
definitely
improve
things.
I
think
it's
just
a
matter
of
of
time,
because
we've
been
working
a
lot
of
on
the
features
and
sure.
C
B
D
Yeah
yeah
and
that
will
pop
up
some
questions,
because
I
want
to
show
an
example:
a
sample
operator.
D
C
D
Yes,
yeah
put
my
screen,
I
will
show
you
some
stuff,
so,
as
I
said,
I
felt
in
love
with
this
sdk
and
his
stuff.
Helped
me
a
lot
and
explained
me
the
stuff
and
everything,
and
then
you
have
to
create
your
operator.
Okay,
so
I
had
no
idea.
I
did
some
stupid
operators
and
I
did
even
did
a
quake
free
operator
for
another
show.
D
Maybe
but
anyway
I
I
came
to
the
idea
of
a
more
serious
operator
and,
and-
and
you
probably
know
about
git
ups
in
this
show-
you
had
a
lot
of
shows
about
get
ups.
Argo
cds
are
basically
git
ups.
What
is
it
the
the
source
of
truth?
Is
your
git
repo
and
you
have
an
operator
that
is
scanning
your
github
repo
and
applies
the
resources
from
there
I
say:
hey.
D
We
have
a
good
kubernetes
client.
We
have
a
good
library
to
play
with
git
in
java
called
jgit.
Okay,
let's
try
to
make
my
own
getups
operator
a
really
simple
one,
and
so
I
exactly
did
what
christoph
did
I?
I
launched
a
new
project
with
the
the
sdk
and
I
started
writing
my
my
my
spec
object.
Okay,
so
what
do
I
want?
I
want
a
repo
okay,
pointing
to
a
repo.
D
I
want
a
reference,
maybe
main
or
any
branch
I
want
to
specify
on
which
namespace
of
my
cluster,
it
will
be
applied.
Those
resources-
and
maybe
I
have
a
set
gear
in
my
repo,
where
my
yammels
are
located,
for
instance,
okay,
so
I
just
keep
it
simple
this
way
and
you
create
this
and,
of
course,
the
whole
crd
get
generated.
D
Okay
and
then
you
have
to
to
write
the
the
code
itself.
Okay,
so
here
don't
don't
be
afraid.
It's
a
bit
easier.
B
And
before
you
continue,
I
wanted
to
interrupt
you.
I
see
that
we
have
the
intellij
fangs
on
one
side
and
the
vs
code
fans
on
the
other
side
and-
and
I
think
it's
it's
worth
reminding-
that
there
are
quarkus
extensions
for
vs
code.
I'm
gonna
put
the
link
in
the
that
could
stop
gave
me
for
for
bs
code
as
well.
D
True
and
let
me
see,
I'm
missing
a
lot
of
code
here,
let
me
see
resources.
D
Oh,
no,
no,
I'm
not
missing
any
any
code,
because
no,
I
I
mix
up
with
another
operator.
So
what
I
do
is
really
messy
and
christoph.
I
found
a
solution
for
me
to
remove,
because
I
need
to
scan
every
10
seconds,
for
instance
the
the
repo,
so
I'm
using
a
library
called
quartz.
I
I
I
should
not
use
that
and
christoph
showed
me.
He
opened
a
pr
to
remove
that
part
because
out
of
the
box,
the
operator
the
sdk
can
handle
that,
but
basically
my
reconcile.
What
happens?
D
Let's
just
here
go
to
the
job.
Basically,
let
me
see,
let
me
show
you
the
interesting
part.
Yeah,
that's
interesting
part.
That
is
where
basically,
what
I
do
here.
I
use
the
this
jket
library.
I
I
just
cloned
the
repo
okay
and
if
it's
not
new,
I
set
the
pause
etc,
and
then
I
call
create
resources.
Okay
and
if
we
go
there
create
resources.
Come
on
look
at
this
here
you
have
the
beauty
come
on.
You
have
the
beauty
of
the
the
of
the
kubernetes
client.
Okay.
D
Here
I
have
the
content
of
my
file.
Okay-
and
I
just
do
client
load
the
input
stream
to
my
file
in
the
namespace
that
I
specified
and
I
do
a
create
or
replace,
and
that's
it
that's
the
whole.
The
only
thing
I
need
to
do
there
are
some
methods
like.
Is
it
ammo,
file
or
stuff
like
that?
But
but
the
core
of
the
the
operator
is
really
cloning,
the
repo
and
applying
the
resources.
D
That's
what
we
really
want
to
do
of
course
later
on,
we
we
could
make
it
better
and
then
how
does
my
custom
resource
looks
like?
So
it's
something
like
this,
so
I
call
it
github's,
repo.
Okay,
you
give
it
a
name.
You
pass
a
repo,
a
reference,
a
yamo,
a
resource
there
and
the
namespace
okay,
and
that's
it
and
then,
if
you
get
your
your
well,
so
if
I
go
back
here,
I
get
this
operator
running
in
depth
mode.
Okay,
I'm
con.
D
I
have
a
mini
cube,
running
okay,
he
applied
automatically
the
crd
and
I
can
start
doing
stuff
like
cube.
Ctl,
apply,
dash,
f
and
cr
sample.
Okay
and
if
the
demo
gods
are
on
my
side
and
it's
been
well
since
I
oh
there-
we
go
look
at
this.
So
what
you
can
see
here,
a
lot
of
stuff
is
getting
created.
Let's
take
a
quick
look
at
my
repo
that
he
cloned,
so
basically
he
cloned
this
repo.
He
went
into
this
folder
and
he
found
deployment
here.
D
A
simple
deployment
with
two
replicas,
my
boot,
and
let
me
see
the
other
deployment
is
my
boot
one
with
free
replicas.
So
we
should
have
five
five
stuff
created
and
look
at
this.
We
got
it
created.
Okay,
it
is
taking
some
time
because
yeah,
you
know,
and
there
we
go,
and
let's
imagine
that
I
let
me
see
if
I
open
a
new
one.
I
hope
I
have
it
cloned
not
too
far.
D
I
don't
have
it
here,
but
you
know
what?
Let's
do
it
crazy
way?
Let's
just
change
it
here.
Oh,
oh,
let
me
go
to
my.
Let
me
go
here.
D
Let
me
go
here
and
let's
go
to
the
cmo,
for
instance.
So
let
me
go
to
this
deployment
and
let
me
edit
this
editing
yamo
on
github
live.
I
never
did
that.
I
think,
and
let's
go
for,
let's
go
for
four
gas,
because
why
not?
Okay,
I
commit
this
okay,
it's
committed,
and
if
we
come
back
here,
we
should
see
look
at
this.
It's
already
getting
created,
so
it's
already
applied.
So
I
really
have
a
get
ups.
D
A
really
simple,
git,
ops
operator
and
one
interesting
stuff
is
what
happens,
and
maybe
that's
just
for
you
chris.
If
you
can
take
it
over
what
happens.
If
I
do
a
cube,
ctl
delete
delete.
How
do
I
call
it
simple,
getups
repo
git
ups
hit
ups
repo,
and
let
me
see
because
what
you
want,
if
you
delete
this
there
is
this
okay,
so
I
can
do
a
crew
detail,
get
here's
a
tripod.
I
know
it's
not
that
fantastic,
but
I
always
love
it.
Cube.
D
Ctl
delete
get
ups,
repo,
my
repo
okay.
I
believe
that
what
you
really
want
to
do-
and
I'm
not
sure
it's
working
in
this
version-
you
want
also
probably
that
your
deployments
get
deleted
every
resource
that
has
been
applied.
You
also
want
it
to
be
deleted,
okay
and
and
also
dependent
resources.
Okay,
maybe
you
are
you're
creating,
I
don't
know
a
deployment
that
spawns
another
deployment
and
when
you
destroy
it,
you
destroy
your
cr.
D
You
want
it's
cascading
deleting
stuff,
so
maybe
you
can
take
it
over
from
there
and
christoph
I'm
speaking
with
about
dependent
resources,
yeah.
D
C
Some
more
yeah,
that's
actually
what
I
wanted
to
show
so
yeah
for
the
the
scenario
that
sebastian
was
talking
about.
The
the
obvious
solution
is
to
set
the
owner
reference
on
your
on
on
your
custom
on
the
dependent
resources,
because,
basically
you
have
your
prime
primary
custom
resource,
our
primary
resource,
which
is
the
the
one
that
your
operator
takes
care
of
and
then
to
reconcile
the
I
mean
to
create
the
desired
state
represented
by
that
resource.
C
Sometimes
you
need
to
create
other
kubernetes
resources
right
or
even
external
resources
and
those
are
called
dependent
or
secondary
secondary
resources,
and
in
the
case
of
kubernetes,
of
kubernetes
dependent
resources,
you
can
control
the
life
cycle
of
those
dependents
by
setting
what's
called
the
owner
reference
and
you,
you
basically
tell
the
dependents
that
their
owner
is
your
primary
custom
resource,
and
when
you
do
that
primary
resource,
then
it
will
automatically
delete
all
the
all
the
other
resources.
D
C
It's
it's
the
same
operator
that
I
showed
earlier,
but
in
a
more
slightly
more
advanced
state.
So
it's
the
exposed,
app
reconciler
and
we
have
a
whole
bunch
of
other
stuff
where
it,
basically
it's
doing
the
whole.
The
whole
thing
that
we
we
talked
about,
creating
the
deployment
and
service
etc
and
in
more
recent
versions.
C
In
this
case,
I
tell
you
that
my
reconciler
or
controller
will
only
watch
the
namespace
in
which
it's
deployed,
but
you
can
also
tell
it
to
watch
all
the
all
the
name
species
or
only
limit
your
operator.
Don't
only
watch
a
as
a
given
set
of
name
spaces.
So
if
you
only
want
to
watch
like
three
namespace,
you
can
specify
them.
C
We
can
override
the
its
name,
which
is
isn't
that
important
here.
But
what
I
want
to
talk
about
here
is
the
dependence
concept.
So
we
we
talked
about
dependent
resources
right
and
in
the
recent
version
of
the
sdk,
we
have
a
mod
that
we
call
manage
dependent
resources
where
we
can
extract.
Typically,
you
would,
you
would
typically
reconcile
the
state
of
all
your
dependent
resources
in
the
reconcile
method,
but
with
that
new
declarative
way
of
doing
it,
we
we
say:
okay,
we
have
my
primary
custom
resource
exposed.
C
So
I
will
create
what
we
call
a
dependent
resource
implementation
to
deal
with
each
of
those
classes
and
if
I
look
at
my
deployment
dependence
resource,
so
that's
the
that's
the
the
class
that
will
deal
with
with
the
deployment
associated
with
my
xposed
app
custom
resource,
and
I
just
need
to
implement
only
a
couple
of
things
in
this
case
two
things.
C
First,
I
need
to
specify
that.
Well,
I
extend
an
sdk,
that's
called.
We
only
test
dependent
resource,
and
that
gives
me
already
quite
a
bit-
and
I
tell
it
that
okay,
my
this,
this
dependencies
of
type
deployment
here.
So
it's
it's
a
deployment
from
coming
from
the
fabricated
kubernetes
model
and
that
the
the
primary
at
the
associated
primary
resource
type
first
app,
and
I
specify
that
this
deployment,
this
dependent
resource
will
be
in
charge
of
creating
employment
and
mature.
C
We'll
talk
a
little
bit
later
and
the
only
thing
I
need
to
implement
in
this
case
because
I
reuse,
the
behavior
provided
by
the
kubernetes
dependent
resource
is
to
specify
what
my
desired
deployment
looks
like
based
on
the
state
of
the
primary
resource,
and
that's
pretty
much
all
all.
I
need
to
do
so.
In
this
case,
I
won't
go
into
all
the
details,
but
I
basically
extract
the
imagery
from
the
spec
of
my
primary
custom
resource
and
I
create
a
container
for
my
deployment
so
well.
C
I
can
actually
create
a
deployment
builder
using
the
the
fabricate
kubernetes
client
fluent
interfaces.
C
If
we
wanted
to-
and
that's
it
I
just
specify
so
so.
The
idea
here
is
very
simple:
you
you
using
the
desire
you
you
get.
The
primary
represents
the
the
the
desired
state
and
track
that
state.
Then
you
build
what
your
deployment
in
this
case,
but
what
your
dependent
resource
should
look
like
and
then
the
sdk
takes
care
of
doing
it
applying
I
mean
doing
doing
what's
needed
on
the
cluster,
so
that
basically
means
in
this
case.
C
We
only
say
that
we
we
just
want
to
create
that
deployment.
We
never
want
to
update
it
in
this
case,
so
we're
only
implementing
the
critical
method
interface,
but
in
this
case
it
means
that
the
sdk
will
will
look
at
each
time.
There's
a
reconciliation
that
happens
it
will
look
at.
Is
there?
C
B
C
Yeah
it
is,
it
is
a
fair
statement
and
that
that
takes
care
of
wiring
things
for
you
automatically,
because,
basically,
when
you
declare
a
dependent
resource
of
type
tuberni
test
dependent
resource,
what
happens
in
the
background
is
that
you
will
get
an
informer
that
watches
those
resources
automatically,
but
those
dependent
they
don't
need
to
be
kubernetes
dependents,
and
we
have
samples
that
actually
show
a
mysql
cluster
that
that
is
considered
as
a
dependent
for
our
primary
resource,
and
we
provision
automatically.
C
E
If
I
can,
I
can
ask
we
are
running
up
to
the
hour,
but
just
because
it's
very
interesting
topics
that
in
the
github's
domain
and
the
java
operator
and
their
capabilities,
how
do
you
see
the
interaction
between
argo
city?
Obviously,
and
what
do
you
show
in
terms
of
controlling
a
complex
deployment
of
workflow?
E
E
C
Not
be
the
best
person
to
answer
that
question,
but
the
way
I
see
it
is
that
operators-
and
I
think
one
of
your
previous
guests-
was
saying
that
it
basically
encapsulates
human
knowledge
of
operating
a
complex
application
into
code
and
that's
what
operators
are
best
suited
for.
I
mean
because
operators
are
quite
a
hot
topic
at
the
moment
and
many
and
maybe
folks
might
be
excited
about
riding
operators
for
this
or
that,
and
sometimes
an
operator
might
not
be
the
best
option.
C
So
the
first
question
that
you
have
to
ask
yourself
is:
do
I
need
an
operator,
an
operator
for
this
particular
use
case?
In
some
cases
you
don't
so
and
probably
in
this
in
the
the
sample.
I
just
showed
you
probably
you
don't
need
an
operator
for
that.
C
That's
true!
It's
just
a
way
to
to
show
that
the
the
added
value
for
operators
is
that
they
can
react
dynamically
to
what's
going
on
on
the
cluster.
C
C
E
B
And
I
think
that's
all
we
have
time
for
today
and
I
wanted
to
thank
you
guys,
sebby
christoph
for
joining
us.
Hopefully
we
will
have
other
occasions
to
continue
this
conversation
again
at
openshift
tv
at
coffee
break,
and
I
wanted
to
remind
everybody,
the
next.
What
do
we
have
next
fabio
by
the
way
it's
on
the
night.