Dennis Tretyakov:
Good time of a day everyone
Well i know replication controller is an obsolete tech and could be ignored, but still trying to clarify all the details for myself
I pretty much got the general idea, seems quite simple, but what I don’t understand is… is there any relation between replica controller metadata and pod metadata?
LR:
from k8s documentation
The ReplicationController can itself have labels (.metadata.labels). Typically, you would set these the same as the .spec.template.metadata.labels; if .metadata.labels is not specified then it defaults to .spec.template.metadata.labels. However, they are allowed to be different, and the .metadata.labels do not affect the behavior of the ReplicationController.
LR:
so, no there is no relation and RC can have different labels, but the selector in RC (missing in your example) should point to labels of Pod that you wish to apply the RC policy.
so in your example, this should go below replica
selector:
app: myapp
though I think selector is optional for RC but mandatory for Replicasets (should be confirmed)
Dennis Tretyakov:
@LR thank you, just came to the same conclusions, but still wanted to hear that I’m not alone