解决请看下面我的答案。
因此,我尝试使用AAD Pod Identity将KeyVault与现有的AKS集群集成。
我一直在密切关注documentation for integrating it into the cluster,但由于某些原因,当我试图从包含aadboundidentity的pod访问密钥库时,却得到了403。
我的集群有RBAC,所以我使用了来自AAD Pod Github for RBAC的yaml。
下面是我的aadpodidentity.yml的样子:
apiVersion: "aadpodidentity.k8s.io/v1"
kind: AzureIdentity
metadata:
name: aks-kv-identity
spec:
type: 0
ResourceID: <full-resource-id-of-managed-id>
ClientID: <client-id-of-aks-cluster-sp>我的aadpodidentitybinding.yaml看起来像这样:
apiVersion: "aadpodidentity.k8s.io/v1"
kind: AzureIdentityBinding
metadata:
name: azure-identity-binding
spec:
AzureIdentity: aks-kv-identity
Selector: kv_selector我想要绑定的pod的yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: data-access
labels:
app: data-access
spec:
replicas: 1
selector:
matchLabels:
app: data-access
template:
metadata:
labels:
app: data-access
aadpodidbinding: kv_selector
spec:
containers:
- name: data-access
image: data-access:2020.02.22.0121
ports:
- containerPort: 80我的AKS SP还具有分配给密钥库的'Reader‘角色
发布于 2020-02-29 02:32:21
我能够解决我的问题。
我是这样解决这个问题的:
当我需要使用托管Identity.
中的托管身份
This article实际上非常有帮助。我只是遵循了这里的步骤,它工作得很完美。
注意:我在拥有AKS集群的资源组中添加了我的托管身份,而不是AKS集群的资源的资源组(即以MC_开头的资源组)。
https://stackoverflow.com/questions/60438659
复制相似问题