Kubernetes Objects Flashcards
What is Replication Controller responsible for?
Maintaining a stable set of replica pods running at any given time.
Ensuring that the specified number of replicas is always up, ready, and healthy.
Can be used to increase or decrease the number of running pods.
What is Replication Controller denoted?
RC
What is a ReplicaSet
Next generation of Replication Controller
What is the desired state?
It is what you want your cluster’s workload to look like; it is the spec defined in the manifest file of the deployment.
What is the actual state and where is it held?
It represents the current state of any Kubernetes object.
It is held in the etcd.
What is a Deployment
A Kubernetes object that controls deploying and maintaining a set of pods.
Features of Deployment
Uses a ReplicaSet to keep the pods running.
Supports rolling updates and rollbacks; rollouts can be paused.
Keeps history of past deployments and allows the administrator to easily roll back to previous deployments.
Provides high-level abstraction.
Offers sophisticated logic for deploying, updating, and scaling a set of pods within a cluster.
What’s the difference between a ReplicaSet and a ReplicaController
A ReplicaSet uses set-based selectors which gives it more abilities. A RS is also used by deployments
A RC uses equality-based selectors
Are replica sets meant to be created on their own?
No, they are meant to be automatically created when deployments are created.
How many ports does a ClusterIP Service require?
2 ports. Port and TargetPort. It does not allow external access
State Available
Replicas that are available to users
State Current
Replicas that are current running
State Desired
The desired number of replicas of the application
Up-to-Date state
The replicas that have been updated (scaled up or down) to achieve the desired state
What is a Service?
It is a layer of abstraction on top of pods — usually based on labels and selectors — that provides network connectivity to pods in a given cluster.
What is a Service responsible for
It acts as a virtual bridge allowing a set of pods to “talk” to another set.
It enables communication within the Kubernetes cluster and outside.
It also provides a form of round-robin load-balancing between pods.
What is a Service denoted
svc
How does a service work?
It uses a set of port numbers IP addresses to enable internal and external communication.
How many kinds of ports involved?
3.
Node port: used to expose the cluster externally
Port: The port that the service is available on internally (within the cluster).
TargetPort: The port that the pod listens on internally.
How many IP address a service define?
Only 1.
Cluster IP: Virtual IP address that the service itself is internally available on. Only accessible within the cluster.
Does all nodes share the same NodePort
Yes!
How to access a service
Use ClusterIP:Port
How many types of services are there?
3.
ClusterIP
NodePort
LoadBalancer
How many ports does a ClusterIP require?
2 ports. Port and TargetPort. It does not allow external access
What is NodePortService
A type of service that exposes the service on each node’s IP, making it accessible from outside the cluster at NodeIP:NodePort
What is NodePort denoted
NP
How many ports does a NP service require?
3.
Port
TargetPort
NodePort: Same for all nodes in a cluster.
Which clients can reach the NodePort?
Clients on same LAN or clients who can ping the host nodes. Cannot reached from the Internet
What does LoadBalancer Service do?
Exposes the service externally using a cloud provider’s load balancer.
It’s a standard way to expose a service to the Internet
What is the downside of LoadBalancer
Have to pay for a LoadBalancer per exposed service, which can be expensive
What is a RS responsible for
Same like RC, but it has SB selectors, give more abilities
What are the 4 states for Deployment, RS, RC
Available
Current
Desired
Up-to-date