<p>I've been looking for documentation for a long time and still couldn't find any clear connection procedure.
I came up with this code sample :</p>
<pre><code>package aws

import (
    &quot;fmt&quot;
    &quot;net/http&quot;

    &quot;github.com/aws/aws-sdk-go/aws/session&quot;
    &quot;github.com/aws/aws-sdk-go/service/eks&quot;
    &quot;github.com/joho/godotenv&quot;
)
func Connect() {
    godotenv.Load(&quot;.env&quot;)
    session := session.Must(session.NewSession())
    svc := eks.New(session)
    clusters, err := svc.ListClusters(&amp;eks.ListClustersInput{})
    if err != nil {
        fmt.Println(err.Error())
    }
    fmt.Println(clusters)
}
</code></pre>
<p>i mean, this still returns a 403 forbidden error because of env variable mess, but the code is valid i guess. My question is, having this connection established : how to convert this <code>svc</code> variable into the <code>*kubernetes.Clientset</code> one from the go driver ?</p>

<p>Have you had a look at the <a href="https://github.com/kubernetes/client-go/blob/master/examples/in-cluster-client-configuration/main.go" rel="nofollow noreferrer">client-go example</a> on how to authenticate in-cluster?</p>
<p>Code that authenticate to the Kubernetes API typically start like this:</p>
<pre><code>    // creates the in-cluster config
    config, err := rest.InClusterConfig()
    if err != nil {
        panic(err.Error())
    }
    // creates the clientset
    clientset, err := kubernetes.NewForConfig(config)
    if err != nil {
        panic(err.Error())
    }
</code></pre>
