Differences between revisions 3 and 5 (spanning 2 versions)
Revision 3 as of 2022-02-24 22:17:59
Size: 1068
Editor: PieterSmit
Comment:
Revision 5 as of 2022-03-13 06:51:48
Size: 1569
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
 1. Can you see the cluster (check correct AWS_Profile) {{{  1. You need to know the IAM role/user that created the cluster. (Maybe look in your Terraform)
 1. Can you see the cluster (check correct export AWS_PROFILE=) {{{
Line 13: Line 14:
# or if installed $ eksctl get cluster
Line 14: Line 16:
 1. Make sure current role does not work by retrieveing kubectl config {{{
aws eks update-kubeconfig --region ap-southeast-2 --name "eks-cluster-name"
 1. Make sure current role does not work by retrieving kubectl config {{{
aws eks update-kubeconfig --region ap-southeast-2 --name "eks-cluster-name" --role-arn "arn:aws:iam::123456789:role/myk8srole"
Line 17: Line 19:
error: You must be logged in to the server (Unauthorized)
Line 19: Line 20:
 1. '''''error: You must be logged in to the server (Unauthorized)'''''
   * This error indicates that the role you used, is not in system:management, thus not the one that created the cluster.

 1. AWS doc for '''Unauthorized or access denied (kubectl)'''
    * https://docs.aws.amazon.com/eks/latest/userguide/troubleshooting.html#unauthorized
Line 21: Line 27:
      1. install eksctl https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html       1. install '''eksctl''' AWStool https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html

k8s kubernetes on AWS AWSEKS

Recover admin login

  1. You need to know the IAM role/user that created the cluster. (Maybe look in your Terraform)
  2. Can you see the cluster (check correct export AWS_PROFILE=)

    aws eks list-clusters
    # or if installed $ eksctl get cluster
  3. Make sure current role does not work by retrieving kubectl config

    aws eks update-kubeconfig --region ap-southeast-2 --name "eks-cluster-name" --role-arn "arn:aws:iam::123456789:role/myk8srole"
    kubectl get svc
  4. error: You must be logged in to the server (Unauthorized)

    • This error indicates that the role you used, is not in system:management, thus not the one that created the cluster.
  5. AWS doc for Unauthorized or access denied (kubectl)

  6. Have to assume the original admin account/role

k8s/AwsEks (last edited 2022-03-13 06:51:48 by PieterSmit)