Deployment and replicaset prefix are different

Hello,

on “demo: deployments” section on kubernetes for the absolute beginners course, the deployment was created as name myapp-deployment. As per the previous lecture names lecture, the replicaset name should be prefixed with deployment name e.g. mayapp-deployment-87965638 but in the demo video name of replicaset is my-replicaset.

So how is this possible? From where it’s picking the name of replicaset?

Attached are three images :

  1. the theory section
  2. yaml file for deployment
  3. the final outcome after deployment was created.

Thanks
Ashish

Hi @06ashishrawat,

You can add a custom name to replicaset definition file and then deploy the replicaset all the pods associated with this replica will be prefixed with the name of the replica.

Regarding the deployment, when creating a deployment all the replicas and pods associated with this deployment will be prefixed with the name of the deployment.

Hello @KodeKloud,

that’s what my doubt is. Like you mentioned : Regarding the deployment, when creating a deployment all the replicas and pods associated with this deployment will be prefixed with the name of the deployment.

But please see the attached screesnhot - name of deployment is myapp-deployment but the name of replicaset is myapp-replicaset and pods name are also prefixed with myapp-replicaset. Shouldn’t replicaset and pods names be prefixed with myapp-deployment, instead of myapp-replicaset? How’s that possible.

Thanks
Ashish

Hello @06ashishrawat
Is this created by you?

hello @player001 no I didn’t create it… This is in course itself, if you see kubernetes for the absolute beginners course, there you see Demo: Deployments video, there it’s happening… And I didn’t get how this is possible… In that 4 minute video, a deployment with name myapp-deployment is being created but replicaset and pods name are comming different.

Ohh, you don’t need to be confuse at this moment. We will note it down this issue. As you discussed and Kodekloud respond stick with it. Might be the same name of the replicaset and deployment created a confusion.

Both is different at this scenario. Just because of name. You got confused.

OK @player001 thanks a lot. So deployment -> replicaset -> PODS… All 3 will have same prefixed and that will be the name of deployment.
I was getting confused because of that video, how prefixed is different for deployment and replicaset under same deployment.
Thanks for the clarification.