1
Q

What is a multi-container pod in Kubernetes?

A

A multi-container pod in Kubernetes is a pod that runs multiple containers that share the same network namespace and storage volumes.

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

What is the purpose of using multi-container pods?

A

Multi-container pods are used to group containers that work together closely within the same pod, enabling them to share data and resources.

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

Can containers within a multi-container pod communicate with each other using localhost?

A

Yes, containers within the same pod can communicate with each other using localhost, as they share the same network namespace.

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

What are some common use cases for multi-container pods?

A

Common use cases for multi-container pods include using a sidecar container for log collection, an adapter container for data transformation, or an ambassador container for accessing external services.

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

How can you define a multi-container pod in a YAML file?

A

In a YAML file, you define a multi-container pod by listing multiple containers under the containers section within the pod’s specification.

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

What command is used to create a multi-container pod from a YAML file?

A

The kubectl create -f command followed by the YAML file name is used to create a multi-container pod.

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

How can you access and interact with a specific container within a multi-container pod?

A

You can access and interact with a specific container within a multi-container pod using the kubectl exec -it command, specifying the pod name and container name.

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

What is the purpose of using multi-container pods over single-container pods?

A

Multi-container pods are used when containers need to work closely together and share resources within the same pod, keeping related functionalities grouped together.

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

What happens if one container in a multi-container pod fails?

A

If one container in a multi-container pod fails, Kubernetes may restart it automatically, ensuring that the desired state of the pod is maintained.

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

Can multi-container pods have containers with different base images?

A

Yes, multi-container pods can have containers with different base images, allowing for flexibility in choosing the appropriate tools or functionalities for each container.

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

What is the fundamental networking model in Kubernetes?

A

The fundamental networking model in Kubernetes is a flat network, where most resources within a cluster can communicate with each other.

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

How are IP addresses assigned to pods in Kubernetes?

A

Pods in Kubernetes are assigned ephemeral IP addresses, meaning these IP addresses may change if a pod is rescheduled.

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

Can containers within the same pod communicate with each other directly?

A

Yes, containers within the same pod can communicate with each other directly using localhost and different port numbers.

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

How do pods communicate with each other in Kubernetes?

A

Pods communicate with each other through services, which act as load balancers for network traffic within the cluster.

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

What is a load balancer service in Kubernetes used for?

A

A load balancer service in Kubernetes is used to route external network traffic to pods within the cluster, providing external access to services.

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

Can pods on different nodes communicate with each other directly?

A

Yes, pods on different nodes within a Kubernetes cluster can communicate with each other directly.

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

What is the purpose of labels and selectors in Kubernetes networking?

A

Labels and selectors are used to identify, describe, and group related sets of objects or resources, allowing for easy filtering and selection.

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

How do labels and selectors work together in Kubernetes?

A

Selectors use labels to filter or select objects. Objects with labels that match the selector’s criteria are selected.

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

What are some common use cases for services in Kubernetes networking?

A

Common use cases for services in Kubernetes networking include load balancing traffic to pods, providing a stable endpoint for pods, and enabling service discovery.

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

What is the difference between ephemeral IP addresses and persistent IPs in Kubernetes?

A

Ephemeral IP addresses are assigned to pods and may change if a pod is rescheduled, while persistent IPs are assigned to services and remain stable for external access.

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

What is the primary purpose of multi-container pods in Kubernetes?

A

The primary purpose of multi-container pods is to allow multiple containers to run within the same pod and share resources.

22
Q

How can you define multi-container pods in a Kubernetes YAML file?

A

Multi-container pods are defined in a Kubernetes YAML file by specifying multiple container sections under the same pod definition.

23
Q

What is the benefit of using multi-container pods for log collection?

A

Using multi-container pods for log collection allows a sidecar container to collect and store log data, keeping the main application container clean and focused.

24
Q

In the sidecar pattern, what role does the sidecar container play?

A

In the sidecar pattern, the sidecar container provides additional functionalities or services to the main application container, such as log collection or data backup.

25
Q

What is the role of the Ambassador pattern in multi-container pods?

A

In the Ambassador pattern, the Ambassador container acts as an intermediary that connects the main application container to external services or data stores, abstracting the communication complexity.

26
Q

Why is using multi-container pods beneficial for separating infrastructure code from application code?

A

Using multi-container pods allows infrastructure-related code, such as log collection or data synchronization, to be placed in separate helper containers, keeping the application code clean and focused.

27
Q

How can you open a session inside a specific container within a multi-container pod?

A

You can open a session inside a specific container within a multi-container pod using the kubectl exec -it command with the pod name and container name.

28
Q

What command can you use to get the logs for a specific container within a multi-container pod?

A

You can use the kubectl logs command with the pod name and container name to get the logs for a specific container within a multi-container pod.

29
Q

How can you delete a multi-container pod using kubectl?

A

You can delete a multi-container pod using kubectl delete pod followed by the pod name.

30
Q

What is a workload in the context of Kubernetes?

A

In the context of Kubernetes, a workload is an application or a set of containers running within a Kubernetes cluster.

31
Q

What is the fundamental unit of a workload in Kubernetes?

A

What is the fundamental unit of a workload in Kubernetes?

32
Q

How do workloads provide self-healing capabilities in Kubernetes?

A

Workloads, such as ReplicaSets and Deployments, provide self-healing capabilities by ensuring that the desired number of instances (Pods) are running, and if a Pod fails, it is automatically replaced.

33
Q

What is the role of a ReplicaSet in Kubernetes?

A

A ReplicaSet’s primary role in Kubernetes is to manage the desired number of replica Pods, ensuring that they are running and maintaining the specified number.

34
Q

What extra functionalities do Deployments provide on top of ReplicaSets?

A

Deployments provide extra functionalities on top of ReplicaSets, including rolling updates, version management, and the ability to define declarative desired states.

35
Q

When is it recommended to use Deployments over ReplicaSets?

A

It is recommended to use Deployments over ReplicaSets when you need to manage application updates, rollback to previous versions, and maintain desired states more easily.

36
Q

What are StatefulSets used for in Kubernetes?

A

StatefulSets are used in Kubernetes to manage stateful applications, ensuring stable and predictable network identities and persistent storage for each Pod.

37
Q

What is the primary use case for DaemonSets in Kubernetes?

A

The primary use case for DaemonSets is to ensure that a specific Pod runs on every node in the cluster, typically for cluster-level operations or infrastructure-related tasks.

38
Q

What are Jobs and CronJobs used for in Kubernetes?

A

Jobs and CronJobs in Kubernetes are used for running tasks that are expected to run to completion, such as batch processing or scheduled tasks.

39
Q

What is the primary purpose of a ReplicaSet in Kubernetes?

A

The primary purpose of a ReplicaSet in Kubernetes is to ensure that a specified number of replica Pods are running at all times.

40
Q

What happens if a Pod managed by a ReplicaSet fails or is deleted?

A

If a Pod managed by a ReplicaSet fails or is deleted, the ReplicaSet automatically replaces it to maintain the desired number of replicas.

41
Q

How do you define the desired number of replica Pods in a ReplicaSet?

A

The desired number of replica Pods in a ReplicaSet is defined using the replicas field in the ReplicaSet’s configuration.

42
Q

What is the difference between a ReplicaSet and a Deployment in Kubernetes?

A

A Deployment provides additional functionalities like rolling updates and version management on top of a ReplicaSet, making it more suitable for managing applications with changing versions.

43
Q

How can you create a ReplicaSet in Kubernetes?

A

You can create a ReplicaSet in Kubernetes by defining a ReplicaSet configuration in a YAML file and then applying it using kubectl apply -f filename.yaml.

44
Q

What command is used to list ReplicaSets in a Kubernetes cluster?

A

You can list ReplicaSets in a Kubernetes cluster using the kubectl get rs command.

45
Q

How can you delete a ReplicaSet in Kubernetes?

A

You can delete a ReplicaSet in Kubernetes using the kubectl delete rs command followed by the name of the ReplicaSet.

46
Q

What is the purpose of the selector field in a ReplicaSet?

A

The selector field in a ReplicaSet is used to specify the criteria for selecting which Pods are part of the replica set. It matches Pods based on their labels

47
Q

Can you update the number of replicas for an existing ReplicaSet?

A

Yes, you can update the number of replicas for an existing ReplicaSet by modifying the replicas field in its configuration and then applying the changes using kubectl apply.

48
Q

What is the role of a ReplicaSet’s template field?

A

The template field in a ReplicaSet specifies the Pod template to be used when creating new replica Pods. It defines the container images, labels, and other settings for the replica Pods.

49
Q

In what situations is a ReplicaSet useful in Kubernetes?

A

A ReplicaSet is useful in Kubernetes when you want to ensure high availability and maintain a specific number of identical Pods, such as in stateless applications.

50
Q

How does a ReplicaSet handle Pod failures or deletions?

A

When a Pod managed by a ReplicaSet fails or is deleted, the ReplicaSet controller automatically detects this and creates a replacement Pod to maintain the desired number of replicas.

51
Q

Can a ReplicaSet be used for managing stateful applications?

A

ReplicaSets are typically used for managing stateless applications where each Pod is identical. Stateful applications are better managed using StatefulSets, which provide stable network identities and ordered pod creation.

52
Q

What is the key difference between a ReplicaSet and a DaemonSet?

A

The key difference is that a ReplicaSet ensures a specified number of replica Pods are running in the cluster, while a DaemonSet ensures that exactly one Pod is running on each node in the cluster.