app.kubernetes.io/name label in Kubernetes resource manifests?The app.kubernetes.io/name label is used to uniquely identify the application name. This helps group and select resources that belong to the same app.
pod1: app.kubernetes.io/name=frontend, app.kubernetes.io/version=1.0
pod2: app.kubernetes.io/name=backend, app.kubernetes.io/version=1.0
pod3: app.kubernetes.io/name=frontend, app.kubernetes.io/version=2.0
What is the output of the command
kubectl get pods -l app.kubernetes.io/name=frontend?The selector app.kubernetes.io/name=frontend matches both pod1 and pod3 because they share that label, regardless of version.
myapp version v2 owned by team devops?The label app.kubernetes.io/part-of is used to indicate the higher-level group or team the app belongs to. managed-by, created-by, and owner are not standard recommended labels.
kubectl get pods -l app.kubernetes.io/part-of=frontend but no pods are returned. You know pods exist with label app.kubernetes.io/part-of: frontend. What is the most likely cause?By default, kubectl get pods -l searches only the current namespace. If pods with the label exist in another namespace, they won't be listed unless you specify --all-namespaces or switch namespaces.
The app.kubernetes.io/instance label is used to uniquely identify a deployment or release instance of an application, useful when multiple instances of the same app/version run.