eks

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cluster *types.Cluster, tok token.Token) (*kubernetes.Clientset, error)

New client to generate

Types

type AwsConfig

type AwsConfig struct {
	J     janitorconfig.EnvConfig
	Token string
}

func (*AwsConfig) Init

func (a *AwsConfig) Init(cfg aws.Config, g Generator) EKSCluster

type EKSCluster

type EKSCluster struct {
	Name     string
	Endpoint string
	Token    string
	CAFile   string
}

aws specific EKS logic.

type Generator

type Generator interface {
	DescribeCluster(*eks.Client, string) (*eks.DescribeClusterOutput, error)
	GenToken(*string) (token.Token, error)
	TestCluster(*types.Cluster, token.Token) error
	WriteCA(AwsConfig, *eks.DescribeClusterOutput) string
}

Generator interface which describes the k8s master API server we connect to

type GeneratorType

type GeneratorType struct {
	Context context.Context
}

GeneratorType is used

func (*GeneratorType) DescribeCluster

func (g *GeneratorType) DescribeCluster(e *eks.Client, cluster string) (*eks.DescribeClusterOutput, error)

DescribeCluster calls the AWS SDK EKS API to get details on the cluster

func (*GeneratorType) GenToken

func (g *GeneratorType) GenToken(cluster *string) (token.Token, error)

GenToken will get the EKS cluster oauth2 token. Consider refresh flow instead and make token private and accessible via function call.

func (*GeneratorType) TestCluster

func (g *GeneratorType) TestCluster(r *types.Cluster, tok token.Token) error

TestCluster is a tough function to test as it makes a call to Nodes().

func (*GeneratorType) WriteCA

WriteCA - need to pass in another interface if i wanna mock this.

Jump to

Keyboard shortcuts

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