►
From YouTube: Demo: Kubebuilder Deploy-Image plugin
Description
Deploy-Image is a Kubebuilder Golang plugin that provides users an operator solution for deploying and managing an image on a Kubernetes cluster, which is a very common use case.
- Documentation: https://master.book.kubebuilder.io/plugins/deploy-image-plugin-v1-alpha.html
- Project: https://github.com/kubernetes-sigs/kubebuilder
Please feel free to make any suggestions and raise an issue on Github.
#devops #kubernetes #operators #golang
A
A
So
for
doing
that,
deployments,
plugin
provides
a
controller
implementation
for
deploying
and
managing
the
image
on
the
cluster.
Along
with
the
controller,
it
provides
tests
for
checking
the
reconciliation
implemented
using
env
test
sample.
Mls
are
also
added
to
the
project
for
creating
new
custom
resources,
and
these
sample
emails
are
updated
with
the
specs
used
operand,
which
is
the
image
the
user
wants
to
deploy
and
manage
will
be
added
on
the
manager
via
an
environment
variable.
We
will
take
a
look
at
that
later.
A
The
first
important
flag
is
the
image
flag
for
informing
the
image
the
user
wants
to
deploy
and
manage.
The
second
important
flag
is
run
as
user
for
specifying
the
run
as
user
value
for
the
security
context.
Now
comes
two
optional
flags
image
control
command
for
specifying
the
command
to
be
used
to
initialize.
The
container
image
is
run
in
the
second
optional
flag.
Is
image
container
port
for
specifying
the
port
of
the
container.
A
So
the
users
get
tests
for
the
reconciliation
implemented
by
default,
using
envtest
so
by
this
users
will
not
need
to
write
the
test
implementation
for
their
controllers
from
scratch.
They
will
have
a
choice
of
just
to
build
on
top
of
the
test
scaffolded
in
the
project,
according
to
their
custom
controllers,.
A
So
now
comes
the
finalizer,
so
the
reconciliation
implemented
adds
the
finalizer
that
demonstrates
how
to
perform
operations
before
letting
the
kubernetes
api
delete
the
resource,
and
all
that
depends
on
it.
The
finalizer
operation
added
by
default
is
to
create
a
new
event
when
the
user
deletes
the
custom
resource.
A
A
A
A
A
A
A
Then
we
check
that
the
memcached
instance
is
marked
to
be
deleted
or
not,
which
is
indicated
by
the
deletion
timestamp,
and
if
it
is
marked
to
be
deleted,
we
perform
our
finalizer
operation
for
performing
the
finalizer
operation.
We
use
do
finalizer
operation
for
meme
cache
function
in
this
function.
We
create
a
new
event
with
a
a
message
informing
that
the
customer
source
is
being
deleted.
A
A
A
So
for
checking
the
reconciled
logic,
we
first
create
a
cr
for
the
kind
meme
cache
we
check
the
cr
was
created
successfully
or
not.
We
use
the
memcached
sd
conciler
to
reconcile
that
cr
created
and
in
the
end,
we
check
our
deployment
created
in
this
way.
It
tests,
whether
our
controller
works
properly
or
not.
A
So
this
is
the
sample
ml,
which
is
added
to
the
operator
project
by
default.
So
the
user
can
use
this
ml
for
creating
a
custom
resource
directly
in
this
spec
we
can
see
only
size
is
present,
but
if
user
will
add
new
specs
for
the
memcache
instance,
this
sample
ml
will
be
updated
with
the
specs
used.
A
A
A
So
we
also
talked
about
two
optional
flags
which
we
can
specify
while
creating
an
api
with
deploy
image
plugin.
So
let's
create
a
new
api
with
also
specifying
image,
container
command
and
image
container
port
flag
and
see
what
is
scaffolded
in
the
operator
project.
When
we
specify
those
plugins
too,
so
we
will
first
initialize
the
project
through
queue
builder
in
it.