From the course: Automating Kubernetes with GitOps

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Labels and annotations

Labels and annotations

- Also a pretty important component of Kubernetes and GitOps is labels and annotations. So labels as well as annotations are key value pairs that are set on Kubernetes resources. Labels are used by Kubernetes to connect resources, and labels are essential in connecting resources like deployments to Pods and like services to Pods. Annotations are used by Kubernetes to add an additional description. Annotations have no specific meaning to Kubernetes, but can be used by external utilities. And while labels are managed by Kubernetes, annotations can be very useful in a GitOps environment to store GitOps related information. So how do we use them? Well, annotations can be used in a couple of cases to allow the GitOps pipelines to leave identifying information when changes have been applied, to add specific build information like image hashes, Git repository SHA, and more. As pointers to identify related objects, to leave contact details, or to provide short usage information. To list…

Contents