Zha*_* Yi 8 amazon-web-services amazon-eks
我在 AWS 中创建 EKS 集群并使用此命令创建服务帐户eksctl create iamserviceaccount --name alb-ingress-controller --cluster $componentName --attach-policy-arn $serviceRoleArn --approve --override-existing-serviceaccounts。\n该命令的输出为:
[\xe2\x84\xb9] using region ap-southeast-2\n[\xe2\x84\xb9] 1 existing iamserviceaccount(s) (default/alb-ingress-controller) will be excluded\n[\xe2\x84\xb9] 1 iamserviceaccount (default/alb-ingress-controller) was excluded (based on the include/exclude rules)\n[!] metadata of serviceaccounts that exist in Kubernetes will be updated, as --override-existing-serviceaccounts was set\n[\xe2\x84\xb9] no tasks\nRun Code Online (Sandbox Code Playgroud)\n我不确定是否创建成功。
\n我使用此命令eksctl get iamserviceaccount来验证结果,但收到错误响应:
Error: getting iamserviceaccounts: no output "Role1" in stack "eksctl-monitor-addon-iamserviceaccount-default-alb-ingress-controller"
我也尝试运行kubectl get serviceaccount,但出现错误:Error from server (NotFound): serviceaccounts "alb-ingress-controller" not found。
这是否意味着服务帐户创建失败?在 AWS 控制台中哪里可以查看服务账户?或者在哪里可以查看错误?
\n根据错误,这意味着serviceaccount已经存在。
\n要获取服务帐户,请使用kubectl
\nkubectl get serviceaccount <SERVICE_ACCOUNT_NAME> -n kube-system -o yaml\nRun Code Online (Sandbox Code Playgroud)\n顺序是,创建 IAM 角色,然后创建 \xe2\x80\x93 RBAC 角色和绑定。\n如果您想要覆盖现有服务帐户,请使用以下命令
\neksctl --profile <PROFILE_NAME> \\\n --region=ap-northeast-2 \\\n create iamserviceaccount \\\n --name alb-ingress-controller \\\n --namespace kube-system \\\n --override-existing-serviceaccounts \\\n --approve --cluster <CLUSTER_NAME> \\\n --attach-policy-arn \\\n arn:aws:iam::ACCOUNT_ID:policy/ALBIngressControllerIAMPolicy\nRun Code Online (Sandbox Code Playgroud)\n我发现这个研讨会Amazon EKS Workshop在我进入 EKS 的过程中非常有帮助。
\n\n编辑
\n从这个错误
\n\n\n[\xe2\x84\xb9] 将排除 1 个现有 iamserviceaccount(default/alb-ingress-controller)
\n
服务帐户似乎是在默认命名空间内创建的。
\n所以检查服务帐户的命令将是
\nkubectl get serviceaccount <SERVICE_ACCOUNT_NAME> -n default-o yaml\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
9007 次 |
| 最近记录: |