►
From YouTube: GitLab Agent for Kubernetes: leader election MR overview
A
Hi
this
is
mikhail.
This
is
an
overview
and
the
demo
of
the
leader
election
merge,
requests.
A
So
the
functionality
in
the
agent
is
split
into
modules,
so
that
the
program
is
not
a
big
monolith,
but
has
some
internal
structure
modules
are
well?
Each
module
quite
often
is
split
into
server
and
agent
side
component,
so
there
are
basically
server
modules
and
agent
modules.
B
B
A
That's
how
I
call
them
here:
module
some
of
them
are
active,
like
githubs,
contains
security
scanning
and
then
more
here
like
home
support
in
the
future,
the
only
one
we
only
want,
at
most
one
instance
of
aging
k,
pod
to
be
acting
on
the
configuration
for
efficiency
and
other
reasons,
and
there
are
some
other
modules
that
are
always
on
basically
so
for
this
modules
for
active
modules,
you
want
to
do
lead
relation
basically,
so
that
only
one
is
active
at
the
same
time,
but
we
only
want
to
run
leader
election
if
the
module
is
active,
so
is
configured
to
perform.
A
Because
there
are
multiple
kind
of
moving
parts,
dynamic
configuration
and
plus
multiple
modules
with
such
dynamic
configuration
where
each
may
say
I
am
enabled
I'm
disabled
and
if
at
at
least
one
is
enabled,
then
we
need
to
run
leader
election.
If
none
are
enabled,
then
we
don't
need
to
run
leader
election
plus.
A
A
A
This
is
the
interface
I
came
up
with
it's
a
leader
module,
so
one
extra
method.
This
has
the
same
signature.
I
just
wanted
to
add
extra
docs
here.
That's
why
I
added
it
as
here
as
well,
and
from
that
perspective
I
think
this
looks
really
clean.
So
we
have
this
gitobs
agent
module
and
this
is
the
diff.
Basically,
if
this
function
returns
true,
that
means
this
module
should
be
ran
for
a
particular
configuration.
A
So
you
know,
as
you
see,
if
there
are
manifest
projects
and
configuration,
then
this
module
should
be
run.
If
this
agent
k
instance
pod,
wins
the
leader
election
and
same
with
the
star
board
vulnerability.
If
it's
configured,
if
the
module
is
configured,
then
it
wants
to
participate
in.
A
B
B
B
Runs
the
election
somewhere
here
yeah.
This
is.
A
A
This
this
one
uses
the
same
pattern
for
with
the
select.
So
it's
like,
I
think,
of
of
this
thing
or
this
pattern
as
like
imagine
a
separate
process,
a
separate
program
that
runs
and
processes,
incoming
and
outgoing
signals
basically
and
it
holds
some
state.
So
in
this
case
we
have
some
state
as
fields
as
variables
and
and
fields,
and
we
get
incoming
configuration.
A
We
started
leading
and
we
stopped
leading
like
it's
a
thing
that
dynamically
processes,
incoming
signals
and
dispatches
signals
to
other
actors,
and
here
we
have
automatas
on
based
on
status
of
the
the.
B
A
A
A
Oh
one
important
thing
is
they
use
different
pod
names
so
as
if
they
are
this
one
is
the
second
one,
and
this
one
was
the
first
one.
So
I
as
the
as
if
they
are
different
pods,
because
spot
name
is
used
for
identity.