Reputation: 1431
In the Kubernetes website it mentions
The following is an example of a Deployment. It creates a ReplicaSet to bring up three nginx Pods:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
If it creates a ReplicaSet for you then for what reason would we create a new ReplicationController? Is that not duplicating something that exists?
I could just be confused as I'm still learning.
Upvotes: 0
Views: 82
Reputation: 4351
ReplicationController
's updated version is ReplicaSet
. ReplicaSet
is considered as a replacement of replication controller. The key difference between the replica set and the replication controller is: replication controller only supports equality-based selector whereas the replica set supports set-based selector.
As far the k8s doc : ReplicaSet is the next-generation ReplicationController that supports the new set-based label selector. It's mainly used by Deployment as a mechanism to orchestrate pod creation, deletion and updates. Note that we recommend using Deployments instead of directly using Replica Sets, unless you require custom update orchestration or don't require updates at all.
Upvotes: 1