我最新执行的所有命令如下;
aws eks --region us-west-2 update-kubeconfig --name pageguo# 这个是集群的名字
cat <<EOF >kubesphere-secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: kubesphere
namespace: kubesphere-system
annotations:
kubernetes.io/service-account.name: "kubesphere"
type: kubernetes.io/service-account-token
EOF
#下面是我自己添加的,不然没办法执行文档中后续的步骤
kubectl create namespace kubesphere-system
kubectl -n kubesphere-system create serviceaccount kubesphere
kubectl apply -f kubesphere-secret.yaml
cat <<EOF >kubesphere-cluster-admin-binding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubesphere-cluster-admin-binding
subjects:
- kind: ServiceAccount
name: kubesphere
namespace: kubesphere-system
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
EOF
kubectl apply -f kubesphere-cluster-admin-binding.yaml
#文档中原来的步骤
TOKEN=`kubectl -n kubesphere-system get secret kubesphere -o jsonpath='{.data.token}' | base64 -d`
kubectl config set-credentials kubesphere --token=${TOKEN}
kubectl config set-context --current --user=kubesphere
现在已经可以成功将EKS添加到集群中,但是状态目前是未就绪

我在控制台执行kubectl logs -n kubesphere-system ks-controller-manager-54b969df8d-v9zkk
返回的结果为:
E0314 03:11:28.672659 1 controller.go:329] “Reconciler error” err="failed to reconcile cluster pageguo-ekk: failed to install KS Core in cluster pageguo-ekk: Unable to continue with install: ServiceAccount \“kubesphere\” in namespace \“kubesphere-system\” exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key \“app.kubernetes.io/managed-by\”: must be set to \“Helm\”; annotation validation error: missing key \“meta.helm.sh/release-name\”: must be set to \“ks-core\”; annotation validation error: missing key \“meta.helm.sh/release-namespace\”: must be set to \“kubesphere-system\”" controller=“cluster” controllerGroup=“cluster.kubesphere.io” controllerKind=“Cluster” Cluster=“pageguo-ekk” namespace="" name=“pageguo-ekk” reconcileID=“b5ef77a2-74da-4e60-b9b8-728316e32b59”