bastion

package
v1.149.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bastion

type Bastion struct {
	Values *Values

	// exposed for testing
	Clock               clock.PassiveClock
	WaitInterval        time.Duration
	WaitSevereThreshold time.Duration
	WaitTimeout         time.Duration
	SSHDial             func(ctx context.Context, addr string, opts ...sshutils.Option) (*sshutils.Connection, error)

	// Connection is the SSH connection to the Bastion opened by Wait.
	Connection *sshutils.Connection
	// contains filtered or unexported fields
}

Bastion is a component for managing a Bastion (extensions.gardener.cloud) object. It is used for accessing the control plane machines in `gardenadm bootstrap`.

func New

func New(
	log logr.Logger,
	client client.Client,
	secretsManager secretsmanager.Interface,
	values *Values,
) *Bastion

New creates a new Bastion component with the default clock and wait settings.

func (*Bastion) Deploy

func (b *Bastion) Deploy(ctx context.Context) error

Deploy generates an SSH key pair and deploys the Bastion object.

func (*Bastion) Destroy

func (b *Bastion) Destroy(ctx context.Context) error

Destroy deletes all resources related to the Bastion object.

func (*Bastion) Wait

func (b *Bastion) Wait(ctx context.Context) error

Wait waits for the Bastion object to get ready and opens an SSH connection to the bastion host. After a successful Wait call, Connection is ready to be used.

func (*Bastion) WaitCleanup

func (b *Bastion) WaitCleanup(ctx context.Context) error

WaitCleanup waits until the Bastion object has been deleted successfully.

type Values

type Values struct {
	// Name is the Bastion name.
	Name string
	// Namespace is the Bastion namespace (control plane namespace).
	Namespace string
	// Provider is the Bastion provider type.
	Provider string
	// IngressCIDRs restricts ingress to the Bastion.
	// Defaults to ["0.0.0.0/0", "::/0"].
	IngressCIDRs []string
}

Values contains the values used to create a Bastion.

Jump to

Keyboard shortcuts

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