Documentation
¶
Index ¶
- func CollectJumpboxLogs(ctx context.Context, config JumpboxLogCollection) error
- func JumpboxInstance(ctx context.Context, client *ec2.Client, clusterName string) (*types.Instance, error)
- func KeyPair(ctx context.Context, client *ec2.Client, clusterName string) (*types.KeyPairInfo, error)
- type HybridCluster
- type Infrastructure
- type ItBlockCloser
- type JumpboxLogCollection
- type K8s
- type Network
- type Node
- type NodeCleanup
- type NodeCreate
- type NodeInfrastructureCleaner
- type NodeSpec
- type PeeredInstance
- type SerialOutputBlock
- type SerialOutputConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectJumpboxLogs ¶ added in v1.0.9
func CollectJumpboxLogs(ctx context.Context, config JumpboxLogCollection) error
CollectJumpboxLogs collects logs from the jumpbox instance and uploads them to S3
Types ¶
type HybridCluster ¶
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.
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 JumpboxLogCollection ¶ added in v1.0.9
type JumpboxLogCollection struct {
JumpboxInstanceID string
LogsBucket string
ClusterName string
S3Client *s3.Client
SSMClient *ssm.Client
Logger logr.Logger
}
JumpboxLogCollection holds the configuration for jumpbox log collection
type K8s ¶ added in v1.0.5
func (K8s) Resource ¶ added in v1.0.5
func (k K8s) Resource(resource schema.GroupVersionResource) dynamic.NamespaceableResourceInterface
type Network ¶ added in v1.0.5
func (*Network) CreateRoutesForNode ¶ added in v1.0.5
func (n *Network) CreateRoutesForNode(ctx context.Context, peeredInstance *PeeredInstance) error
CreateRoutesForNode creates routes in the VPC route table for the node's pod CIDRs.
type Node ¶
type Node struct {
NodeCreate
NodeCleanup
}
Node represents is a Hybrid node running as an EC2 instance in a peered VPC.
type NodeCleanup ¶ added in v1.0.3
type NodeCleanup struct {
SSM *ssm.Client
S3 *s3sdk.Client
EC2 *ec2sdk.Client
K8s clientgo.Interface
Logger logr.Logger
LogCollector os.NodeLogCollector
LogsBucket string
Cluster *HybridCluster
SkipDelete bool
InstanceId string
}
func (*NodeCleanup) Cleanup ¶ added in v1.0.3
func (c *NodeCleanup) Cleanup(ctx context.Context, peeredInstance PeeredInstance) error
Cleanup collects logs and deletes the EC2 instance and Node object.
func (*NodeCleanup) CleanupSSMActivation ¶ added in v1.0.4
func (c *NodeCleanup) CleanupSSMActivation(ctx context.Context, nodeName, clusterName string) error
func (*NodeCleanup) NodeInfrastructureCleaner ¶ added in v1.0.5
func (c *NodeCleanup) NodeInfrastructureCleaner(peeredInstance PeeredInstance) *NodeInfrastructureCleaner
type NodeCreate ¶ added in v1.0.3
type NodeCreate struct {
AWS aws.Config
Cluster *HybridCluster
EC2 *ec2sdk.Client
SSM *ssm.Client
K8sClientConfig *rest.Config
Logger logr.Logger
RemoteCommandRunner commands.RemoteCommandRunner
SetRootPassword bool
NodeadmURLs e2e.NodeadmURLs
PublicKey string
}
func (NodeCreate) Create ¶ added in v1.0.3
func (c NodeCreate) Create(ctx context.Context, spec *NodeSpec) (PeeredInstance, 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 NodeInfrastructureCleaner ¶ added in v1.0.5
type NodeSpec ¶
type NodeSpec struct {
EKSEndpoint string
InstanceName string
InstanceSize e2e.InstanceSize
InstanceType string
InstanceProfileARN string
NodeK8sVersion string
NodeName string
ComputeType e2e.ComputeType
OS e2e.NodeadmOS
Provider e2e.NodeadmCredentialsProvider
}
NodeSpec configures the Hybrid Node.
type PeeredInstance ¶ added in v1.0.9
PeeredInstance represents a Hybrid node running as an EC2 instance in a peered VPC The Name is the name of the Kubernetes node object The Instance is the underlying EC2 instance
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 {
By func(description string, callback ...func())
PeeredNode *Node
Instance PeeredInstance
TestLogger e2e.PausableLogger
OutputFile string
Output io.Writer // Writer to output serial console to, defaults to os.Stdout if nil
}