7.10. 为 Data Grid 资源添加标签和注解
将键/值标签和注解附加到 Data Grid Operator 创建和管理的 pod 和服务。标签可帮助您识别对象之间的关系以更好地组织和监控 Data Grid 资源。注解是任意标识客户端应用程序或部署和管理工具的元数据。
注意
红帽订阅标签会自动应用到 Data Grid 资源。
流程
-
打开您的
Infinispan
CR 进行编辑。 在
metadata.annotations
部分为 Data Grid 资源附加标签和注解。-
在
metadata.annotations
部分中直接定义注解的值。 -
使用
metadata.labels
字段为标签定义值。
-
在
-
应用您的
Infinispan
CR。
自定义注解
apiVersion: infinispan.org/v1 kind: Infinispan metadata: annotations: infinispan.org/targetAnnotations: service-annotation1, service-annotation2 infinispan.org/podTargetAnnotations: pod-annotation1, pod-annotation2 service-annotation1: value service-annotation2: value pod-annotation1: value pod-annotation2: value
自定义标签
apiVersion: infinispan.org/v1 kind: Infinispan metadata: annotations: infinispan.org/targetLabels: service-label1, service-label2 infinispan.org/podTargetLabels: pod-label1, pod-label2 labels: service-label1: value service-label2: value pod-label1: value pod-label2: value # The operator does not attach these labels to resources. my-label: my-value environment: development