►
From YouTube: OpenShift Demo Part 12: Using Persistent Storage
Description
In this video, Veer Muchandi explains the difference between ephemeral and persistent storage, and then demonstrates how to use persistent storage with OpenShift 3 using NFS and a sample MySQL service.
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,
this
video
is
about
using
persistent
storage
with
OpenShift
version
3
in
order
to
understand
why
we
need
the
persistent
storage.
Let's
look
at
an
example.
First
of
a
non
persistent
storage.
If
you
have
seen
my
earlier
videos,
you
would
already
know
how
to
spin
up
a
my
sequel
application
component
on
OpenShift
and
I
did
exactly
the
same
thing.
I
have
a
ephemeral,
my
sequel
database
that
is
spun
up
and
let's
use
it
first
to
see
how
it
looks
like
first
I'll
do
port
forwarding
to
my
my
sequel
database.
A
Now
this
command
will
port
forward
to
the
to
the
part
that
is
running
the
my
sequel
database
and
it
will
in
any
traffic
that
I
sent
to
my
local
host
on
port
3306
will
be
forwarded
to
this
part.
Now,
let's
connect
to
this
database,
Here
I
am
connecting
to
my
local
host.
It's
127
0
0
1
and
the
I
am
connecting
to
port
3306,
because
this
gets
forwarded
to
the
part
I'm
using
username,
weed
and
password
wheel,
which
I
gave
when
I
was
creating.
That
database.
A
A
Let
me
cancel
this
port
forwarding.
If
you
see
I
have
one
instance
of
my
sequel
running
here
and
let
me
go
and
kill
that
OC
delete
part.
What
you'll
observe
is
immediately
the
replication
controller
acts
immediately,
and
this
is
the
part
that
is
gone.
A
new
pod
replaces
in
its
space
because
I
deleted
it
physically,
which
is
good.
So
if,
if
an
instance
goes
down,
another
instance
comes
in
it
place,
open
shifter
is
doing
its
job.
Now,
it's
still
in
the
pending
status.
Let's
wait
till
it
gets
to
running
it's
running
now.
A
A
It
shows
the
sample
database,
I,
say,
use
sample
and
when
I
say,
show
tables
earlier
we
insert
a
table
and
it's
gone
so
the
data
that
was
written
to
the
database.
The
previous
instance
of
the
the
PAR
is
all
gone
because
it
is
ephemeral.
So
why
did
that
happen?
Our
when
we
were
writing
data
to
our
my
sequel,
part
in
case
of
an
ephemeral
storage
instance
that
the
data
was
being
written
inside
the
part.
So
when
the
pod
went
off,
the
data
also
got
deleted
along
with
the
part.
A
A
You
would
have
the
pod
separated
out
from
where
you
write
your
data,
so
you
you
will
mount
your
persistent
storage
on
to
the
pod,
in
which
case,
for
example,
if
a
pod
dies
for
some
reason,
openshift
will
create
a
new
part
and
it
will
also
mount
the
persistent
storage
that
was
that
was
there
before.
So
you
will
not
lose
any
data,
let's
see
how
it
works.
A
Now,
in
order
for
our
applications
to
use
persistent
storage,
we
need
to
do
a
couple
of
things:
one,
the
administrator
and
each
to
set
up
persistent
storage
or
make
persistent
storage
available
for
the
applications
to
use
which
involves
making
the
persistent
storage
available
as
what
we
call
sistent
volume
in
OpenShift.
We
are
using
NFS
here
as
an
example,
but
you
could
be
using
lustre
or
safe
or
any
other
storage
technology.
Openshift
supports
our
OpenShift
currently
supports
NFS,
but
very
soon
it's
going
to
support
Gluster
self
and
other
technologies
as
well.
A
If
you
look
at
the
NFS
exports,
I
have
a
couple
of
exports
here.
They
are
by
our
export
wall,
one
and
wall
two
and
they
are
set
up
as
red
riots.
Inc
all
squash.
Now,
as
an
administrator
on
the
OpenShift
host
I'm
trying
to
set
up
a
persistent
volume,
actually
I
already
have
a
persistent
volume,
so
one
of
them
is
mounted
as
PV
0
0
1.
Now
let
me
show
you
what
I
have
I
mounted
the
VAR
export
wall,
one
which
we
have
seen
here?
A
The
first
one
with
the
name
PV
0,
0
1-
now,
let's
mount
another
one
as
as
PV
0,
0,
2
I'm,
just
copying
this
set
all
I'm
going
to
do
is
say
that
the
name
of
the
volume
is
PV.
0
0
to
the
size
in
my
case
is
fight
well
megabytes
and
I'm
volume
2,
and
this
is
on
so
in
so
NFS
server.
This
is
the
add
IP
address
of
my
NFS
server.
After
making
this
change
I'm
just
going
to
create
based
on
this
file.
A
Now
it
has
mounted
PV
triple
0
to
so.
If
I
do
OC
get
PV.
I
should
see
two
volumes
here.
One
is
with
5
gigabytes
storage
and
the
other
one
is
fine
and
12
mega
Y
storage
and
it's
pv
0
0
1
and
pv
0
0
2,
so
I
have
two
different
persistent
volumes.
They
are
not
used
it
there's
they
are
still
available.
Now
the
job
of
administrator
is
done.
We
made
the
persistent
volume
available
now.
A
A
A
At
this
time,
open
shift
will
will
spin
up
a
new
pod
for
this,
my
sequel
database,
and
it
will
also
create
what
we
call
persistent
volume
claim,
because
this
is
a
persistent
database,
it
will
ask
for
persistent
volume
claim
which
will
go
and
pull
the
use
one
of
those
persistent
volumes
available.
So
let's
I'm
using
the
persistent
project
if
I
say
also
get
parse.
This
my
sequel
pod
is,
is
spinning
up
it's
not
ready
yet
and
if
I
run
OC
get
PVC.
Pvc
stands
for
persistent
volume
claim,
and
this
is
done
by
the
user.
A
Who
is
asking
for
it?
And
if
you
look
at
it
it
is,
it
is
actually
now
it
has
created
a
persistent
volume
claim
and
that
persistent
volume
claim
is
bound
to
pv
triple
0
to
now
going
back
to
the
master.
If
you
look
at
pv
0,
0
1,
that
was
5
gigabytes
and
pv
0
0
2
was
512
mega
megabytes
right.
We
asked
for
512
megabytes,
so
openshift
has
automatically
matched
in
spite
of
to
being
available.
A
It
picked
the
one
of
the
right
size
and
it
got
that
allocated
to
the
persistent
volume
tray
now
if
I
do
run,
OC
get
PV,
it
shows
that
the
persistent
volume
0
0
2
is
bound
to
the
my
sequel
wall
to
the
my
sequel.
Volume
claim
that
week
that
that
got
created
when
we
created
the
application.
Now,
let's
use
this
and
see
how
it
how
it
works.
A
Now,
I'll
do
the
same
thing
like
before:
I'll
put
forward
to
the
demise
occult
part
and
from
the
other
window,
I'll
try
to
access
the
my
sequel,
client,
I'll,
use
the
sample
database
I'll,
add
a
table.
I'll
insert
a
few
users
I
see
all
my
users
exit.
Now,
let
me
cancel
port
forwarding
and
let
me
delete
the
power
like
before:
open
ship
spins
up
a
new
part.
Again,
it's
in
the
pending
status.
Now
it
is
running.
Let
me
port
forward
to
this
again.
A
A
It
shows
the
data,
so
this
is
exactly
what
we
wanted.
So
even
if
you
delete
the
part,
another
part
comes
up.
It
comes
to
the
same
persistent
storage
as
before,
and
the
data
is
is
available
to
use
right.
So
that
gives
us
the
advantage
of
persistent
storage
behind
the
part.
This
is
what's
just
one
example.
The
database
is
just
a
simple
example.
You
could
be
using
persistent
storage
in
different
ways.
A
Perhaps
you
could
be
writing
some
data
as
files
directly
from
your
application
onto
the
persistent
storage
and
that
that
data
is
available
across
multiple
parts
so
effectively,
you
could
have
multiple
parts
of
your
application,
sharing
the
same
persistence
story
at
the
same
time,
so
they
could
all
be
writing
data
into
the
persistent
origin.
It
is
available
across
all
the
applications
right.
A
So,
to
summarize,
the
administrator
creates
a
persistent
volume
and
makes
it
available,
and
the
users
are,
the
project's
can
claim
the
persistent
volumes
as
per
distant
volume,
Plains
open
chef,
we'll
look
at
the
list
of
available,
persistent
volumes
that
are
available
to
use
and
it
will
allocate
a
persistent
volume
or
it
will
grab
a
persistent
volume
of
appropriate
storage
size
that
is
equal
to
or
a
little
higher
than
the
the
size
that
is
being
asked
for
and
that's
how
it
works.
I
hope
you
enjoyed
the
video
thanks.
A
lot
for
watching.