[英]use Kubernetes service account from different namespace
I have created a service account SA1 in namespace NS1 and set a full configuration for SA1 (workload identity in GCP).我在命名空间 NS1 中创建了一个服务帐户 SA1,并为 SA1(GCP 中的工作负载标识)设置了完整配置。 I need to use the service account SA1 in pods from different namespaces.
我需要在来自不同命名空间的 pod 中使用服务帐户 SA1。 for now I have the pods in namespace NS1 using the SA1
现在我在命名空间 NS1 中使用 SA1
apiVersion: v1
kind: Pod
metadata:
name: my-pod
namespace: NS1
spec:
serviceAccountName: SA1
ServiceAccount is a namespaced resource in Kubernetes, meaning that it can only be referenced from pods deployed in the same namespace. ServiceAccount 是 Kubernetes 中的命名空间资源,这意味着它只能从部署在同一命名空间中的 pod 中引用。
This is by design, Namespaces act as logical containers on which you apply access policies and a pod in one namespace should not be able to "steal" the serviceaccount from another (possibly unrelated) namespace这是设计使然,命名空间充当您应用访问策略的逻辑容器,并且一个命名空间中的 pod 不应能够从另一个(可能不相关的)命名空间“窃取”服务帐户
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.