如何在Serviceaccount创建的秘密上设置标签?
有什么方法可以将ServiceAccount创建的秘密标签设置为标签?目前,这是我无法使用标签配置的唯一秘密。
apiVersion: v1
kind: ServiceAccount
metadata:
name: forum-sa
Is there any way to set label on secret created by ServiceAccount? For now it is the only secret I'm not able to configure with label.
apiVersion: v1
kind: ServiceAccount
metadata:
name: forum-sa
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请使用kubectl的服务帐户使用以下配置-service-account-tokens-connect-api-server#kube“ rel =“ nofollow noreferrer”>文档 1
kubectl获取秘密-namespace = namespace = {nesmanspace}
通过使用上述kubectl命令,该命令将有助于为秘密设置标签名称空间。
Please use the below configuration using the service account with kubectl,Follow the documentation1
kubectl get secret --namespace={namespace}
By using above kubectl command which will help to set label namespace for secrets.
使用kubectl的服务帐户令牌:
https://www.ibm.com/docs/en/cloud-paks/cp-management/2.0.0.topic = kubectl-usish-service-service-service-account-account-令牌 - 连接 - api-server
我们可以用所需的标签修补秘密标签,也可以在秘密创建期间添加标签
Using the service account token with kubectl:
https://www.ibm.com/docs/en/cloud-paks/cp-management/2.0.0?topic=kubectl-using-service-account-tokens-connect-api-server
We can patch the secrets label with the required labels or we can also add the labels during secrets creation