eks

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: Apache-2.0 Imports: 58 Imported by: 1

Documentation

Overview

Package eks implements EKS cluster operations.

Index

Constants

View Source
const (
	ClusterStatusCREATING          = "CREATING"
	ClusterStatusACTIVE            = "ACTIVE"
	ClusterStatusUPDATING          = "UPDATING"
	ClusterStatusDELETING          = "DELETING"
	ClusterStatusFAILED            = "FAILED"
	ClusterStatusDELETEDORNOTEXIST = "DELETED/NOT-EXIST"
)

https://docs.aws.amazon.com/eks/latest/APIReference/API_Cluster.html#AmazonEKS-Type-Cluster-status

CREATING
ACTIVE
UPDATING
DELETING
FAILED
View Source
const (
	ManagedNodeGroupStatusCREATING          = "CREATING"
	ManagedNodeGroupStatusACTIVE            = "ACTIVE"
	ManagedNodeGroupStatusUPDATING          = "UPDATING"
	ManagedNodeGroupStatusDELETING          = "DELETING"
	ManagedNodeGroupStatusCREATEFAILED      = "CREATE_FAILED"
	ManagedNodeGroupStatusUPDATEFAILED      = "UPDATE_FAILED"
	ManagedNodeGroupStatusDELETEFAILED      = "DELETE_FAILED"
	ManagedNodeGroupStatusDEGRADED          = "DEGRADED"
	ManagedNodeGroupStatusDELETEDORNOTEXIST = "DELETED/NOT-EXIST"
)

https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html

CREATING
ACTIVE
DELETING
FAILED
UPDATING
View Source
const TemplateCluster = `` /* 1152-byte string literal not displayed */

TemplateCluster is the CloudFormation template for EKS cluster.

View Source
const TemplateClusterRole = `` /* 1076-byte string literal not displayed */

TemplateClusterRole is the CloudFormation template for EKS cluster role.

View Source
const TemplateManagedNodeGroup = `` /* 2414-byte string literal not displayed */

TemplateManagedNodeGroup is the CloudFormation template for EKS managed node group. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html

View Source
const TemplateManagedNodeGroupRole = `` /* 1256-byte string literal not displayed */

TemplateManagedNodeGroupRole is the CloudFormation template for EKS managed node group role. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html

View Source
const TemplateVPC = `` /* 5892-byte string literal not displayed */

TemplateVPC is the CloudFormation template for EKS VPC.

Variables

This section is empty.

Functions

func ClusterDeleted added in v0.5.0

func ClusterDeleted(err error) bool

ClusterDeleted returns true if error from EKS API indicates that the EKS cluster has already been deleted.

func ManangedNodeGroupDelete added in v0.5.0

func ManangedNodeGroupDelete(err error) bool

ManangedNodeGroupDelete returns true if error from EKS API indicates that the EKS managed node group has already been deleted.

func PollEKS added in v0.5.0

func PollEKS(
	ctx context.Context,
	stopc chan struct{},
	lg *zap.Logger,
	eksAPI eksiface.EKSAPI,
	clusterName string,
	desiredClusterStatus string,
	initialWait time.Duration,
	wait time.Duration,
) <-chan ClusterStatus

PollEKS periodically fetches the cluster status until the cluster becomes the desired state.

func PollEKSManagedNodeGroup added in v0.5.0

func PollEKSManagedNodeGroup(
	ctx context.Context,
	stopc chan struct{},
	lg *zap.Logger,
	eksAPI eksiface.EKSAPI,
	clusterName string,
	nodeGroupName string,
	desiredNodeGroupStatus string,
	initialWait time.Duration,
	wait time.Duration,
) <-chan ManagedNodeGroupStatus

PollEKSManagedNodeGroup periodically fetches the managed node group status until the node group becomes the desired state.

Types

type ClusterStatus added in v0.5.0

type ClusterStatus struct {
	Cluster *awseks.Cluster
	Error   error
}

ClusterStatus represents the CloudFormation status.

type ManagedNodeGroupStatus added in v0.5.0

type ManagedNodeGroupStatus struct {
	NodeGroup *awseks.Nodegroup
	Error     error
}

ManagedNodeGroupStatus represents the CloudFormation status.

type Tester added in v0.5.0

type Tester struct {
	// contains filtered or unexported fields
}

Tester implements "kubetest2" Deployer. ref. https://github.com/kubernetes/test-infra/blob/master/kubetest2/pkg/types/types.go

func New added in v0.5.0

func New(cfg *eksconfig.Config) (*Tester, error)

New creates a new EKS tester.

func (*Tester) Build added in v0.5.0

func (ts *Tester) Build() error

Build should build kubernetes and package it in whatever format the deployer consumes

func (*Tester) Down added in v0.5.0

func (ts *Tester) Down() error

Down cancels the cluster creation and destroy the test cluster if any.

func (*Tester) DownloadClusterLogs added in v0.5.0

func (ts *Tester) DownloadClusterLogs(artifactDir, _ string) error

DownloadClusterLogs dumps all logs to artifact directory. Let default kubetest log dumper handle all artifact uploads. See https://github.com/kubernetes/test-infra/pull/9811/files#r225776067.

func (*Tester) DumpClusterLogs added in v0.5.0

func (ts *Tester) DumpClusterLogs() error

DumpClusterLogs should export logs from the cluster. It may be called multiple times. Options for this should come from New(...)

func (*Tester) FetchLogsManagedNodeGroup added in v0.5.0

func (ts *Tester) FetchLogsManagedNodeGroup() (err error)

FetchLogsManagedNodeGroup downloads logs from managed node group instances.

func (*Tester) IsUp added in v0.5.0

func (ts *Tester) IsUp() (up bool, err error)

IsUp should return true if a test cluster is successfully provisioned

func (*Tester) Kubeconfig added in v0.5.0

func (ts *Tester) Kubeconfig() (string, error)

Kubeconfig returns a path to a kubeconfig file for the cluster.

func (*Tester) KubectlCommand added in v0.5.0

func (ts *Tester) KubectlCommand() (*osexec.Cmd, error)

KubectlCommand returns "kubectl" command object for API reachability tests.

func (*Tester) KubernetesClientSet added in v0.5.0

func (ts *Tester) KubernetesClientSet() *kubernetes.Clientset

KubernetesClientSet returns Kubernetes Go client.

func (*Tester) LoadConfig added in v0.5.0

func (ts *Tester) LoadConfig() (eksconfig.Config, error)

LoadConfig reloads configuration from disk to read the latest cluster configuration and its states. It's either reloaded from disk or returned from embedded EKS deployer.

func (*Tester) Provider added in v0.5.0

func (ts *Tester) Provider() string

Provider returns the kubernetes provider for legacy deployers.

func (*Tester) Up added in v0.5.0

func (ts *Tester) Up() (err error)

Up should provision a new cluster for testing

Directories

Path Synopsis
Package alb implements ALB plugin that installs 2048.
Package alb implements ALB plugin that installs 2048.
Package jobs creates example Job objects in Kubernetes.
Package jobs creates example Job objects in Kubernetes.
Package nlb implements NLB plugin.
Package nlb implements NLB plugin.

Jump to

Keyboard shortcuts

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