Açıklaması şöyle
Annotations can be applied to a variety of Kubernetes resources, and are typically used for resources such as Pods, Services, Deployments, and Ingresses.The users of Kubernetes clusters are free to define and use Annotations, and they are usually customized for specific use cases or management needs.
metadata/annotations altında herhangi bir key: value string'i şeklinde tanımlanır
What are the similarities and differences between Annotations and Labels?
Açıklaması şöyle
Annotations and Labels are both key-value pairs used to attach metadata to Kubernetes objects like pods, services, and deployments. While they serve a similar purpose, there are some differences between annotations and labels.Labels are primarily used for identifying and grouping resources within Kubernetes, while annotations are used to attach arbitrary metadata for external tools and systems to leverage. Labels have semantic meaning and are used by Kubernetes itself, whereas annotations are treated as opaque strings and have no impact on Kubernetes’ internal operations.
Örnek
Şöyle yaparız
apiVersion: v1kind: Podmetadata:name: my-podannotations:key1: value1key2: value2spec:# The spec fields of the pod
Örnek
Şöyle yaparız
apiVersion: v1kind: Pod metadata: name: annotations-demo annotations: imageregistry: "https://hub.docker.com/" spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80
Hiç yorum yok:
Yorum Gönder