Açıklaması şöyle. spec/selector altındadır
matchLabel: tells what pods the deployment will apply to.
Açıklaması şöyle
Only Job, Deployment, Replica Set, and Daemon Set support matchLabels.
Örnek
Şöyle yaparız
kind: Deployment...metadata:name: nginxlabels:app: nginxtier: backendspec:selector:matchLabels:app: nginxtemplate:metadata:labels:app: nginxtier: backend...
metadata Alanı
name ve labels deployment hakkında bilgi verir. Açıklaması şöyle
So, the first metadata describes the deployment itself. It gives a label for that actual deployment. So, if you want to delete that deployment, you would say kubectl delete -l app=nginx,tier=backend.
selector Alanı
selector altındaki matcLabels hangi podların seçileceğini belirtir. Açıklaması şöyle
... the second selector, is actually a selector for the deployment to apply to the pod that the deployment is describing.
- template ise çalıştırılacak pod'un özelliklerini belirtir. Açıklaması şöyle
The template is actually a podTemplate. It describes a pod that is launched. One of the fields for the pod templates is replicas. If we set replicas to 2, it would make 2 pods for that deployment, and the deployment would entail both of those pods. So, that template for the pod has a label. So, this isn’t a label for the deployment anymore, it’s a label for the pod that the deployment is deploying. That’s a subtle, but important distinction.
Hiç yorum yok:
Yorum Gönder