k8s

package
v1.9.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MPL-2.0 Imports: 103 Imported by: 0

Documentation

Overview

Package k8s provides controllers which manage Kubernetes resources.

Index

Constants

View Source
const GoGCMemLimitPercentage = 95

GoGCMemLimitPercentage set the percentage of memorylimit to use for the golang garbage collection target limit.

Variables

This section is empty.

Functions

func NewKubeletConfiguration

func NewKubeletConfiguration(cfgSpec *k8s.KubeletConfigSpec, kubeletVersion compatibility.Version, machineType machine.Type) (*kubeletconfig.KubeletConfiguration, error)

NewKubeletConfiguration builds kubelet configuration with defaults and overrides from extraConfig.

Types

type AddressFilterController

type AddressFilterController struct{}

AddressFilterController creates NodeAddressFilters based on machine configuration.

func (*AddressFilterController) Inputs

func (ctrl *AddressFilterController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*AddressFilterController) Name

func (ctrl *AddressFilterController) Name() string

Name implements controller.Controller interface.

func (*AddressFilterController) Outputs

func (ctrl *AddressFilterController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*AddressFilterController) Run

Run implements controller.Controller interface.

type ControlPlaneAPIServerController added in v1.5.0

type ControlPlaneAPIServerController = transform.Controller[*config.MachineConfig, *k8s.APIServerConfig]

ControlPlaneAPIServerController manages k8s.APIServerConfig based on configuration.

func NewControlPlaneAPIServerController added in v1.5.0

func NewControlPlaneAPIServerController() *ControlPlaneAPIServerController

NewControlPlaneAPIServerController instanciates the controller.

type ControlPlaneAdmissionControlController added in v1.5.0

type ControlPlaneAdmissionControlController = transform.Controller[*config.MachineConfig, *k8s.AdmissionControlConfig]

ControlPlaneAdmissionControlController manages k8s.AdmissionControlConfig based on configuration.

func NewControlPlaneAdmissionControlController added in v1.5.0

func NewControlPlaneAdmissionControlController() *ControlPlaneAdmissionControlController

NewControlPlaneAdmissionControlController instanciates the controller.

type ControlPlaneAuditPolicyController added in v1.5.0

type ControlPlaneAuditPolicyController = transform.Controller[*config.MachineConfig, *k8s.AuditPolicyConfig]

ControlPlaneAuditPolicyController manages k8s.AuditPolicyConfig based on configuration.

func NewControlPlaneAuditPolicyController added in v1.5.0

func NewControlPlaneAuditPolicyController() *ControlPlaneAuditPolicyController

NewControlPlaneAuditPolicyController instanciates the controller.

type ControlPlaneBootstrapManifestsController added in v1.5.0

type ControlPlaneBootstrapManifestsController = transform.Controller[*config.MachineConfig, *k8s.BootstrapManifestsConfig]

ControlPlaneBootstrapManifestsController manages k8s.BootstrapManifestsConfig based on configuration.

func NewControlPlaneBootstrapManifestsController added in v1.5.0

func NewControlPlaneBootstrapManifestsController() *ControlPlaneBootstrapManifestsController

NewControlPlaneBootstrapManifestsController instanciates the controller.

type ControlPlaneControllerManagerController added in v1.5.0

type ControlPlaneControllerManagerController = transform.Controller[*config.MachineConfig, *k8s.ControllerManagerConfig]

ControlPlaneControllerManagerController manages k8s.ControllerManagerConfig based on configuration.

func NewControlPlaneControllerManagerController added in v1.5.0

func NewControlPlaneControllerManagerController() *ControlPlaneControllerManagerController

NewControlPlaneControllerManagerController instanciates the controller.

type ControlPlaneExtraManifestsController added in v1.5.0

type ControlPlaneExtraManifestsController = transform.Controller[*config.MachineConfig, *k8s.ExtraManifestsConfig]

ControlPlaneExtraManifestsController manages k8s.ExtraManifestsConfig based on configuration.

func NewControlPlaneExtraManifestsController added in v1.5.0

func NewControlPlaneExtraManifestsController() *ControlPlaneExtraManifestsController

NewControlPlaneExtraManifestsController instanciates the controller.

type ControlPlaneSchedulerController added in v1.5.0

type ControlPlaneSchedulerController = transform.Controller[*config.MachineConfig, *k8s.SchedulerConfig]

ControlPlaneSchedulerController manages k8s.SchedulerConfig based on configuration.

func NewControlPlaneSchedulerController added in v1.5.0

func NewControlPlaneSchedulerController() *ControlPlaneSchedulerController

NewControlPlaneSchedulerController instanciates the controller.

type ControlPlaneStaticPodController

type ControlPlaneStaticPodController struct{}

ControlPlaneStaticPodController manages k8s.StaticPod based on control plane configuration.

func (*ControlPlaneStaticPodController) Inputs

Inputs implements controller.Controller interface.

func (*ControlPlaneStaticPodController) Name

Name implements controller.Controller interface.

func (*ControlPlaneStaticPodController) Outputs

Outputs implements controller.Controller interface.

func (*ControlPlaneStaticPodController) Run

Run implements controller.Controller interface.

type EndpointController

type EndpointController struct{}

EndpointController looks up control plane endpoints.

func (*EndpointController) Inputs

func (ctrl *EndpointController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*EndpointController) Name

func (ctrl *EndpointController) Name() string

Name implements controller.Controller interface.

func (*EndpointController) Outputs

func (ctrl *EndpointController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*EndpointController) Run

func (ctrl *EndpointController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

type ExtraManifestController

type ExtraManifestController struct{}

ExtraManifestController renders manifests based on templates and config/secrets.

func (*ExtraManifestController) Inputs

func (ctrl *ExtraManifestController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*ExtraManifestController) Name

func (ctrl *ExtraManifestController) Name() string

Name implements controller.Controller interface.

func (*ExtraManifestController) Outputs

func (ctrl *ExtraManifestController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*ExtraManifestController) Run

Run implements controller.Controller interface.

type KubePrismConfigController added in v1.5.0

type KubePrismConfigController = transform.Controller[*config.MachineConfig, *k8s.KubePrismConfig]

KubePrismConfigController creates config for KubePrism.

func NewKubePrismConfigController added in v1.5.0

func NewKubePrismConfigController() *KubePrismConfigController

NewKubePrismConfigController instanciates the controller.

type KubePrismController added in v1.5.0

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

KubePrismController creates KubePrism load balancer based on KubePrismEndpointsType resource.

func (*KubePrismController) Inputs added in v1.5.0

func (ctrl *KubePrismController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*KubePrismController) Name added in v1.5.0

func (ctrl *KubePrismController) Name() string

Name implements controller.Controller interface.

func (*KubePrismController) Outputs added in v1.5.0

func (ctrl *KubePrismController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*KubePrismController) Run added in v1.5.0

func (ctrl *KubePrismController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

type KubePrismEndpointsController added in v1.5.0

type KubePrismEndpointsController = transform.Controller[*config.MachineConfig, *k8s.KubePrismEndpoints]

KubePrismEndpointsController creates a list of API server endpoints.

func NewKubePrismEndpointsController added in v1.5.0

func NewKubePrismEndpointsController() *KubePrismEndpointsController

NewKubePrismEndpointsController instanciates the controller.

type KubeletConfigController

type KubeletConfigController = transform.Controller[*config.MachineConfig, *k8s.KubeletConfig]

KubeletConfigController renders kubelet configuration based on machine config.

func NewKubeletConfigController added in v1.5.0

func NewKubeletConfigController() *KubeletConfigController

NewKubeletConfigController instanciates the config controller.

type KubeletServiceController

type KubeletServiceController struct {
	V1Alpha1Services ServiceManager
	V1Alpha1Mode     runtimetalos.Mode
}

KubeletServiceController renders kubelet configuration files and controls kubelet service lifecycle.

func (*KubeletServiceController) Inputs

func (ctrl *KubeletServiceController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*KubeletServiceController) Name

func (ctrl *KubeletServiceController) Name() string

Name implements controller.Controller interface.

func (*KubeletServiceController) Outputs

func (ctrl *KubeletServiceController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*KubeletServiceController) Run

Run implements controller.Controller interface.

type KubeletSpecController

type KubeletSpecController struct {
	V1Alpha1Mode v1alpha1runtime.Mode
}

KubeletSpecController renders manifests based on templates and config/secrets.

func (*KubeletSpecController) Inputs

func (ctrl *KubeletSpecController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*KubeletSpecController) Name

func (ctrl *KubeletSpecController) Name() string

Name implements controller.Controller interface.

func (*KubeletSpecController) Outputs

func (ctrl *KubeletSpecController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*KubeletSpecController) Run

Run implements controller.Controller interface.

type KubeletStaticPodController

type KubeletStaticPodController struct{}

KubeletStaticPodController renders static pod definitions and manages k8s.StaticPodStatus.

func (*KubeletStaticPodController) Inputs

func (ctrl *KubeletStaticPodController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*KubeletStaticPodController) Name

func (ctrl *KubeletStaticPodController) Name() string

Name implements controller.Controller interface.

func (*KubeletStaticPodController) Outputs

func (ctrl *KubeletStaticPodController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*KubeletStaticPodController) Run

Run implements controller.Controller interface.

type ManifestApplyController

type ManifestApplyController struct{}

ManifestApplyController applies manifests via control plane endpoint.

func (*ManifestApplyController) Inputs

func (ctrl *ManifestApplyController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*ManifestApplyController) Name

func (ctrl *ManifestApplyController) Name() string

Name implements controller.Controller interface.

func (*ManifestApplyController) Outputs

func (ctrl *ManifestApplyController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*ManifestApplyController) Run

Run implements controller.Controller interface.

type ManifestController

type ManifestController struct{}

ManifestController renders manifests based on templates and config/secrets.

func (*ManifestController) Inputs

func (ctrl *ManifestController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*ManifestController) Name

func (ctrl *ManifestController) Name() string

Name implements controller.Controller interface.

func (*ManifestController) Outputs

func (ctrl *ManifestController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*ManifestController) Run

Run implements controller.Controller interface.

type NodeAnnotationSpecController added in v1.8.0

type NodeAnnotationSpecController struct{}

NodeAnnotationSpecController manages k8s.NodeAnnotationsConfig based on configuration.

func (*NodeAnnotationSpecController) Inputs added in v1.8.0

Inputs implements controller.Controller interface.

func (*NodeAnnotationSpecController) Name added in v1.8.0

func (ctrl *NodeAnnotationSpecController) Name() string

Name implements controller.Controller interface.

func (*NodeAnnotationSpecController) Outputs added in v1.8.0

Outputs implements controller.Controller interface.

func (*NodeAnnotationSpecController) Run added in v1.8.0

Run implements controller.Controller interface.

type NodeApplyController added in v1.5.0

type NodeApplyController struct{}

NodeApplyController watches k8s.NodeLabelSpecs, k8s.NodeTaintSpecs and applies them to the k8s Node object.

func (*NodeApplyController) ApplyAnnotations added in v1.8.0

func (ctrl *NodeApplyController) ApplyAnnotations(logger *zap.Logger, node *v1.Node, ownedAnnotations map[string]struct{}, nodeAnnotationSpecs map[string]string)

ApplyAnnotations performs the inner loop of the node annotation reconciliation.

This method is exported for testing purposes.

func (*NodeApplyController) ApplyCordoned added in v1.5.0

func (ctrl *NodeApplyController) ApplyCordoned(logger *zap.Logger, node *v1.Node, shouldCordon bool)

ApplyCordoned marks the node as unschedulable if it is cordoned.

This method is exported for testing purposes.

func (*NodeApplyController) ApplyLabels added in v1.5.0

func (ctrl *NodeApplyController) ApplyLabels(logger *zap.Logger, node *v1.Node, ownedLabels map[string]struct{}, nodeLabelSpecs map[string]string)

ApplyLabels performs the inner loop of the node label reconciliation.

This method is exported for testing purposes.

func (*NodeApplyController) ApplyTaints added in v1.5.0

func (ctrl *NodeApplyController) ApplyTaints(logger *zap.Logger, node *v1.Node, ownedTaints map[string]struct{}, nodeTaints []k8s.NodeTaintSpecSpec)

ApplyTaints performs the inner loop of the node taints reconciliation.

This method is exported for testing purposes.

func (*NodeApplyController) Inputs added in v1.5.0

func (ctrl *NodeApplyController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*NodeApplyController) Name added in v1.5.0

func (ctrl *NodeApplyController) Name() string

Name implements controller.Controller interface.

func (*NodeApplyController) Outputs added in v1.5.0

func (ctrl *NodeApplyController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*NodeApplyController) Run added in v1.5.0

func (ctrl *NodeApplyController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

type NodeCordonedSpecController added in v1.5.0

type NodeCordonedSpecController struct{}

NodeCordonedSpecController manages node cordoned status based on configuration.

func (*NodeCordonedSpecController) Inputs added in v1.5.0

func (ctrl *NodeCordonedSpecController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*NodeCordonedSpecController) Name added in v1.5.0

func (ctrl *NodeCordonedSpecController) Name() string

Name implements controller.Controller interface.

func (*NodeCordonedSpecController) Outputs added in v1.5.0

func (ctrl *NodeCordonedSpecController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*NodeCordonedSpecController) Run added in v1.5.0

Run implements controller.Controller interface.

type NodeIPConfigController

type NodeIPConfigController = transform.Controller[*config.MachineConfig, *k8s.NodeIPConfig]

NodeIPConfigController configures k8s.NodeIP based on machine config.

func NewNodeIPConfigController added in v1.5.0

func NewNodeIPConfigController() *NodeIPConfigController

NewNodeIPConfigController instanciates the controller.

type NodeIPController

type NodeIPController struct{}

NodeIPController renders manifests based on templates and config/secrets.

func (*NodeIPController) Inputs

func (ctrl *NodeIPController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*NodeIPController) Name

func (ctrl *NodeIPController) Name() string

Name implements controller.Controller interface.

func (*NodeIPController) Outputs

func (ctrl *NodeIPController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*NodeIPController) Run

func (ctrl *NodeIPController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

type NodeLabelSpecController

type NodeLabelSpecController struct{}

NodeLabelSpecController manages k8s.NodeLabelsConfig based on configuration.

func (*NodeLabelSpecController) Inputs

func (ctrl *NodeLabelSpecController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*NodeLabelSpecController) Name

func (ctrl *NodeLabelSpecController) Name() string

Name implements controller.Controller interface.

func (*NodeLabelSpecController) Outputs

func (ctrl *NodeLabelSpecController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*NodeLabelSpecController) Run

Run implements controller.Controller interface.

type NodeStatusController added in v1.5.0

type NodeStatusController struct{}

NodeStatusController pulls list of Affiliate resource from the Kubernetes registry.

func (*NodeStatusController) Inputs added in v1.5.0

func (ctrl *NodeStatusController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*NodeStatusController) Name added in v1.5.0

func (ctrl *NodeStatusController) Name() string

Name implements controller.Controller interface.

func (*NodeStatusController) Outputs added in v1.5.0

func (ctrl *NodeStatusController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*NodeStatusController) Run added in v1.5.0

Run implements controller.Controller interface.

type NodeTaintSpecController added in v1.5.0

type NodeTaintSpecController struct{}

NodeTaintSpecController manages k8s.NodeTaintSpec based on configuration.

func (*NodeTaintSpecController) Inputs added in v1.5.0

func (ctrl *NodeTaintSpecController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*NodeTaintSpecController) Name added in v1.5.0

func (ctrl *NodeTaintSpecController) Name() string

Name implements controller.Controller interface.

func (*NodeTaintSpecController) Outputs added in v1.5.0

func (ctrl *NodeTaintSpecController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*NodeTaintSpecController) Run added in v1.5.0

Run implements controller.Controller interface.

type NodenameController

type NodenameController struct{}

NodenameController renders manifests based on templates and config/secrets.

func (*NodenameController) Inputs

func (ctrl *NodenameController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*NodenameController) Name

func (ctrl *NodenameController) Name() string

Name implements controller.Controller interface.

func (*NodenameController) Outputs

func (ctrl *NodenameController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*NodenameController) Run

Run implements controller.Controller interface.

type RenderConfigsStaticPodController

type RenderConfigsStaticPodController struct{}

RenderConfigsStaticPodController manages k8s.ConfigsReady and renders configs for the control plane.

func (*RenderConfigsStaticPodController) Inputs

Inputs implements controller.Controller interface.

func (*RenderConfigsStaticPodController) Name

Name implements controller.Controller interface.

func (*RenderConfigsStaticPodController) Outputs

Outputs implements controller.Controller interface.

func (*RenderConfigsStaticPodController) Run

Run implements controller.Controller interface.

type RenderSecretsStaticPodController

type RenderSecretsStaticPodController struct{}

RenderSecretsStaticPodController manages k8s.SecretsReady and renders secrets from secrets.Kubernetes.

func (*RenderSecretsStaticPodController) Inputs

Inputs implements controller.Controller interface.

func (*RenderSecretsStaticPodController) Name

Name implements controller.Controller interface.

func (*RenderSecretsStaticPodController) Outputs

Outputs implements controller.Controller interface.

func (*RenderSecretsStaticPodController) Run

Run implements controller.Controller interface.

type ServiceManager

type ServiceManager interface {
	IsRunning(id string) (system.Service, bool, error)
	Load(services ...system.Service) []string
	Stop(ctx context.Context, serviceIDs ...string) (err error)
	Start(serviceIDs ...string) error
}

ServiceManager is the interface to the v1alpha1 services subsystems.

type StaticEndpointController added in v1.3.2

type StaticEndpointController struct{}

StaticEndpointController injects endpoints based on machine configuration.

func (*StaticEndpointController) Inputs added in v1.3.2

func (ctrl *StaticEndpointController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*StaticEndpointController) Name added in v1.3.2

func (ctrl *StaticEndpointController) Name() string

Name implements controller.Controller interface.

func (*StaticEndpointController) Outputs added in v1.3.2

func (ctrl *StaticEndpointController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*StaticEndpointController) Run added in v1.3.2

Run implements controller.Controller interface.

type StaticPodConfigController

type StaticPodConfigController struct{}

StaticPodConfigController manages k8s.StaticPod based on machine configuration.

func (*StaticPodConfigController) Inputs

func (ctrl *StaticPodConfigController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*StaticPodConfigController) Name

func (ctrl *StaticPodConfigController) Name() string

Name implements controller.Controller interface.

func (*StaticPodConfigController) Outputs

func (ctrl *StaticPodConfigController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*StaticPodConfigController) Run

Run implements controller.Controller interface.

type StaticPodServerController

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

StaticPodServerController renders all static pod definitions as a PodList and serves it as YAML via HTTP.

func (*StaticPodServerController) Inputs

func (ctrl *StaticPodServerController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*StaticPodServerController) Name

func (ctrl *StaticPodServerController) Name() string

Name implements controller.Controller interface.

func (*StaticPodServerController) Outputs

func (ctrl *StaticPodServerController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*StaticPodServerController) Run

Run implements controller.Controller interface.

type TalosServiceAccount

type TalosServiceAccount struct {
	Group            string
	Version          string
	Kind             string
	ResourceSingular string
	ResourcePlural   string
	ShortName        string
}

TalosServiceAccount is a struct used by the template engine which contains the needed variables to be able to construct the Talos Service Account CRD.

Directories

Path Synopsis
internal
nodename
Package nodename provides utility functions to generate nodenames.
Package nodename provides utility functions to generate nodenames.
nodewatch
Package nodewatch implements Kubernetes node watcher.
Package nodewatch implements Kubernetes node watcher.

Jump to

Keyboard shortcuts

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