initializer

package
v1.14.9 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package initializer initializes a new installation of Crossplane.

Index

Constants

View Source
const (
	// RootCACertSecretName is the name of the secret that will store CA certificates and rest of the
	// certificates created per entities will be signed by this CA
	RootCACertSecretName = "crossplane-root-ca"

	// SecretKeyCACert is the secret key of CA certificate
	SecretKeyCACert = "ca.crt"
)

Variables

This section is empty.

Functions

func DNSNamesForService added in v1.14.0

func DNSNamesForService(service, namespace string) []string

DNSNamesForService returns a list of DNS names for a given service name and namespace.

func DefaultDeploymentRuntimeConfig added in v1.14.0

func DefaultDeploymentRuntimeConfig(ctx context.Context, kube client.Client) error

DefaultDeploymentRuntimeConfig creates a "default" DeploymentRuntimeConfig object. It is a no-op if the object already exists.

Types

type CRDWaiter

type CRDWaiter struct {
	Names   []string
	Timeout time.Duration
	Period  time.Duration
	// contains filtered or unexported fields
}

CRDWaiter blocks the execution until all the CRDs whose names are given are deployed to the cluster.

func NewCRDWaiter

func NewCRDWaiter(names []string, timeout time.Duration, period time.Duration, log logging.Logger) *CRDWaiter

NewCRDWaiter returns a new *CRDWaiter initializer.

func (*CRDWaiter) Run

func (cw *CRDWaiter) Run(ctx context.Context, kube client.Client) error

Run continuously checks whether the list of CRDs whose names are given are present in the cluster.

type CertGenerator added in v1.12.0

type CertGenerator struct{}

CertGenerator generates a root CA and key that can be used by client and servers.

func NewCertGenerator added in v1.12.0

func NewCertGenerator() *CertGenerator

NewCertGenerator returns a new CertGenerator.

func (*CertGenerator) Generate added in v1.12.0

func (*CertGenerator) Generate(cert *x509.Certificate, signer *CertificateSigner) (key []byte, crt []byte, err error)

Generate creates TLS Secret with 10 years expiration date that is valid for the given domains.

type CertificateGenerator added in v1.7.0

type CertificateGenerator interface {
	Generate(*x509.Certificate, *CertificateSigner) (key []byte, crt []byte, err error)
}

CertificateGenerator can return you TLS certificate valid for given domains.

type CertificateSigner added in v1.12.0

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

CertificateSigner is the parent's certificate and key that will be used to sign the certificate

type CoreCRDs

type CoreCRDs struct {
	Path                string
	Scheme              *runtime.Scheme
	WebhookTLSSecretRef *types.NamespacedName
	// contains filtered or unexported fields
}

CoreCRDs makes sure the CRDs are installed.

func NewCoreCRDs

func NewCoreCRDs(path string, s *runtime.Scheme, opts ...CoreCRDsOption) *CoreCRDs

NewCoreCRDs returns a new *CoreCRDs.

func (*CoreCRDs) Run

func (c *CoreCRDs) Run(ctx context.Context, kube client.Client) error

Run applies all CRDs in the given directory.

type CoreCRDsMigrator added in v1.13.1

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

CoreCRDsMigrator makes sure the CRDs are using the latest storage version.

func NewCoreCRDsMigrator added in v1.13.1

func NewCoreCRDsMigrator(crdName, sourceVersion string) *CoreCRDsMigrator

NewCoreCRDsMigrator returns a new *CoreCRDsMigrator.

func (*CoreCRDsMigrator) Run added in v1.13.1

func (c *CoreCRDsMigrator) Run(ctx context.Context, kube client.Client) error

Run applies all CRDs in the given directory.

type CoreCRDsOption added in v1.7.0

type CoreCRDsOption func(*CoreCRDs)

CoreCRDsOption configures CoreCRDs step.

func WithFs added in v1.7.0

func WithFs(fs afero.Fs) CoreCRDsOption

WithFs is used to configure the filesystem the CRDs will be read from. Its default is afero.OsFs.

func WithWebhookTLSSecretRef added in v1.7.0

func WithWebhookTLSSecretRef(nn types.NamespacedName) CoreCRDsOption

WithWebhookTLSSecretRef configures CoreCRDs with the TLS Secret name so that it can fetch it and inject the CA bundle to CRDs with webhook conversion strategy.

type Initializer

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

Initializer makes sure the CRDs Crossplane reconciles are ready to go before starting main Crossplane routines.

func New

func New(kube client.Client, log logging.Logger, steps ...Step) *Initializer

New returns a new *Initializer.

func (*Initializer) Init

func (c *Initializer) Init(ctx context.Context) error

Init does all operations necessary for controllers and webhooks to work.

type LockObject

type LockObject struct{}

LockObject has the initializer for creating the Lock object.

func NewLockObject

func NewLockObject() *LockObject

NewLockObject returns a new *LockObject initializer.

func (*LockObject) Run

func (lo *LockObject) Run(ctx context.Context, kube client.Client) error

Run makes sure Lock object exists.

type PackageInstaller

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

PackageInstaller has the initializer for installing a list of packages.

func NewPackageInstaller

func NewPackageInstaller(p []string, c []string) *PackageInstaller

NewPackageInstaller returns a new package installer.

func (*PackageInstaller) Run

func (pi *PackageInstaller) Run(ctx context.Context, kube client.Client) error

Run makes sure all specified packages exist.

type Step

type Step interface {
	Run(ctx context.Context, kube client.Client) error
}

Step is a blocking step of the initialization process.

type StepFunc added in v1.14.0

type StepFunc func(ctx context.Context, kube client.Client) error

StepFunc is a function that implements Step.

func (StepFunc) Run added in v1.14.0

func (f StepFunc) Run(ctx context.Context, kube client.Client) error

Run calls the step function.

type StoreConfigObject added in v1.7.0

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

StoreConfigObject has the initializer for creating the default secret StoreConfig.

func NewStoreConfigObject added in v1.7.0

func NewStoreConfigObject(ns string) *StoreConfigObject

NewStoreConfigObject returns a new *StoreConfigObject initializer.

func (*StoreConfigObject) Run added in v1.7.0

func (so *StoreConfigObject) Run(ctx context.Context, kube client.Client) error

Run makes sure a StoreConfig named as default exists.

type TLSCertificateGenerator added in v1.14.0

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

TLSCertificateGenerator is an initializer step that will find the given secret and fill its tls.crt, tls.key and ca.crt fields to be used for External Secret Store plugins

func NewTLSCertificateGenerator added in v1.14.0

func NewTLSCertificateGenerator(ns, caSecret string, opts ...TLSCertificateGeneratorOption) *TLSCertificateGenerator

NewTLSCertificateGenerator returns a new TLSCertificateGenerator.

func (*TLSCertificateGenerator) Run added in v1.14.0

Run generates the TLS certificate bundle and stores it in k8s secrets, only creates configured secrets, returns immediately if there is nothing to do.

type TLSCertificateGeneratorOption added in v1.14.0

type TLSCertificateGeneratorOption func(*TLSCertificateGenerator)

TLSCertificateGeneratorOption is used to configure TLSCertificateGenerator behavior.

func TLSCertificateGeneratorWithClientSecretName added in v1.14.0

func TLSCertificateGeneratorWithClientSecretName(s string, subjects []string) TLSCertificateGeneratorOption

TLSCertificateGeneratorWithClientSecretName returns an TLSCertificateGeneratorOption that sets client secret name.

func TLSCertificateGeneratorWithLogger added in v1.14.0

func TLSCertificateGeneratorWithLogger(log logging.Logger) TLSCertificateGeneratorOption

TLSCertificateGeneratorWithLogger returns an TLSCertificateGeneratorOption that configures logger

func TLSCertificateGeneratorWithOwner added in v1.14.0

func TLSCertificateGeneratorWithOwner(owner []metav1.OwnerReference) TLSCertificateGeneratorOption

TLSCertificateGeneratorWithOwner returns an TLSCertificateGeneratorOption that sets owner reference

func TLSCertificateGeneratorWithServerSecretName added in v1.14.0

func TLSCertificateGeneratorWithServerSecretName(s string, dnsNames []string) TLSCertificateGeneratorOption

TLSCertificateGeneratorWithServerSecretName returns an TLSCertificateGeneratorOption that sets server secret name.

type WebhookConfigurations added in v1.7.0

type WebhookConfigurations struct {
	Path             string
	Scheme           *runtime.Scheme
	TLSSecretRef     types.NamespacedName
	ServiceReference admv1.ServiceReference
	// contains filtered or unexported fields
}

WebhookConfigurations makes sure the ValidatingWebhookConfigurations and MutatingWebhookConfiguration are installed.

func NewWebhookConfigurations added in v1.7.0

func NewWebhookConfigurations(path string, s *runtime.Scheme, tlsSecretRef types.NamespacedName, svc admv1.ServiceReference, opts ...WebhookConfigurationsOption) *WebhookConfigurations

NewWebhookConfigurations returns a new *WebhookConfigurations.

func (*WebhookConfigurations) Run added in v1.7.0

Run applies all webhook ValidatingWebhookConfigurations and MutatingWebhookConfiguration in the given directory.

type WebhookConfigurationsOption added in v1.7.0

type WebhookConfigurationsOption func(*WebhookConfigurations)

WebhookConfigurationsOption configures WebhookConfigurations step.

func WithWebhookConfigurationsFs added in v1.7.0

func WithWebhookConfigurationsFs(fs afero.Fs) WebhookConfigurationsOption

WithWebhookConfigurationsFs is used to configure the filesystem the CRDs will be read from. Its default is afero.OsFs.

Jump to

Keyboard shortcuts

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