k8s

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MPL-2.0 Imports: 101 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) (*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

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

ControlPlaneAPIServerController manages k8s.APIServerConfig based on configuration.

func NewControlPlaneAPIServerController

func NewControlPlaneAPIServerController() *ControlPlaneAPIServerController

NewControlPlaneAPIServerController instanciates the controller.

type ControlPlaneAdmissionControlController

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

ControlPlaneAdmissionControlController manages k8s.AdmissionControlConfig based on configuration.

func NewControlPlaneAdmissionControlController

func NewControlPlaneAdmissionControlController() *ControlPlaneAdmissionControlController

NewControlPlaneAdmissionControlController instanciates the controller.

type ControlPlaneAuditPolicyController

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

ControlPlaneAuditPolicyController manages k8s.AuditPolicyConfig based on configuration.

func NewControlPlaneAuditPolicyController

func NewControlPlaneAuditPolicyController() *ControlPlaneAuditPolicyController

NewControlPlaneAuditPolicyController instanciates the controller.

type ControlPlaneBootstrapManifestsController

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

ControlPlaneBootstrapManifestsController manages k8s.BootstrapManifestsConfig based on configuration.

func NewControlPlaneBootstrapManifestsController

func NewControlPlaneBootstrapManifestsController() *ControlPlaneBootstrapManifestsController

NewControlPlaneBootstrapManifestsController instanciates the controller.

type ControlPlaneControllerManagerController

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

ControlPlaneControllerManagerController manages k8s.ControllerManagerConfig based on configuration.

func NewControlPlaneControllerManagerController

func NewControlPlaneControllerManagerController() *ControlPlaneControllerManagerController

NewControlPlaneControllerManagerController instanciates the controller.

type ControlPlaneExtraManifestsController

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

ControlPlaneExtraManifestsController manages k8s.ExtraManifestsConfig based on configuration.

func NewControlPlaneExtraManifestsController

func NewControlPlaneExtraManifestsController() *ControlPlaneExtraManifestsController

NewControlPlaneExtraManifestsController instanciates the controller.

type ControlPlaneSchedulerController

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

ControlPlaneSchedulerController manages k8s.SchedulerConfig based on configuration.

func NewControlPlaneSchedulerController

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

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

KubePrismConfigController creates config for KubePrism.

func NewKubePrismConfigController

func NewKubePrismConfigController() *KubePrismConfigController

NewKubePrismConfigController instanciates the controller.

type KubePrismController

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

KubePrismController creates KubePrism load balancer based on KubePrismEndpointsType resource.

func (*KubePrismController) Inputs

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

Inputs implements controller.Controll er interface.

func (*KubePrismController) Name

func (ctrl *KubePrismController) Name() string

Name implements controller.Controller interface.

func (*KubePrismController) Outputs

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

Outputs implements controller.Controller interface.

func (*KubePrismController) Run

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

Run implements controller.Controller interface.

type KubePrismEndpointsController

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

KubePrismEndpointsController creates a list of API server endpoints.

func NewKubePrismEndpointsController

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

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

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

Run implements controller.Controller interface.

type NodeApplyController

type NodeApplyController struct{}

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

func (*NodeApplyController) ApplyCordoned

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

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

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

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

Inputs implements controller.Controller interface.

func (*NodeApplyController) Name

func (ctrl *NodeApplyController) Name() string

Name implements controller.Controller interface.

func (*NodeApplyController) Outputs

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

Outputs implements controller.Controller interface.

func (*NodeApplyController) Run

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

Run implements controller.Controller interface.

type NodeCordonedSpecController

type NodeCordonedSpecController struct{}

NodeCordonedSpecController manages node cordoned status based on configuration.

func (*NodeCordonedSpecController) Inputs

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

Inputs implements controller.Controller interface.

func (*NodeCordonedSpecController) Name

func (ctrl *NodeCordonedSpecController) Name() string

Name implements controller.Controller interface.

func (*NodeCordonedSpecController) Outputs

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

Outputs implements controller.Controller interface.

func (*NodeCordonedSpecController) Run

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

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

type NodeStatusController struct{}

NodeStatusController pulls list of Affiliate resource from the Kubernetes registry.

func (*NodeStatusController) Inputs

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

Inputs implements controller.Controller interface.

func (*NodeStatusController) Name

func (ctrl *NodeStatusController) Name() string

Name implements controller.Controller interface.

func (*NodeStatusController) Outputs

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

Outputs implements controller.Controller interface.

func (*NodeStatusController) Run

Run implements controller.Controller interface.

type NodeTaintSpecController

type NodeTaintSpecController struct{}

NodeTaintSpecController manages k8s.NodeTaintSpec based on configuration.

func (*NodeTaintSpecController) Inputs

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

Inputs implements controller.Controller interface.

func (*NodeTaintSpecController) Name

func (ctrl *NodeTaintSpecController) Name() string

Name implements controller.Controller interface.

func (*NodeTaintSpecController) Outputs

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

Outputs implements controller.Controller interface.

func (*NodeTaintSpecController) Run

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

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

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

type StaticEndpointController struct{}

StaticEndpointController injects endpoints based on machine configuration.

func (*StaticEndpointController) Inputs

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

Inputs implements controller.Controller interface.

func (*StaticEndpointController) Name

func (ctrl *StaticEndpointController) Name() string

Name implements controller.Controller interface.

func (*StaticEndpointController) Outputs

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

Outputs implements controller.Controller interface.

func (*StaticEndpointController) Run

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