bootstrap

package
v0.0.0-...-7453492 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBootstrapConfigurationFlags

func AddBootstrapConfigurationFlags(set *flag.FlagSet)

func BootstrapKubernetesClusters

func BootstrapKubernetesClusters(ctx context.Context, organization string, configuration BootstrapClusterConfiguration) error

func CreateKubeconfigSecret

func CreateKubeconfigSecret(ctx context.Context, data []byte, configuration *RemoteKubernetesConfiguration) error

func CreateRemoteKubeconfig

func CreateRemoteKubeconfig(ctx context.Context, configuration *RemoteKubernetesConfiguration) ([]byte, error)

func CreateTLSSecret

func CreateTLSSecret(ctx context.Context, ca *CACertificate, certificate *Certificate, configuration *RemoteKubernetesConfiguration) error

func EnsureNamespace

func EnsureNamespace(ctx context.Context, namespace string, cl client.Client) error

Types

type BootstrapClusterConfiguration

type BootstrapClusterConfiguration struct {
	BootstrapTLS         bool
	BootstrapKubeconfigs bool
	EnsureNamespace      bool
	OperatorNamespace    string
	ServiceName          string
	RemoteClusters       []RemoteConfiguration
}

func ConfigurationFromFlags

func ConfigurationFromFlags() (BootstrapClusterConfiguration, error)

type CACertificate

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

func GenerateCA

func GenerateCA(organization, name string, configuration *CAConfiguration) (*CACertificate, error)

func LoadCA

func LoadCA(certPEM, keyPEM []byte, configuration *CAConfiguration) (*CACertificate, error)

func (*CACertificate) Bytes

func (c *CACertificate) Bytes() []byte

func (*CACertificate) Intermediate

func (c *CACertificate) Intermediate(name string) (*CACertificate, error)

func (*CACertificate) PrivateKeyBytes

func (c *CACertificate) PrivateKeyBytes() []byte

func (*CACertificate) Sign

func (c *CACertificate) Sign(names ...string) (*Certificate, error)

type CAConfiguration

type CAConfiguration struct {
	NotBeforeGracePeriod   time.Duration
	CALifetime             time.Duration
	IntermediateCALifetime time.Duration
	CertificateLifetime    time.Duration
}

type Certificate

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

func (*Certificate) Bytes

func (c *Certificate) Bytes() []byte

func (*Certificate) PrivateKeyBytes

func (c *Certificate) PrivateKeyBytes() []byte

type CertificateConfiguration

type CertificateConfiguration struct {
	Namespace string
	Name      string
}

type RemoteConfiguration

type RemoteConfiguration struct {
	ContextName    string
	APIServer      string
	ServiceAddress string
}

func (RemoteConfiguration) Address

func (r RemoteConfiguration) Address() (string, error)

func (RemoteConfiguration) Client

func (r RemoteConfiguration) Client() (client.Client, error)

func (RemoteConfiguration) Config

func (r RemoteConfiguration) Config() (*rest.Config, error)

func (RemoteConfiguration) FQDN

type RemoteKubernetesConfiguration

type RemoteKubernetesConfiguration struct {
	ContextName     string
	Namespace       string
	Name            string
	APIServer       string
	RESTConfig      *rest.Config
	EnsureNamespace bool
}

Jump to

Keyboard shortcuts

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