5.8. 为 Azure 查询用户定义的标签
创建 OpenShift Container Platform 集群后,您可以访问 Azure 资源定义的标签列表。OpenShift Container Platform 标签的格式为 kubernetes.io_cluster.<cluster_id>:owned
。cluster_id
参数是 config.openshift.io/Infrastructure
中存在 .status.infrastructureName
的值。
运行以下命令,查询为 Azure 资源定义的标签:
$ oc get infrastructures.config.openshift.io cluster -o=jsonpath-as-json='{.status.platformStatus.azure.resourceTags}'
输出示例
[ [ { "key": "createdBy", "value": "user" }, { "key": "environment", "value": "dev" } ] ]