Azure Key Vault 볼륨에 액세스할 수 없습니다. 이 문제를 해결하는 방법은 무엇입니까?

Azure Key Vault 볼륨에 액세스할 수 없습니다. 이 문제를 해결하는 방법은 무엇입니까?

나는 이것에 제공된 연습을 따랐습니다.링크

그리고 6단계에서는 KeyVault에 연결된 볼륨으로 포드를 생성해 보았습니다.

하지만 볼륨에 액세스할 수 없습니다.

kubectl get pods
NAME                                         READY   STATUS              RESTARTS   AGE
busybox-secrets-store-inline                 0/1     ContainerCreating   0          27s
csi-csi-secrets-store-provider-azure-2fwqd   1/1     Running             0          45m
csi-secrets-store-csi-driver-d6zjv           3/3     Running             0          45m


 kubectl describe pod busybox-secrets-store-inline
Name:         busybox-secrets-store-inline
Namespace:    default
Priority:     0
Node:         aks-agentpool-22716505-vmss000001/10.240.0.5
Start Time:   Mon, 26 Jul 2021 21:45:02 +0530
Labels:       <none>
Annotations:  <none>
Status:       Pending
IP:
IPs:          <none>
Containers:
  busybox:
    Container ID:
    Image:         k8s.gcr.io/e2e-test-images/busybox:1.29
    Image ID:
    Port:          <none>
    Host Port:     <none>
    Command:
      /bin/sleep
      10000
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /mnt/secrets-store from secrets-store-inline (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-g7shm (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  secrets-store-inline:
    Type:              CSI (a Container Storage Interface (CSI) volume source)
    Driver:            secrets-store.csi.k8s.io
    FSType:
    ReadOnly:          true
    VolumeAttributes:      secretProviderClass=azure-kvname
  default-token-g7shm:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-g7shm
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason       Age    From               Message
  ----     ------       ----   ----               -------
  Normal   Scheduled    3m50s  default-scheduler  Successfully assigned default/busybox-secrets-store-inline to aks-agentpool-22716505-vmss000001
  Warning  FailedMount  110s   kubelet            MountVolume.SetUp failed for volume "secrets-store-inline" : rpc error: code = DeadlineExceeded desc = context deadline exceeded
  Warning  FailedMount  107s   kubelet            Unable to attach or mount volumes: unmounted volumes=[secrets-store-inline], unattached volumes=[secrets-store-inline default-token-g7shm]: timed out waiting for the condition

이 문제를 해결하는 방법은 무엇입니까?

답변1

이는 일반적으로 권한 문제입니다. 서비스 주체 ID 및 암호를 올바르게 지정했는지 확인하고 액세스 정책을 사용하여 Key Vault에 대한 액세스 권한을 부여했는지 확인하세요. 이는 Azure RBAC 권한과 별개입니다.

관련 정보