►
Description
This is the weekly update for the Server Runtime SEG for the week of the 23rd of December 2022
This week I've continued on build on the excellent GitLab agent for Kubernetes. Updates include:
1. Ability to change workspace state
Ability to start, stop and terminate a workspace
2. Reflect state from Kubernetes
Server Runtime will reflect the state of the workspace in Kubernetes
3. Retroactively fix state
Server Runtime will now refresh the state of the workspaces it is managing when the agent first starts up.
Chapters
0:00 Overview
0:49 Demo - Changing workspace state
1:49 Demo - Reflect state from Kubernetes
2:42 Demo - Retroactively fix state
A
Hi,
everyone
welcome
to
another
update
from
the
server
runtime
sag
for
the
week
of
the
23rd
of
December
2022..
So
this
week,
I've
been
really
focused
on
state
changes.
The
ability
to
start
stop
a
Terminator
workspace.
Also,
what
I've
been
working
on
is
reflecting
changes
in
kubernetes.
So,
for
example,
when
workspace
gets
deprovisioned
because
of
a
node
being
unavailable
or
any
changes
in
the
kubernetes
in
the
kubernetes
namespace,
those
will
be
reflected
automatically
in
rails.
A
What
I'm
also
doing
is
making
sure
that
in
case
the
agent
is
down,
for
example,
our
gitlab
agent
isn't
working
the
cluster
when
it
does
come
up.
It
retrospectively
fixes
the
state,
so
that
rails
always
reflects
the
right
state.
So,
with
that
I'll
jump
straight
into
the
demo.
A
Okay,
so
here
you
can
see,
I
have
two
workspaces
running
so
workspace,
36
and
37..
If
I
go
into
kubernetes
I
can
see
that
workspace.
36
is
currently
in
a
running
State.
I
can
go
ahead
and
change
that
state
by
clicking
on
stop
and
when
I
click
the
stop
button,
you
should
see
instantaneously.
It
starts
terminating
that
that
status
reflects
from
kubernetes
and
so
I
can
see.
The
status
is
now
stopped,
so
I
could
go
ahead
and
also
terminate
this
workspace,
so
it
is
currently
stopped.
A
So
it's
not
consuming
any
CPU,
but
we
can
go
ahead
and
also
completely
terminate
it.
So
this
will
completely
kill
the
isolation.
All
the
namespaces
everything
all
the
resources
related
to
this
workspace
will
be
killed.
So
if
you
see
that
it's
now
in
a
terminating
state,
if
you
see
in
kubernetes,
if
I
look
at
the
name
spaces,
you
can
see
that
the
namespace
workspace
36
is
in
a
terminating
State
as
well.
So
if
I
refresh
the
screen,
you
should
soon
see
it
is
terminated.
A
So
once
the
computer
is
killed
and
we
go
ahead
and
terminate
that
workspace.
So
now
you
can
change
the
status
of
the
workspace.
A
The
next
thing
I
want
to
quickly
show
you
is
that,
if
that,
if
kubernetes
changes
the
status,
that
is
you
know
something
goes
wrong
in
kubernetes
and
kubernetes,
just
not
able
to
bring
that
pod
up
we're
able
to
reflect
that
status
in
in
in
real
as
well
so
I'm
going
to
directly
go
into
a
different
workspace,
workspace,
37
I'm,
going
to
go
ahead
and
edit
that
deployment
for
that
workspace
and
I'm
going
to
stop
that
deployment.
A
Essentially
so
right
now
you
see
the
rails
shows
the
status
of
of
running
so
I'm
going
to
go
ahead
and
make
the
replica
0,
which
will
go
ahead
to
this
deployment,
and
so,
if
you
see
almost
immediately,
if
I
refresh
rails,
you'll
see
that
it
shows
the
status
has
stopped.
So
as
things
change
in
kubernetes
you're.
Listening
to
all
these
events
and
then,
as
soon
as
these
events
occur,
we
immediately
reflect
the
status
of
the
events
in
in
rails
as
well.
A
The
other
other
great
thing
is:
we
can
even
do
this
when
the
agent
is
down
so
brought
the
agent
down.
So
agents
are
running,
let's
say
in
between
the
workspace
started
running
automatically
so
agent's
not
aware
of
this.
So
agent
isn't
at
all
aware
of
the
changes,
and
so
let's
say
the
workspace
started
running
at
this
point
in
time.
A
So
the
the
workspace
is
currently
starting
up
in
running
status.
So
if
I
go
right
now
to
kubernetes
kubernetes
sorry
to
rails,
you
can
see
real
still
things
that
stopped.
What
I
can
go
ahead
and
do
is
if
I
start
up
the
agent
now,
the
agent
will
start
up
and
it'll
reflect
the
status
automatically,
and
this
happens
because
I've
now
introduced
a
new
flag
in
the
configuration
called
resync
on
Startup
and
what
this
flag
does.
Is
it
automatically
resyncs
the
status
on
when
the
when
the
agent
starts
up?
A
So
now,
if
I
refresh
the
screen,
you
can
see
that
the
workspace
is
up
and
running
the
next
thing.
I
want
to
quickly
show
you
is
even
if
the
workspace
is
completely
killed.
We
do
a
full
reconciliation.
So
if
I
was
to
go
ahead
and
completely
delete
this
namespace
so
that
there
was
no
trace
of
this
workspace
at
all
in
kubernetes.
A
So
that
is
now
almost
terminated
so
now
there's
no.
The
agent
doesn't
know
that
this
that
this
this
has
been
terminated.
If
I
go
ahead
and
actually
refresh
here,
you
can
go
and
see
that
as
soon
as
I
start
the
agent
the
status
is
reflected.
So
we
do
a
quick,
full
reconciliation.
So
even
when
the
agent
is
down
and
the
workspace
workspace
is
terminated,
we
can
we
can
see
those
events,
we
do
a
comparison
and
we
delete
it.
A
So
so
that's
it
for
this
update.
Thank
you
for
listening.
This
is
the
last
update
for
the
year,
so
have
a
great
year
ahead.
Thank
you.