Kubernetes Services Flashcards
What is a Cluster IP Service in Kubernetes?
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 does a Cluster IP Service route incoming traffic to pods?
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.
Can you access a Cluster IP Service from outside the cluster or the internet?
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.
What are the key properties of a Cluster IP Service definition?
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.
When should you use a Cluster IP Service?
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 does a Cluster IP Service route incoming traffic to pods?
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.
Can you access a Cluster IP Service from outside the cluster or the internet?
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.
What are the key properties of a Cluster IP Service definition?
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.
When should you use a Cluster IP Service?
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.
What is a Node Port Service in Kubernetes?
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 does a Node Port Service work?
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.
What is the range of port numbers available for Node Port Services?
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.
When might you use a Node Port Service?
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 can you determine the Node Port assigned to a Node Port Service?
You can determine the Node Port assigned to a Node Port Service by inspecting the service definition or using the kubectl get svc command.
What is a Load Balancer Service in Kubernetes?
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 does a Load Balancer Service distribute traffic to pods?
A Load Balancer Service distributes incoming traffic across multiple pods using load balancing algorithms, ensuring high availability and scalability.
In what scenarios would you use a Load Balancer Service?
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.
What is the key advantage of a Load Balancer Service over Node Port?
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.
Can a Load Balancer Service work in a non-cloud Kubernetes environment?
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.
What is a Load Balancer Service in Kubernetes?
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 does a Load Balancer Service distribute traffic to pods?
A Load Balancer Service distributes incoming traffic across multiple pods using load balancing algorithms, ensuring high availability and scalability.
In what scenarios would you use a Load Balancer Service?
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.