官术网_书友最值得收藏!

Labeling all the things

Labels are key-value pairs that are attached to resources, such as pods. They are intended to contain information that helps you to identify a particular resource.

You might add labels to your pods to identify the application that is being run, as well as other metadata, such as a version number, an environment name, or other labels that pertain to your application.

Labels are very flexible, as Kubernetes leaves it up to you to label your own resources as you see fit.

Once you begin working with Kubernetes, you will discover that you are able to add labels to almost every resource that you create.

The power of being able to add labels that reflect the architecture of your own application is that you are able to use selectors to query the resources using any combination of the labels that you have given your resources. This setup is shown in the following diagram:

You can add labels to many of the resources that you will create in Kubernetes and then query them with selectors.

Kubernetes doesn't enforce any particular schema or layout for the labels you give to objects in your cluster; and you are free to label your applications however you choose. If you want a little more structure however. Kubernetes does make some suggestions for labels you might want to apply to objects that can be grouped together into a logical Application. You can read more about this in the Kubernetes documentation: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/.

主站蜘蛛池模板: 汶上县| 万载县| 青川县| 丰县| 景谷| 剑川县| 安阳县| 逊克县| 泸溪县| 正镶白旗| 色达县| 莆田市| 拜城县| 德安县| 昌都县| 辽宁省| 玉门市| 天门市| 澄城县| 新余市| 得荣县| 塘沽区| 浦江县| 普陀区| 海门市| 紫金县| 宜兰县| 扎兰屯市| 威海市| 安乡县| 墨脱县| 乌鲁木齐市| 宁波市| 桓台县| 平舆县| 浠水县| 阿鲁科尔沁旗| 璧山县| 怀来县| 堆龙德庆县| 四会市|