controlplanecomponent

package
v0.1.49 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeploymentComponent

func NewDeploymentComponent(name string, opts ComponentOptions) *controlPlaneWorkloadBuilder[*appsv1.Deployment]

func NewStatefulSetComponent

func NewStatefulSetComponent(name string, opts ComponentOptions) *controlPlaneWorkloadBuilder[*appsv1.StatefulSet]

func WithAdaptFunction

func WithAdaptFunction[T client.Object](adapt func(cpContext ControlPlaneContext, resource T) error) option

func WithPredicate

func WithPredicate(predicate Predicate) option

Types

type ComponentOptions

type ComponentOptions interface {
	IsRequestServing() bool
	MultiZoneSpread() bool
	NeedsManagementKASAccess() bool
}

type ControlPlaneComponent

type ControlPlaneComponent interface {
	NamedComponent
	Reconcile(cpContext ControlPlaneContext) error
}

type ControlPlaneContext

type ControlPlaneContext struct {
	context.Context

	upsert.CreateOrUpdateProviderV2
	Client                   client.Client
	HCP                      *hyperv1.HostedControlPlane
	ReleaseImageProvider     imageprovider.ReleaseImageProvider
	UserReleaseImageProvider imageprovider.ReleaseImageProvider

	SetDefaultSecurityContext bool
	MetricsSet                metrics.MetricsSet

	// This is needed for the generic unit test, so we can always generate a fixture for the components deployment/statefulset.
	SkipPredicate bool
}

type KonnectivityContainerOptions

type KonnectivityContainerOptions struct {
	Mode ProxyMode
	// defaults to 'kubeconfig'
	KubeconfingVolumeName string

	// socks5 proxy mode args
	ConnectDirectlyToCloudAPIs      bool
	ResolveFromGuestClusterDNS      bool
	ResolveFromManagementClusterDNS bool
	DisableResolver                 bool
}

type NamedComponent

type NamedComponent interface {
	Name() string
}

type Predicate

type Predicate func(cpContext ControlPlaneContext) bool

func DisableIfAnnotationExist

func DisableIfAnnotationExist(annotation string) Predicate

DisableIfAnnotationExist is a helper predicte for the common use case of disabling a resource when an annotation exists.

type ProxyMode

type ProxyMode string
const (
	Socks5 ProxyMode = "socks5"
	HTTPS  ProxyMode = "https"

	// Dual mode will inject 2 konnectivity containers, one using HTTPS mode and the other using Socks5 mode.
	Dual ProxyMode = "dual"
)

Jump to

Keyboard shortcuts

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