Chapter 5. Pods Flashcards

1
Q

What is a Pod ?

A

A Pod represents a collection of application containers and volumes running in the same execution environment. Pods, not containers, are the smallest deployable artifact in a Kubernetes cluster. This means all of the containers in a Pod always land on the same machine.

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

What Do Pods share ?

A
  1. Share the same IP
  2. Share the same port space ( network namespace )
  3. Have the same hostname ( UTS namespace )
  4. can communicate using native interprocess communication channels over System V IPC or POSIX message queues (IPC namespace)

Applications in different Pods are isolated from each other

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

What is the right question to ask yourself when designing Pods ?

A

Will these containers work correctly if they land on different machines?” If the answer is “no,” a Pod is the correct grouping for the containers. If the answer is “yes,” multiple Pods is probably the correct solution.

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

What is a pod manifest ?

A

Pods are described in a Pod manifest. The Pod manifest is just a text-file representation of the Kubernetes API object. Kubernetes strongly believes in declarative configuration.

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

Command to create a Pod:

A

kubectl run kuard –generator=run-pod/v1 \

–image=gcr.io/kuar-demo/kuard-amd64:blue

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

Command to delete a Pod:

A

kubectl delete pods/kuard

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

Command to access your pod:

A

kubectl port-forward kuard 8080:8080

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

Command to access your log:

A

kubectl logs kuard

kubectl -f logs kuard

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

Command to access your log from your previous instance of the container:

A

kubectl logs kuard –previous

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

Command to get an interactive session:

A

kubectl exec -it kuard ash

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

Command to execute command in the context of the container itself:

A

kubectl exec kuard date

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

Copy files to and from Containers

A

kubectl cp :/captures/capture3.txt ./capture3.txt

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

Copy files From and To Containers:

A

kubectl cp $HOME/config.txt :/config.txt

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

What methods we can use to check application health ?

A
  1. Liveness Probe
  2. Readiness Probe
  3. tcpSocket health checks
  4. exec probes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which metrics Kubernetes allows to specify ?

A
  1. Resource requests specify the minimum amount of a resource required to run the application.
  2. Resource limits specify the maximum amount of a resource that an application can consume.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you add volumes to a pod ?

A

By using:

  1. spec.volumes: This array defines all of the volumes that may be accessed by containers in the Pod manifest
  2. volumeMounts: This array defines the volumes that are mounted into a particular container, and the path where each volume should be mounted
17
Q

Name same ways of Using volumes with pods:

A
  1. COMMUNICATION/SYNCHRONIZATION
  2. CACHE
  3. PERSISTENT DATA
  4. MOUNTING THE HOST FILESYSTEM
  5. Persisting Data Using Remote Disks