Kubernetes Probes Flashcards

1
Q

What are Kubernetes Probes?

A

Kubernetes Probes are mechanisms used to check the health and responsiveness of containers running within pods in a Kubernetes cluster.

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

What are the three types of Kubernetes probes?

A

he three types of Kubernetes probes are:

Startup Probe: Determines when a container has started and is ready to accept traffic.
Readiness Probe: Checks if a container is ready to accept traffic and should be used to avoid sending traffic to a container before it’s fully prepared.
Liveness Probe: Ensures that a container is still running and can restart the container if it becomes unresponsive.

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

How can probes be configured in a Kubernetes pod?

A

Probes can be configured in a Kubernetes pod by specifying them in the pod’s YAML configuration. You define the probe type, the command or action to execute, initial delay seconds, period seconds, and failure thresholds.

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

What is the purpose of the Liveness Probe?

A

The Liveness Probe is used to check if a container is still running and functioning correctly. If the liveness probe fails, Kubernetes will restart the container.

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

How does Kubernetes perform probing actions?

A

Kubernetes can perform probing actions in three ways: using the exec action to run a command inside the container, using the tcpSocket action to check if a TCP socket port is open, or using the httpGet action to make an HTTP GET request.

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

Liveness Probe Example

A

apiVersion: v1
kind: Pod
metadata:
name: liveness-pod
spec:
containers:
- name: my-container
image: my-image:latest
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
In this example:

We define a pod named liveness-pod with a single container named my-container using a specific Docker image (my-image:latest).
The Liveness Probe is configured with an HTTP GET action. It checks the /healthz path on port 8080 of the container.
initialDelaySeconds is set to 15, which means Kubernetes will wait for 15 seconds after the container starts before performing the first liveness probe.
periodSeconds is set to 20, indicating that Kubernetes will check the liveness of the container every 20 seconds.
This configuration ensures that Kubernetes checks the /healthz endpoint of the container every 20 seconds, starting 15 seconds after the container has started. If the probe fails, Kubernetes will restart the container.

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

Kubernetes Dashboards

A

Kubernetes Dashboards are web-based or desktop user interfaces that provide graphical representations and management capabilities for Kubernetes clusters. They allow users to visualize, monitor, and manage containerized applications, pods, services, deployments, and other resources within a Kubernetes cluster. Popular Kubernetes dashboards include the official Kubernetes Dashboard, Lens, and K9s, each offering unique features and interfaces for cluster administration.

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

What is a Kubernetes StatefulSet?

A

A Kubernetes StatefulSet is a resource object used for managing stateful applications. It ensures that pods are deployed and scaled in a predictable and ordered manner, with stable network identities and persistent storage.

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

What is Lens?

A

Lens is a free, open-source desktop application used for managing Kubernetes clusters. It provides a user-friendly graphical interface for interacting with Kubernetes clusters, viewing resources, editing YAML manifests, and performing various Kubernetes-related tasks.

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

What platforms is Lens available on?

A

Lens is available on Windows, macOS, and Linux, making it accessible to a wide range of users across different operating systems.

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

How does Lens connect to Kubernetes clusters?

A

Lens connects to Kubernetes clusters by utilizing the kubeconfig file, which contains cluster authentication information. Users can select and connect to clusters from their kubeconfig files within the Lens application.

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

What features does Lens offer for Kubernetes management?

A

Lens offers various features for Kubernetes management, including cluster visualization, resource monitoring, integrated terminal, YAML editing with syntax highlighting and validation, Helm chart support, cluster-wide search, and more.

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

How does Lens assist with managing Kubernetes resources?

A

Lens provides a visual representation of Kubernetes resources within clusters, allowing users to view pods, services, deployments, stateful sets, and other objects. It simplifies resource management by offering an intuitive interface for creating, editing, and monitoring Kubernetes resources.

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

Can Lens be used to manage multiple Kubernetes clusters?

A

Yes, Lens supports the management of multiple Kubernetes clusters. Users can switch between different clusters and contexts within the application, making it suitable for managing complex multi-cluster environments.

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

Is Lens suitable for both beginners and experienced Kubernetes users?

A

Yes, Lens is designed to cater to both beginners and experienced Kubernetes users. Its user-friendly interface makes it accessible to newcomers, while its advanced features and capabilities are valuable for experienced Kubernetes administrators.

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

Is Lens a commercially supported product?

A

While the core version of Lens is open-source and free to use, there is also a Lens Enterprise version that offers additional features and support. Organizations looking for enterprise-level support and features can opt for Lens Enterprise.

17
Q

What is K9s?

A

K9s is a text-based terminal dashboard for managing and interacting with Kubernetes clusters. It provides a command-line interface (CLI) for monitoring and controlling various aspects of Kubernetes clusters.

18
Q

In which environments can K9s be used?

A

K9s can be used on multiple platforms, including Windows, macOS, and Linux. It is designed to work in terminal environments, making it versatile and accessible to users on different operating systems.

19
Q

What are the key features of K9s?

A

K9s offers several key features for Kubernetes management, including:

Resource Monitoring: Users can monitor various Kubernetes resources, such as pods, services, deployments, and more, directly from the terminal.

Resource Interaction: K9s allows users to interact with resources by viewing logs, describing objects, and executing commands within pods.

Resource Management: Users can perform resource management tasks, such as scaling deployments, deleting resources, and editing YAML manifests.

Search Functionality: K9s provides search functionality to quickly locate specific resources or pods within the cluster.

Shell Integration: Users can open shell sessions within pods, facilitating troubleshooting and debugging tasks.

20
Q

How does K9s assist with resource monitoring?

A

K9s provides a clear and concise terminal-based dashboard that displays real-time information about the state of Kubernetes resources within a cluster. Users can easily view resource status, health, and other relevant details.

21
Q

Can K9s be used for troubleshooting and debugging?

A

Yes, K9s is a valuable tool for troubleshooting and debugging Kubernetes workloads. It allows users to access pod logs, open shell sessions within pods, and execute commands directly from the terminal, making it easier to diagnose and resolve issues.

22
Q

Is K9s suitable for managing multiple Kubernetes clusters?

A

K9s is primarily focused on managing a single Kubernetes cluster at a time. Users can switch between different clusters by configuring their kubeconfig files, but K9s does not provide built-in multi-cluster management features.

23
Q

Is K9s a commercially supported product?

A

K9s is an open-source project and does not have a commercial version. It is maintained by the community and available for free. Users can contribute to its development and benefit from its features without additional costs.

24
Q

What is Lens Dashboard?

A

Lens Dashboard is a free graphical user interface (GUI) tool for managing Kubernetes clusters. It provides an intuitive way to view, edit, and interact with resources in your Kubernetes cluster.

25
Q

How can you install Lens Dashboard on your local machine?

A

You can install Lens Dashboard on Windows, Mac, or Linux by downloading the setup files from the official website (k8s-lens.io) or by using package managers like Chocolatey (Windows) or Homebrew (Mac).

26
Q

What is the purpose of Lens Dashboard in Kubernetes?

A

Lens Dashboard allows you to easily manage and monitor your Kubernetes clusters, view resource counts, edit YAML manifests, and perform various actions on cluster resources.

27
Q

How can you switch between different Kubernetes clusters in Lens Dashboard?

A

You can switch between different Kubernetes clusters in Lens Dashboard by clicking the hamburger menu on the left-hand side and selecting the desired cluster from the drop-down list.

28
Q

What actions can you perform using Lens Dashboard?

A

Using Lens Dashboard, you can deploy, scale, delete, and monitor Kubernetes resources, view logs, access terminals within pods, and edit YAML manifests directly within the interface.

29
Q

What is the purpose of the Horizontal Pod Autoscaler (HPA) in Kubernetes?

A

The HPA in Kubernetes is used to automatically scale the number of pods up or down based on specified metrics, ensuring that the application maintains the desired level of resource utilization.

30
Q

What is the Metric Server, and why is it needed for the HPA to function?

A

The Metric Server is a component in Kubernetes that collects resource utilization metrics from pods and nodes. It is needed for the HPA to gather data about the cluster’s resource usage and make scaling decisions.

31
Q

How can you install the Metric Server for Kubernetes?

A

The Metric Server can be installed in Kubernetes by applying a YAML manifest. It is important to include the –kubelet-insecure-tls flag when starting the Metric Server on Docker Desktop.

32
Q

What are the steps involved in using the HPA to scale pods in Kubernetes?

A

The steps to use the HPA include defining resource requests and limits, enabling the HPA for a deployment, specifying the metrics to scale on, and setting the minimum and maximum replica counts.

33
Q

What are the recommended next steps after completing a Kubernetes course?

A

After completing a Kubernetes course, the recommended next steps include deploying containers in the cloud using services from cloud providers like Google Cloud, Azure, Linux, and DigitalOcean. These providers often offer free credits for new accounts.