如何在Serviceaccount创建的秘密上设置标签?

发布于 2025-02-01 08:49:06 字数 316 浏览 1 评论 0原文

有什么方法可以将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

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小鸟爱天空丶 2025-02-08 08:49:06

请使用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.

眼泪淡了忧伤 2025-02-08 08:49:06

使用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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文