As per below image, we are running multiple microservices with multiple replicas and multiple releases with Pod labels. Each Pod is labeled with two labels
- app, it specifies Pod belongs to which app, component, or service
- release, it specifies Pod running under stable, beta or a canary release
Labels
Label is a key-value pair which is attached to pods, deployments, etc.
- It acts an identifier on K8 object (Ex: Pod or Deployment). So, the other Kubernetes objects (Ex: Service, DaemonSet) can communicate by matching same label names.
- It can be attached to Kubernetes objects at creation time or directly on live objects by using Imperative way
- Same label key/value can be assigned to multiple Kubernetes objects
- Each object in the label can have set of key/value and each key must be unique for a given object
- Label key should not exceed 63 characters and allowed characters are alphanumeric, dash(-), underscore(_), dot(.)
- Label value should not exceed 63 characters and allowed characters are alphanumeric, dash(-), underscore(_), dot(.)
- Kubernetes for Developers #25: PersistentVolume and PersistentVolumeClaim in-detail
- Kubernetes for Developers #24: Kubernetes Volume hostPath in-detail
- Kubernetes for Developers #23: Kubernetes Volume emptyDir in-detail
- Kubernetes for Developers #22: Access to Multiple Clusters or Namespaces using kubectl and kubeconfig
- Kubernetes for Developers #21: Kubernetes Namespace in-detail
- Kubernetes for Developers #20: Create Automated Tasks using Jobs and CronJobs
- Kubernetes for Developers #19: Manage app credentials using Kubernetes Secrets
- Kubernetes for Developers #18: Manage app settings using Kubernetes ConfigMap
- Kubernetes for Developers #17: Expose service using Kubernetes Ingress
- Kubernetes for Developers #16: Kubernetes Service Types - ClusterIP, NodePort, LoadBalancer and ExternalName
- Kubernetes for Developers #15: Kubernetes Service YAML manifest in-detail
- Kubernetes for Developers #14: Kubernetes Deployment YAML manifest in-detail
- Kubernetes for Developers #13: Effective way of using K8 Readiness Probe
- Kubernetes for Developers #12: Effective way of using K8 Liveness Probe
- Kubernetes for Developers #11: Pod Organization using Labels
- Kubernetes for Developers #10: Kubernetes Pod YAML manifest in-detail
- Kubernetes for Developers #9: Kubernetes Pod Lifecycle
- Kubernetes for Developers #8: Kubernetes Object Name, Labels, Selectors and Namespace
- Kubernetes for Developers #7: Imperative vs. Declarative Kubernetes Objects
- Kubernetes for Developers #6: Kubernetes Objects
- Kubernetes for Developers #5: Kubernetes Web UI Dashboard
- Kubernetes for Developers #4: Enable kubectl bash autocompletion
- Kubernetes for Developers #3: kubectl CLI
- Kubernetes for Developers #2: Kubernetes for Local Development
- Kubernetes for Developers #1: Kubernetes Architecture and Features