Volume Types Flashcards

(11 cards)

1
Q

Why are containers and the data inside them described as transient in Docker?

A

Containers are meant to run briefly and be deleted and by default any data written inside the container filesystem is deleted when the container is removed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you persist data in Docker when a container is deleted?

A

You attach a volume when the container is created so the container writes data into the volume and the data remains even after the container is deleted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is the same persistence idea applied in Kubernetes?

A

Pods are also transient so you attach a volume to the pod and mount it into the container so data written to the mounted path survives after the pod is deleted.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In the lecture example what does the pod do and where does it write its output?

A

The pod generates a random number and writes it to a file under a path like slash opt out inside the container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In the example what storage option is used for the volume and what host path is chosen?

A

The example uses a hostPath volume that maps to a directory on the node such as slash data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does the container access the volume in the example?

A

The pod uses volumeMounts to mount the volume into the container for example mounting the data volume at slash opt so writes inside slash opt go to the volume.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

After the pod is deleted in the single node hostPath example where does the file still exist?

A

The file still exists on the node in the host directory such as slash data because the volume storage is outside the pod.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why is hostPath not recommended for multi node clusters?

A

In a multi node cluster each node has its own local filesystem so slash data on one node is not the same as slash data on another and pods can move between nodes leading to inconsistent or missing data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What kinds of storage backends does Kubernetes support besides hostPath?

A

Kubernetes supports many backends such as NFS GlusterFS Flocker Fibre Channel CephFS ScaleIO and cloud options like AWS EBS Azure Disk Azure File and Google Persistent Disk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In the lecture how do you switch from hostPath storage to an AWS EBS volume?

A

You replace the hostPath section in the volume definition with an awsElasticBlockStore section and specify fields like the volume ID and filesystem type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the key takeaway before moving on to persistent volumes?

A

Volumes let pods store data outside their transient lifecycle and the storage backend can be local like hostPath or external like cloud disks but persistent volumes build a more scalable model for managing that storage.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly