Kubernetes Services Flashcards

1
Q

What is a Cluster IP Service in Kubernetes?

A

A Cluster IP Service in Kubernetes is a type of service that provides internal-only visibility within the cluster. It assigns a durable IP address and DNS name to selected pods, allowing communication between pods within the cluster.

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

How does a Cluster IP Service route incoming traffic to pods?

A

A Cluster IP Service routes incoming traffic to pods based on the labels and selectors defined in its configuration. It selects pods with specific labels and directs traffic to them.

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

Can you access a Cluster IP Service from outside the cluster or the internet?

A

No, by default, a Cluster IP Service is not accessible from outside the cluster or the internet. It is intended for internal communication within the cluster.

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

What are the key properties of a Cluster IP Service definition?

A

The key properties of a Cluster IP Service definition include:

Port: The port on which the service listens within the cluster.
Target Port: The port on which the selected pods are listening.
Selector: Labels used to select the pods that the service routes traffic to.

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

When should you use a Cluster IP Service?

A

You should use a Cluster IP Service when you need to provide durable and internal-only communication between pods within the Kubernetes cluster. It’s suitable for microservices that require internal connectivity.

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

How does a Cluster IP Service route incoming traffic to pods?

A

A Cluster IP Service routes incoming traffic to pods based on the labels and selectors defined in its configuration. It selects pods with specific labels and directs traffic to them.

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

Can you access a Cluster IP Service from outside the cluster or the internet?

A

No, by default, a Cluster IP Service is not accessible from outside the cluster or the internet. It is intended for internal communication within the cluster.

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

What are the key properties of a Cluster IP Service definition?

A

The key properties of a Cluster IP Service definition include:

Port: The port on which the service listens within the cluster.
Target Port: The port on which the selected pods are listening.
Selector: Labels used to select the pods that the service routes traffic to.

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

When should you use a Cluster IP Service?

A

You should use a Cluster IP Service when you need to provide durable and internal-only communication between pods within the Kubernetes cluster. It’s suitable for microservices that require internal connectivity.

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

What is a Node Port Service in Kubernetes?

A

A Node Port Service in Kubernetes is a type of service that extends Cluster IP and provides external visibility, allowing access to pods from outside the cluster.

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

How does a Node Port Service work?

A

A Node Port Service maps a port on the nodes (machines) in the cluster to a port on the selected pods. It makes pods accessible externally via the node’s IP address and the designated port.

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

What is the range of port numbers available for Node Port Services?

A

Node Port Services use port numbers in the range between 30,000 and 32,767 for external access. You can specify a specific port within this range or allow Kubernetes to assign one.

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

When might you use a Node Port Service?

A

You might use a Node Port Service when you need to expose specific pods externally, such as for web applications or APIs, and need to access them from outside the cluster.

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

How can you determine the Node Port assigned to a Node Port Service?

A

You can determine the Node Port assigned to a Node Port Service by inspecting the service definition or using the kubectl get svc command.

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?

A

A Load Balancer Service in Kubernetes is a type of service that extends Node Port and provides external access with automatic load balancing. It often works with cloud providers’ load balancer services.

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

How does a Load Balancer Service distribute traffic to pods?

A

A Load Balancer Service distributes incoming traffic across multiple pods using load balancing algorithms, ensuring high availability and scalability.

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

In what scenarios would you use a Load Balancer Service?

A

You would use a Load Balancer Service when you need to expose applications or services externally while distributing incoming traffic across multiple pods for redundancy and scalability.

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

What is the key advantage of a Load Balancer Service over Node Port?

A

The key advantage of a Load Balancer Service over Node Port is that it offers automatic load balancing, making it suitable for high-traffic applications and ensuring even distribution of requests.

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

Can a Load Balancer Service work in a non-cloud Kubernetes environment?

A

While Load Balancer Services are commonly used with cloud providers’ load balancers, they can also work in non-cloud environments with the help of specialized load balancer solutions.

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

What is a Load Balancer Service in Kubernetes?

A

A Load Balancer Service in Kubernetes is a type of service that extends Node Port and provides external access with automatic load balancing. It often works with cloud providers’ load balancer services.

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

How does a Load Balancer Service distribute traffic to pods?

A

A Load Balancer Service distributes incoming traffic across multiple pods using load balancing algorithms, ensuring high availability and scalability.

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

In what scenarios would you use a Load Balancer Service?

A

You would use a Load Balancer Service when you need to expose applications or services externally while distributing incoming traffic across multiple pods for redundancy and scalability.

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

What is the key advantage of a Load Balancer Service over Node Port?

A

The key advantage of a Load Balancer Service over Node Port is that it offers automatic load balancing, making it suitable for high-traffic applications and ensuring even distribution of requests.

24
Q

Can a Load Balancer Service work in a non-cloud Kubernetes environment?

A

While Load Balancer Services are commonly used with cloud providers’ load balancers, they can also work in non-cloud environments with the help of specialized load balancer solutions.

25
Q

What is the primary problem that Kubernetes Services aim to solve?

A

Kubernetes Services aim to solve the problem of providing a stable and reliable way to access and communicate with pods, which have ephemeral IP addresses.

26
Q

What is a Kubernetes Service?

A

A Kubernetes Service is an abstraction that defines a logical set of pods and a policy by which to access them. It provides a durable IP address and DNS name for accessing the pods.

27
Q

What is the role of selectors in Kubernetes Services?

A

Selectors are used in Kubernetes Services to identify and select the pods that the service should route traffic to based on labels associated with those pods.

28
Q

What are the different types of Kubernetes Services?

A

Kubernetes supports various types of services, including Cluster IP, Node Port, Load Balancer, and Ingress, each serving specific use cases for exposing and accessing applications.

29
Q

How does a Kubernetes Service provide load balancing to pods?

A

Kubernetes Services provide load balancing by distributing incoming traffic across multiple pods that match the selector criteria defined in the service configuration.

Flashcard 6:

30
Q

Can Kubernetes Services be used for external access to applications?

A

Yes, Kubernetes Services can be used to provide external access to applications within the cluster by using services like Node Port, Load Balancer, or Ingress.

31
Q

What is the purpose of exposing a Kubernetes Deployment?

A

Exposing a Kubernetes Deployment allows external access to the application deployed within the pods of that Deployment.

32
Q

How can you expose a Deployment using a Kubernetes Service?

A

You can expose a Deployment by creating a Kubernetes Service that selects the pods from the Deployment using labels and routes traffic to them.

33
Q

What is the default type of Service in Kubernetes for exposing Deployments?

A

The default type of Service for exposing Deployments is the Cluster IP Service, which provides internal cluster access.

34
Q

How can you expose a Deployment to external traffic in Kubernetes?

A

To expose a Deployment to external traffic, you can use service types like Node Port, Load Balancer, or Ingress, depending on your specific requirements.

35
Q

What is the default type of Service in Kubernetes for exposing Deployments?

A

The default type of Service for exposing Deployments is the Cluster IP Service, which provides internal cluster access.

36
Q

How can you expose a Deployment to external traffic in Kubernetes?

A

To expose a Deployment to external traffic, you can use service types like Node Port, Load Balancer, or Ingress, depending on your specific requirements.

37
Q

What is the Node Port service type in Kubernetes?

A

The Node Port service type exposes the Deployment on a static port on each node in the cluster, allowing external access using the node’s IP address and the defined port.

38
Q

When would you use a Load Balancer service type to expose a Deployment?

A

You would use a Load Balancer service type to expose a Deployment when you need to distribute external traffic across multiple pods in a load-balanced manner.

39
Q

What is an Ingress resource in Kubernetes, and how does it relate to exposing Deployments?

A

An Ingress resource defines rules for routing external HTTP and HTTPS traffic to Services, allowing more advanced routing and path-based access control for exposing Deployments.

40
Q

What is a Load Balancer Service in Kubernetes?

A

A Load Balancer Service in Kubernetes is a type of service that distributes incoming network traffic across multiple pods to ensure high availability and scalability of an application.

41
Q

How does Docker Desktop emulate a Load Balancer Service for local testing?

A

Docker Desktop emulates a Load Balancer Service for local testing by mapping the Load Balancer’s IP address to localhost, allowing you to test load balancing locally.

42
Q

What is the purpose of a Load Balancer Service with Docker Desktop?

A

The purpose of a Load Balancer Service with Docker Desktop is to test the load balancing behavior of your application locally, simulating a real load balancer.

43
Q

What range of ports can be used for Node Ports in Kubernetes?

A

Node Ports in Kubernetes can be assigned a port within the range of 30,000 to 32,767.

44
Q

How can you access a Load Balancer Service when using Docker Desktop for local testing?

A

When using Docker Desktop for local testing, you can access the Load Balancer Service by using “localhost” followed by the assigned port number.

45
Q

What information can you obtain using the kubectl get svc command?

A

The kubectl get svc command allows you to obtain information about the Services in your Kubernetes cluster, including their names, types, cluster IP addresses, and ports.

46
Q

When using a cloud provider, how do you obtain the public IP address of a Load Balancer Service?

A

When using a cloud provider, you can obtain the public IP address of a Load Balancer Service by inspecting the “EXTERNAL-IP” column in the output of the kubectl get svc command.

47
Q

What are persistent concepts in Kubernetes?

A

Persistent concepts in Kubernetes refer to the mechanisms and features that enable the storage and management of data that persists beyond the lifetime of individual containers or pods.

48
Q

Why are persistent concepts important in containerized environments?

A

Persistent concepts are important in containerized environments because containers are typically stateless and ephemeral, so they do not retain data between container restarts or failures.

49
Q

What is a Persistent Volume (PV) in Kubernetes?

A

A Persistent Volume (PV) in Kubernetes is a cluster-level resource that represents a piece of physical storage in the cluster. It is used to provision storage resources for applications.

50
Q

What is a Persistent Volume Claim (PVC) in Kubernetes?

A

A Persistent Volume Claim (PVC) in Kubernetes is a request for storage by a pod. It is used to claim and bind a specific Persistent Volume to a pod, providing access to persistent storage.

51
Q

How does Kubernetes ensure data persistence when using PVs and PVCs?

A

Kubernetes ensures data persistence by associating PVCs with PVs and allowing pods to access and use the PVs. This association ensures that data remains available even if pods are rescheduled or recreated.

52
Q

What is a Storage Class in Kubernetes?

A

A Storage Class in Kubernetes is an object that defines the type of storage that can be dynamically provisioned using PVCs. It allows administrators to define storage classes with specific attributes.

53
Q

What is the role of a Persistent Volume (PV) in the lifecycle of data storage in Kubernetes?

A

A Persistent Volume (PV) in Kubernetes serves as a storage resource that can be claimed by PVCs. It encapsulates details about the physical storage, including capacity and access modes.

54
Q

How can data be retained across pod restarts or failures in Kubernetes?

A

Data can be retained across pod restarts or failures in Kubernetes by using Persistent Volumes (PVs) and Persistent Volume Claims (PVCs) to ensure that storage is persistent and accessible to pods.

55
Q

What benefits do persistent concepts bring to stateful applications in Kubernetes?

A

Persistent concepts in Kubernetes benefit stateful applications by providing them with reliable and durable storage solutions, ensuring data integrity and availability.