title: Always getting error: You must be logged in to the server (Unauthorized) EKS
body: <p>I am currently playing around with AWS EKS
  But I always get <code>error: You must be logged in to the server (Unauthorized)</code> when trying to run <code>kubectl cluster-info</code> command.</p>
  
  <p>I have read a lot of AWS documentation and look at lots of similar issues who face the same problem. Unfortunately, none of them resolves my problem. </p>
  
  <p>So, this is what I did</p>
  
  <ol>
  <li>install all required packages </li>
  <li>create a user to access <em>aws-cli</em> name <code>crop-portal</code></li>
  <li>create a role for EKS name <code>crop-cluster</code></li>
  <li>create EKS cluster via AWS console with the role <code>crop-cluster</code> name<code>crop-cluster</code>(cluster and role have the same name)</li>
  <li>run AWS configure for user <code>crop-portal</code></li>
  <li>run <code>aws eks update-kubeconfig --name crop-cluster</code> to update the kube config</li>
  <li>run <code>aws sts assume-role --role-arn crop-cluster-arn --role-session-name eks-access</code></li>
  <li>copy <em>accessKey</em>, <em>secreyKey</em> and <em>sessionToken</em> into env variables <em>AWS_ACCESS_KEY_ID</em>, <em>AWS_SECRET_ACCESS_KEY</em> and <em>AWS_SESSION_TOKEN</em> accordingly</li>
  <li>run <code>aws sts get-caller-indentity</code> and now the result says it used assume role already</li>
  </ol>
  
  <pre><code>{
      "UserId": "AROAXWZGX5HOBZPVGAUKC:botocore-session-1572604810",
      "Account": "529972849116",
      "Arn": "arn:aws:sts::529972849116:assumed-role/crop-cluster/botocore-session-1572604810"
  }
  </code></pre>
  
  <ol start="10">
  <li>run <code>kubectl cluster</code> and always <code>get error: You must be logged in to the server (Unauthorized)</code></li>
  </ol>
  
  <p>when I run <code>aws-iam-authenticator token -i crop-cluster</code>, it gave me the token and
  when I run <code>aws-iam-authenticator verify -t token -i crop-portal</code>, it also passed</p>
  
  <p><code>&amp;{ARN:arn:aws:sts::529972849116:assumed-role/crop-cluster/1572605554603576170 CanonicalARN:arn:aws:iam::529972849116:role/crop-cluster AccountID:529972849116 UserID:AROAXWZGX5HOBZPVGAUKC SessionName:1572605554603576170}</code></p>
  
  <p>I don't know what is wrong or what I miss. I try so hard to get it works but I really don't know what to do after this.
  Some people suggest creating a cluster with awscli instead of GUI. I tried both methods and none of them work. Either creating with awscli or GUI is the same for me.</p>
  
  <p>Please someone helps :(</p>