Ques:-
DevOps team is establishing a ReplicationController to deploy multiple pods for hosting applications that require a highly available infrastructure. Follow the specifications below to create the ReplicationController:
Create a ReplicationController using the nginx image with latest tag, and name it nginx-replicationcontroller.
Assign labels app as nginx_app, and type as front-end. Ensure the container is named nginx-container and set the replica count to 3.
All pods should be running state post-deployment.
Ans:-
🔍 What is a ReplicationController?
A ReplicationController (RC) is a Kubernetes object that:
- Ensures a fixed number of pod replicas are running.
- Automatically creates new pods if some fail or are deleted.
- Uses a label selector to manage the pods it controls.
⚠️ Note: ReplicationController has largely been replaced by Deployments and ReplicaSets, which offer more advanced features like rolling updates and rollbacks.
✅ Use Cases of ReplicationController
- High Availability: Ensures multiple instances of an application are always running.
- Fault Tolerance: Automatically replaces failed pods.
- Load Distribution: Helps distribute traffic across multiple pod replicas.
- Legacy Support: Still used in older Kubernetes setups or for backward compatibility.
🆚 ReplicationController vs ReplicaSet
Feature | ReplicationController | ReplicaSet |
---|---|---|
Label selector | Exact match only | Supports set-based |
Rolling updates | Not supported | Supported via Deployment |
Preferred usage | Legacy | Modern Kubernetes |
No comments:
Post a Comment