0
votes

Issue

What is the difference between using eksctl and AWS Management Console when creating a kubernetes cluster on aws ?

like what is really happening under the hood ?

in both cases the cluster gets created but only when using eksctl, you can connect to the cluster after it gets created.

Any ideas what is happening here ?

How to Reproduce

I'm following the official tutorials of AWS.

This tutorial doesn't work, the cluster gets created but you cannot connect to it. if you follow it, by the time you get to step 2.3 and try the command, you get an error that you need to be logged in.

Ref1: https://docs.aws.amazon.com/eks/latest/userguide/getting-started-console.html

However, following the guidelines of the adjacent tutorial of AWS which uses the eksctl, everything works fine.

Ref2: https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html

Just follow the steps as they tell you to do, one works the other doesn't :/

How to Test

1- Using AWS Management Console

Command

kubectl get svc

Output

error: You must be logged in to the server (Unauthorized)

2- Using eksctl

Command

kubectl get svc

Output

NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.100.0.1   <none>        443/TCP   6m13s

Expected Output

Expected

Both should allow me to connect to the kubernetes cluster.

Actual

i am only able to connect to the cluster if i create it using eksctl

2

2 Answers

0
votes

Amendment

After digging deeper into eksctl, i found this tutorial:

https://eksctl.io/usage/creating-and-managing-clusters/

There is a section there that states how to create the cluster using a config file.

So, i mapped the values of my IAM Role and my VPC & subnet information to the file and created the cluster and i was able to connect at the end, no questions asked.

I can deduce that my permissions and configuration is correct.

I think that the IAM Role is being mapped somehow to internal components when the eksctl command is used and that this step is missing from the documentation of the AWS Management Console section.

i am not 100% sure about it, but if anyone else has an input, please be kind to share it.

0
votes

ok i solved it. basically my mistake was i had a different IAM user configured under ~/.aws/credentials.