AccessDenied when create ebs-csi-driver

2

Hi I'm having a problem when I install ebs-csi-driver for AWS EKS I used the account with administratoraccess to install via AWS console but had an error "namespaces "kube-system" is forbidden: User "eks:addon-manager" cannot patch resource "namespaces" in API group "" in the namespace "kube-system"" I don't know why the administrator permission can not install add-on. I also tried to create IAM role following Linkhttps://docs.aws.amazon.com/eks/latest/userguide/csi-iam-role.html but received error : Error from server (NotFound): serviceaccounts "ebs-csi-controller-sa" not found

I just started with EKS so don't know how to resolve, Anyone can help?

Thank you

Cuong
질문됨 일 년 전2823회 조회
2개 답변
2

Hello,

Kindly note that the error below can happen because an important ClusterRoleBinding does not exist:

"eks:addon-manager" cannot patch resource "namespaces" in API group "" in the namespace "kube-system""

Execute the following command and check if you are able to see the 2 ClusterRoleBinding in your EKS Cluster :

kubectl get clusterrolebinding -o wide | grep addon

eks:addon-cluster-admin                                ClusterRole/cluster-admin                                          3d21h   eks:addon-manager                                                                  
eks:addon-manager                                      ClusterRole/eks:addon-manager                                      3d21h   eks:addon-manager 

If the eks:addon-cluster-admin is missing, you can use the following yaml to create it:

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: eks:addon-cluster-admin
subjects:
- kind: User
  name: eks:addon-manager
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: ClusterRole
  name: cluster-admin
  apiGroup: rbac.authorization.k8s.io
---

Therefore, you can apply this yaml file to your EKS Cluster:

kubectl apply -f eks-addon-cluster-admin.yaml

The eks:addon-cluster-admin ClusterRoleBinding binds the cluster-admin ClusterRole to the eks:addon-manager Kubernetes identity. The role has the necessary permissions for the eks:addon-manager identity to create Kubernetes namespaces and install add-ons into namespaces. If the eks:addon-cluster-admin ClusterRoleBinding is removed, the Amazon EKS cluster continues to function, however Amazon EKS is no longer able to manage any add-ons.[1]

[1] - https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html

AWS
답변함 일 년 전
  • Exact solution that fixed my cluster, thank you so much

  • yes, I miss eks:addon-cluster-admin. Thank you

0

How you create EKS cluster? Via Console?

profile picture
답변함 일 년 전
  • no, from CLI, is it different?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠