#######以下命令在eks master上执行###########
kubectl describe configmap -n kube-system aws-auth ###查看当前eks授权情况
kubectl edit -n kube-system configmap/aws-auth ###编辑授权表,添加权限
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
data:
mapRoles: |
- groups:
- system:masters
rolearn: arn:aws:iam::<your aws account>:role/max_group_role
username: system:node:{{EC2PrivateDNSName}}
######以下命令在maxgroup上执行##########
aws eks --region <region-code> update-kubeconfig --name <cluster_name> --kubeconfig /data/spotmax/k8sconfig