►
From YouTube: OpenShift Demo Part 11: AB Deployments
Description
In this video, Veer Muchandi demos how to mange AB deployments on OpenShift 3.
NOTE: For the latest information on OpenShift 3, please visit https://enterprise.openshift.com or subscribe to the OpenShift Blog (https://blog.openshift.com).
A
Hello,
everyone
in
this
video,
we'll
discuss
doing
a/b
deployments
using
in
OpenShift
a
B
deployments,
is
a
deployment
model
that
is
used
commonly
these
days
for
for
achieving
minimum
downtime
of
applications.
Where
you
were
when
you,
whenever
you
make
changes
to
your
application,
you
would
want
to
run
more
than
one
version
of
the
application
at
the
same
time
and
then
switch
over
to
the
newer
version
of
application
or
a
bit
of
time.
Let's,
let's
look
at
how
it
works.
Let's
say
you
have
your
application
and
and
a
version
of
your
application
is
running.
A
Now,
let's
say
you
need
to
make
changes
to
this
application
and
at
that
point
you
introduce
a
change
version
of
this
application
and
in
case
of
AV
deployments,
instead
of
turning
off
the
older
version
of
your
application
and
then
switching
over
to
the
newer
version.
What
you
try
to
do
is
run
both
the
versions
of
applications.
At
the
same
time,
wherein
you
would
let's
say
you
had
four
instances
of
application
version.
A
One
running
you
introduced
just
one
instance
of
application
version
2
here
right
and
now,
and
you
will
configure
your
router
to
direct
some
of
the
traffic
to
application
version
2.
And
if
you
are
happy
with
how
that
version
2
is
working
right,
then
you
would
increase
the
number
of
instances
of
version
to
the
your
changes
and
you
will
gradually
reduce
the
number
of
instances
of
application
version
1
and
over
a
period
of
time.
You
would.
A
You
would
completely
remove
application
version
1
and
your
application
version
2
takes
over
from
there
right,
and
this
also
allows
you
to
actually
roll
back
at
the
to
application
version
1.
If
you
are
not
happy
with
version
2
and
you
can
scale
down
the
number
of
instances
of
version
2
and
increase
the
number
of
instances
of
version
1
as
desired,
so
you
can
do
the
reverse
effect.
A
Basically,
if
you
look
at,
if
you
have
understood
the
architecture
of
OpenShift
in
the
past,
right
OpenShift
runs
the
application
instances
in
openshift
or
any
app
runs
inside
a
kubernetes
part.
So
let's
say
your
application
version.
1
is
running
and
it
is
running
in
four
different
parts.
Let's
say
right
and
those
pods
are
front
ended
by
a
service
which
groups
all
the
parts
related
to
this
application.
So
let
us
say
we
have
assigned
a
label
to
this
application
version
1
and
we
and
we
assigned
a
label
called
a
b
member
equal
to
true
meaning.
A
A
A
Your
service
will
pick
up
your
new
parts
based
on
the
same
selector
that
we
had
assigned
to
it
before,
and
the
traffic
gets
now
routed
between
version
1
and
version
2,
and
eventually
you
can
just
keep
version.
2
and
remover
should
1
if
you
are
happy
with
version
2
right.
So
that's
the
model.
Let's
look
at
the
example
of
how
to
do
that
in
OpenShift.
So
now,
I'm
logged
on
to
my
oven
shift
environment
on
on
the
web
console
I
am
in
a
project
creation
screen.
A
I
am
creating
a
new
project
with
named
Ava
deployment
and
I.
Just
give
it
display
name
and
description
as
well
and
I'll
say
create
this,
creates
the
new
project
and
now,
let's
add
an
application
version,
a
right
so
on
github
I
have
provided
a
sample
code
for
this
I
have
a
simple
application.
What
it
does
is
it
shows
that
it
just
displays
a
version
number
and
it
says
where
this
pod
is
running.
It
displays
the
IP
address
of
the
part.
A
Since
this
is
a
PHP,
app,
I'm,
selecting
PHP
I'll
call
this
app
a
and
we
will,
since
we
are
going
to
create
a
new
service
and-
and
we
will
be
using
our
own
selectors
I-
will
not
create
the
route
for
now.
I'll
just
remove
the
route,
so
I
am
deploying
at
a
with
no
route,
and
we
will
scale
it
up
later.
As
of
now,
what
I
will
do
is
I'll
add
a
label
called
DB
group
member
is
true.
A
A
A
Now,
if
you
look
at
this,
it
has
a
label,
a
B
group
member
equal
to
true
right.
That
means
that
any
part
that
gets
created
will
get
added
this
label
now.
What
we'll
do
is
we'll
also
add
this
to
the
selectors,
okay,
so
I
added
a
selector
here
to
this
deployment
config
now
let
us
also
add
a
new
service
to
expose
this
deployment
configuration
with
this
change
that
we
just
added
right
so
we'll
add
a
new
service
and.
A
So
I'm
exposing
a
service,
the
DC
app
a
with
the
name.
I
am
assigning
a
name,
a
B
service,
because
this
is
a
common
service
that
applies
both
to
application,
a
as
well
as
application
B,
so
I'm
calling
it
a
B
and
I
mean
it's
just
a
naming
convention
I'm
using
there's
nothing,
you
can
call
it
any
XYZ,
it
doesn't
matter
and
I'm
assigning
the
selector
or
F
a
B
group
number
equal
to
to
true.
This
is
the
one
that
we
configured
right
and
we
are
going
to
generate
a
new
service
by
default.
A
When
openshift
created
this
application,
it
would
have
added
a
service
ignore
that
we
are
creating
a
new
service
that
can,
that
is
configured
to
with
the
selector
a
b
group
number
equal
to
true
right.
So,
let's
see,
if
I
do
OC
gets
service,
you
will
see
now
there
are
two
services
one.
Is
that
app
a
which
was
generated
before
right,
and
there
is
a
new
service
that
we
just
added.
This
is
what
we
are
going
to
use
now
and
this.
This
is
a
service
that
we
will
use
to
expose
wire
our
route.
Okay.
A
A
The
one
part
of
this
application
is
running
right.
So
let
us-
and
and
if
you
look
at
the
services,
there
is
a
service
that
was
created
along
with
the
application,
we'll
ignore
that
and
we
created
our
own
service,
a
new
service
and
we
assigned
a
URL
to
expose
the
service.
Let's
open
this
link
in
a
new
tab.
So
if
I
look
at
it
now,
my
application
is
now
running,
since
there
is
a
single
part
which
is
ending
with
59
right.
Let
me
show
you
on
the
overview
page.
A
Let's
do
something:
let's
scale-up
this
application,
o
C
scale
C
app
a
this.
Is
the
that
I'm
saying
that
use
the
deployment
configuration
app
a
and
scale
this
application
and
set
the
number
of
replicas
to
4.
A
A
We
will
put
a
for
loop
and
run
a
call
to
the
same
URL
to
see
what
we
get
right.
So
the
scaling
is
running.
I
did
a
10
time,
curl
to
the
same
URL
that
we
configured
right.
It
says
I'm
version,
one
I,
emotion
when
I
were
shown
all
the
time
in
this
version
one
and
it
says
the
it
gives
the
pod
number
59
60
60
60,
look
at
it,
59
60,
66
successor,
and
then
it's
load
balancing
the
track.
It's
doing
in
the
round-robin
way
like
59,
60
66
is
done
again.
A
The
same
things
will
repeat
right.
So
basically
we
have
an
application
version.
One
and
four
instances
of
this
application
are
running
and
when
we
are
acting
the
client
side
from
the
my
local
machine
when
I
am
accessing
this
application,
I
am
hitting
all
different
parts
and
my
route
is
the
router
is
routing
the
traffic
to
between
load
balances,
the
traffic
across
different
parts.
That's
what
we
have
seen
so
far.
Now
let
us
do
the
next
step
now
we'll
go
to
the
application,
and
we
will
make
a
small
change
here.
A
A
The
same
github
URL
to
deploy
my
application,
I'll
select
the
same
PHP
file
or
file,
and
this
time
I'm
calling
it
app
B.
Instead
of
happy
write
that
the
first
one
was
I
pay.
This
is
a
B
now
I'll
not
create
a
route
because
we
already
have
it
out,
and
that
will
take
care
of
this,
and
what
we'll
do
is
we'll
just
create
one
part,
so
scaling
replicas
is
set
to
1
by
default
and
will
edit
the
labels,
and
we
will
give
the
same
exact
group
membership.
A
A
B
group
member,
whatever
you
configured
in
in
the
selector
for
the
service,
that
same
label
name,
should
apply
to
this.
These
parts
as
well
so
and
I,
will
add
that
now
I'll
create
this
app
be
now
open
shift
will
do
the
source
to
image
process.
It
will
go
and
pick
up
the
source
score
from
this
git
repository,
and
it
will
overlay
that
source
code
on
the
top
of
the
PHP
major
to
create
an
application
image,
and
it
will
then
deploy
that
image
and
that
process
will
take
a
couple
of
minutes.
A
For
that
to
happen,
the
app
B
is
still
the
the
schedule.
It
is
still
waiting
to
schedule
a
build
job,
so
we'll
give
it
a
minute
and
and
come
back
so
now
the
deployment
of
app
B
is
complete.
It
was
it's
successfully
build
it's
pushed
into
the
repository
and
then
now
it
is
deployed.
It
is
running
with
the
single
pod
and
that
pops
sports
IP
address
you
can
see,
is
10.1
dot,
2.37
right
now.
A
Let's
run
that
same
for
loop
again,
as
you
can
see
that
app
a
which
is
the
version
1
is
has
four
instances
running
right
and
app
B,
which
is
version.
2
of
our
application,
has
only
one
instance
running,
so
we
should
see
the
same
kind
of
thing
when
we
look
at
this
the
output
of
this
for
loop.
If
you
see
this
right,
there
are
4
instances
of
f1
running
so
with
the
round
robin
scheduling
you'll
see
that
there
is
66
67,
59
and
60,
which
are
the
app
a
parts
right.
A
Those
are
returning
version,
1
and
37,
which
is
2
or
37,
which
is
pod
belonging
to
version.
2
is
returning,
I
am
version,
2
right
and
then
this
repeats.
So
it's
like
4
results
from
the
form.
The
version
1
and
1
result
from
version
2,
which
is
consistent
with
the
number
of
parts
that
are
running
right,
move
forward
with
our
a/b
ii
deployment
process.
Now,
let's
say
we
are
happy
with
the
way
in
which
version
2
is
running.
A
A
I'll
increase
this
to
two,
so
we'll
have
equal
number
of
parts
of
both
right.
As
you
can
see
this,
while
I'm
making
this
change
it's
happening
behind
is
right
behind
the
screen
right,
you
are
seeing
that
the
app
a
has
two
parts
now
and
AB
B
has
two
parts.
Now
it
took
a
second
for
for
those
to
get
into
the
running
status.
Now,
let's
run
that
for
a
loop
again
right
now,
we
should
see
that
one
result
is
from
version.
A
One
other
results
from
version,
two
one
result
from
version,
one
other,
so
it's
like
it's
equally
distributed.
So
you
have
6660
returning
version,
one
and
sixty-eight
and
thirty-seven
returning
version
two
right.
So
now.
Let's
say
you
are
not
happy
with
the
change
and
you
want
to
roll
back.
You
can
always
scale
the
app
a
up,
but
let's
assume
that
app
B's.
The
changes
we
made
for
a
B
are
good
and
we
can
scale
app
eight
completely
down.
So
let's
set
the
replicas
to
zero.
It's
gone.
A
We'll
set
the
number
of
replicas
to
four
or
favorite
number
now
you'll
see
that
quickly.
This
app
B
has
four
parts
they
are.
Two
of
them
are
in
the
pending
status,
now
they're
running
okay.
Now,
let's
run
the
for
loop
again,
everything
is
version
2
now,
okay,
so
that's
how
Ava
deployments
can
be
achieved
in
openshift.
There
are
some
improvements
that
are
expected
in
this
area
in
terms
of
assigning
the
percentages
and
all,
but
we
will
cover
them
when
it
comes
to
that.