These are recommended labels:
app.kubernetes.io/name
app.kubernetes.io/instance
app.kubernetes.io/version
app.kubernetes.io/component
app.kubernetes.io/part-of
app.kubernetes.io/managed-by
I don't quite figure out what's app.kubernetes.io/instance
for.
Could you provide any helping examples?
A generic application name
can have multiple instance
s.
Say if an application used nginx
to serve different types of content, so each type of nginx can be scaled independantly:
app.kubernetes.io/name: nginx
app.kubernetes.io/instance: static-01
app.kubernetes.io/instance: img-02
app.kubernetes.io/instance: dynamic-05
They are only recommendations though so you can use them how you want. In small scale clusters you might not have a need to make name
and instance
different.
See Applications And Instances Of Applications
An application can be installed one or more times into a Kubernetes cluster and, in some cases, the same namespace. For example, wordpress can be installed more than once where different websites are different installations of wordpress.
The name of an application and the instance name are recorded separately. For example, WordPress has a
app.kubernetes.io/name
ofwordpress
while it has an instance name, represented asapp.kubernetes.io/instance
with a value ofwordpress-abcxzy
. This enables the application and instance of the application to be identifiable. Every instance of an application must have a unique name.