peered

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JumpboxInstance added in v1.0.2

func JumpboxInstance(ctx context.Context, client *ec2.Client, clusterName string) (*types.Instance, error)

JumpboxInstance returns the jumpbox ec2 instance for the given cluster.

func KeyPair added in v1.0.2

func KeyPair(ctx context.Context, client *ec2.Client, clusterName string) (*types.KeyPairInfo, error)

KeyPair returns the keypair for the given cluster.

Types

type HybridCluster

type HybridCluster struct {
	Name              string
	Arn               string
	Region            string
	KubernetesVersion string
	SubnetID          string
	SecurityGroupID   string
}

func GetHybridCluster

func GetHybridCluster(ctx context.Context, eksClient *eks.Client, ec2Client *ec2.Client, clusterName string) (*HybridCluster, error)

GetHybridCluster returns the hybrid cluster details.

type Infrastructure

type Infrastructure struct {
	Credentials       credentials.Infrastructure
	JumpboxInstanceId string
	NodesPublicSSHKey string
}

Infrastructure represents the necessary infrastructure for peered VPCs to be used by nodeadm.

func Setup

func Setup(ctx context.Context, logger logr.Logger, config aws.Config, clusterName, endpoint string) (*Infrastructure, error)

Setup creates the necessary infrastructure for credentials providers to be used by nodeadm.

func (*Infrastructure) Teardown

func (p *Infrastructure) Teardown(ctx context.Context) error

type ItBlockCloser added in v1.0.3

type ItBlockCloser interface {
	It(description string, body func())
	Close()
}

func NewSerialOutputBlockBestEffort added in v1.0.3

func NewSerialOutputBlockBestEffort(ctx context.Context, config *SerialOutputConfig) ItBlockCloser

NewSerialOutputBlockBestEffort creates a SerialOutputBlock if the serial console is available, otherwise it returns a no-op implementation.

type Node

type Node struct {
	NodeCreate
	NodeCleanup
}

Node represents is a Hybrid node running as an EC2 instance in a peered VPC.

func (Node) S3LogsURL added in v1.0.3

func (c Node) S3LogsURL(instanceName string) string

type NodeCleanup added in v1.0.3

type NodeCleanup struct {
	S3                  *s3sdk.Client
	EC2                 *ec2sdk.Client
	K8s                 *clientgo.Clientset
	Logger              logr.Logger
	RemoteCommandRunner commands.RemoteCommandRunner

	LogsBucket  string
	ClusterName string
	SkipDelete  bool
}

func (*NodeCleanup) Cleanup added in v1.0.3

func (c *NodeCleanup) Cleanup(ctx context.Context, instance ec2.Instance) error

Cleanup collects logs and deletes the EC2 instance and Node object.

type NodeCreate added in v1.0.3

type NodeCreate struct {
	AWS     aws.Config
	Cluster *HybridCluster
	EC2     *ec2sdk.Client
	SSM     *ssm.Client
	Logger  logr.Logger

	SetRootPassword bool
	NodeadmURLs     e2e.NodeadmURLs
	PublicKey       string
}

func (NodeCreate) Create added in v1.0.3

func (c NodeCreate) Create(ctx context.Context, spec *NodeSpec) (ec2.Instance, error)

Create spins up an EC2 instance with the proper user data to join as a Hybrid node to the cluster.

func (*NodeCreate) SerialConsole added in v1.0.3

func (c *NodeCreate) SerialConsole(ctx context.Context, instanceId string) (*ssh.SerialConsole, error)

SerialConsole returns the serial console for the given instance.

type NodeSpec

type NodeSpec struct {
	InstanceName       string
	InstanceProfileARN string
	NodeK8sVersion     string
	NodeNamePrefix     string
	OS                 e2e.NodeadmOS
	Provider           e2e.NodeadmCredentialsProvider
}

NodeSpec configures the Hybrid Node.

type SerialOutputBlock added in v1.0.3

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

SerialOutputBlock is a helper to run sections of a ginkgo test while outputting the serial console output of an instance. It paused the main test logs while streaming the serial console output, and resumes them once the test "body" is done. The serial console output is also saved to a file until Close is called, no matter if you are running a test block or not. This is very useful to help debugging issues with the node joining the cluster, specially if the process runs as part of the node initialization.

func NewSerialOutputBlock added in v1.0.3

func NewSerialOutputBlock(ctx context.Context, config *SerialOutputConfig) (*SerialOutputBlock, error)

func (*SerialOutputBlock) Close added in v1.0.3

func (b *SerialOutputBlock) Close()

func (*SerialOutputBlock) It added in v1.0.3

func (b *SerialOutputBlock) It(description string, body func())

It runs the test body while streaming the serial console output of the instance to stdout. It pauses the main test logs while streaming the serial console output, and resumes them once the test "body" is done. This actually doesn't create a ginkgo node, it just uses By to print the description and help distinguish this test block in the logs.

type SerialOutputConfig added in v1.0.3

type SerialOutputConfig struct {
	PeeredNode   *Node
	Instance     ec2.Instance
	TestLogger   e2e.PausableLogger
	OutputFolder string
}

Jump to

Keyboard shortcuts

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