sidecar

package
v11.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLocalAddr  = "localhost:3025"
	DefaultConfigPath = "/etc/teleport/teleport.yaml"
	DefaultDataDir    = "/var/lib/teleport"
	DefaultUser       = "teleport-operator-sidecar"
	DefaultRole       = "teleport-operator-sidecar"
)
View Source
const (
	DefaultCertificateTTL  = 2 * time.Hour
	DefaultRenewalInterval = 30 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

Bot is a wrapper around an embedded tbot. It implements sigs.k8s.io/controller-runtime/manager.Runnable and sigs.k8s.io/controller-runtime/manager.LeaderElectionRunnable so it can be added to a controllerruntime.Manager.

func CreateAndBootstrapBot

func CreateAndBootstrapBot(ctx context.Context, opts Options) (*Bot, *proto.Features, error)

CreateAndBootstrapBot connects to teleport using a local auth connection, creates operator's role in teleport and creates tbot's configuration.

func (*Bot) GetClient

func (b *Bot) GetClient(ctx context.Context) (auth.ClientI, error)

func (*Bot) NeedLeaderElection

func (b *Bot) NeedLeaderElection() bool

func (*Bot) Start

func (b *Bot) Start(ctx context.Context) error

type ClientAccessor

type ClientAccessor func(ctx context.Context) (auth.ClientI, error)

ClientAccessor returns a working teleport auth client when invoked. Client users should always call this function on a regular basis to ensure certs are always valid.

type Options

type Options struct {
	// ConfigPath is a path to the Teleport configuration file e.g. /etc/teleport/teleport.yaml.
	ConfigPath string

	// DataDir is a path to the Teleport data dir e.g. /var/lib/teleport.
	DataDir string

	// Addr is an endpoint of Teleport e.g. 127.0.0.1:3025.
	Addr string

	// Name is the bot name used to access Teleport Auth/Proxy/Tunnel server.
	Name string

	// Role is a role allowed to manage Teleport resources.
	Role string
}

Options configure the sidecar connection.

func (*Options) CheckAndSetDefaults

func (opts *Options) CheckAndSetDefaults() error

Jump to

Keyboard shortcuts

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