awsiamplugin

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2021 License: Apache-2.0

README

AWS IAM Kube Auth Plugin

A library to allow use of aws-iam-authenticator without exec

Usage

package main

import (
    awsConfig "github.com/aws/aws-sdk-go-v2/config"
    awsKubeConfig "github.com/bluestealth/awsiamplugin/pkg/config"
    "k8s.io/client-go/kubernetes"
)

func main() {
    ctx := context.Background()
    var client *kubernetes.Clientset
    session, err := awsConfig.LoadDefaultConfig(ctx)
    if err != nil {
        panic(err)
    }
    config, err := awsKubeConfig.EKSClusterConfig(ctx, session, awsKubeConfig.AwsIamOptions{
        Region:               "us-east-2",
        ClusterID:            "my-awesome-eks-cluster",
        ForwardSessionName:   true,
    })
    client, err = kubernetes.NewForConfig(config)
    if err != nil {
        panic(err)
    }
    ...

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL