<p>I'm trying to use io.fabric8.kubernetes.client.KubernetesClient to connect to my AWS EKS cluster but I'm having no luck as follows:</p>

<pre><code>  Cluster cluster =
      EKSClient.describeCluster(DescribeClusterRequest.builder().name(clusterName).build())
          .cluster();

  final io.fabric8.kubernetes.client.Config kubeConfig =
      new ConfigBuilder()
          .withMasterUrl(cluster.endpoint())
          .withTrustCerts(true)
          .withRequestTimeout(10_000)
          .build();

  kubernetesClient = new DefaultKubernetesClient(kubeConfig);
</code></pre>

<p>The connection just times out so I'm sure I'm missing something. I can reach the AWS cluster with all the AWS SDK tools but those don't provide everything I need.</p>

<p>Any ideas/suggestions?</p>

javydreamercsw
<p>Found this question when also was looking for ways to connect to EKS. Will post my solution in case someone finds it useful.<br>
In my case I first obtain the token with encoded IAM role via <strong>aws eks get-token --cluster-name=my-cluster</strong> command and then use it in the ConfigBuilder:  </p>

<pre><code>new DefaultKubernetesClient(
           new ConfigBuilder().withMasterUrl(clusterEndPoint)
                      .withOauthToken(retrievedToken).withTrustCerts(true).build());
</code></pre>
