Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

K8s: app.kubernetes.io instance label purpose

Tags:

kubernetes

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 app.kubernetes.io/instance is for.

Could you provide any useful examples?

like image 504
Jordi Avatar asked Mar 13 '26 21:03

Jordi


1 Answers

A generic application name can have multiple instances.

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 of wordpress while it has an instance name, represented as app.kubernetes.io/instance with a value of wordpress-abcxzy. This enables the application and instance of the application to be identifiable. Every instance of an application must have a unique name.

like image 118
Matt Avatar answered Mar 16 '26 10:03

Matt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!