kubelet

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBinPath is the path to the Kubelet binary.
	BinPath = "/usr/bin/kubelet"

	// UnitPath is the path to the Kubelet systemd unit file.
	UnitPath = "/etc/systemd/system/kubelet.service"
)
View Source
const (
	KubeletDaemonName = "kubelet"
)

Variables

View Source
var MaxPodsPerInstanceType map[string]int

Functions

func CalcMaxPods

func CalcMaxPods(awsRegion, instanceType string) int32

CalcMaxPods handle the edge case when instance type is not present in MaxPodsPerInstanceType The behavior should align with AL2, which essentially is:

# of ENI * (# of IPv4 per ENI - 1) + 2

func GetKubeClientFromKubeConfig

func GetKubeClientFromKubeConfig(opts ...KubeClientOption) (kubernetes.Interface, error)

GetKubeClientFromKubeConfig gets kubernetes client from kubeconfig on the disk

func GetKubeletVersion

func GetKubeletVersion() (string, error)

func GetKubeletVersionRaw

func GetKubeletVersionRaw() (*string, error)

func GetNodeName

func GetNodeName() (string, error)

GetNodeName gets the current node name from the providerId in kubelet config

func Install

func Install(ctx context.Context, opts InstallOptions) error

Install installs kubelet at BinPath and installs a systemd unit file at UnitPath. The systemd unit is configured to launch the kubelet binary.

func KubeconfigPath

func KubeconfigPath() string

KubeconfigPath returns the path to the kubeconfig file used by the kubelet.

func NewKubeletDaemon

func NewKubeletDaemon(daemonManager daemon.DaemonManager, cfg *api.NodeConfig, awsConfig *aws.Config, credentialProviderAwsConfig CredentialProviderAwsConfig, logger *zap.Logger, skipPhases []string) daemon.Daemon

func Uninstall

func Uninstall(opts UninstallOptions) error

func Upgrade added in v1.0.4

func Upgrade(ctx context.Context, src Source, log *zap.Logger) error

Types

type CredentialProviderAwsConfig added in v1.0.5

type CredentialProviderAwsConfig struct {
	Profile         string
	CredentialsPath string
}

type InstallOptions added in v1.0.4

type InstallOptions struct {
	InstallRoot string
	Tracker     *tracker.Tracker
	Source      Source
	Logger      *zap.Logger
}

type KubeClientOption added in v1.0.5

type KubeClientOption func(*KubeClientOptions)

func WithAwsEnvironmentVariables added in v1.0.5

func WithAwsEnvironmentVariables(envVars map[string]string) KubeClientOption

type KubeClientOptions added in v1.0.5

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

type Kubeconfig added in v1.0.4

type Kubeconfig struct{}

Kubeconfig is the default kubeconfig generated for the kubelet.

func (Kubeconfig) BuildClient added in v1.0.4

func (d Kubeconfig) BuildClient() (kubernetes.Interface, error)

BuildClient builds a new Kubernetes client from the kubeconfig.

func (Kubeconfig) Path added in v1.0.4

func (d Kubeconfig) Path() string

Path returns the path to the kubeconfig file used by the kubelet.

type Kubelet added in v1.0.4

type Kubelet struct {
	Kubeconfig
}

Kubelet groups several helpers so it can be injected in other packages without creating a dependency on this one and facilitating testing withouthaving to read the disk.

func New added in v1.0.4

func New() Kubelet

func (Kubelet) BuildClient added in v1.0.4

func (k Kubelet) BuildClient() (kubernetes.Interface, error)

BuildClient builds a new Kubernetes client from the kubelet's kubeconfig.

func (Kubelet) KubeconfigPath added in v1.0.4

func (k Kubelet) KubeconfigPath() string

KubeconfigPath returns the path to the kubelet's kubeconfig.

func (Kubelet) Version added in v1.0.4

func (k Kubelet) Version() (string, error)

Version returns the version of the kubelet.

type Source

type Source interface {
	GetKubelet(context.Context) (artifact.Source, error)
}

Source represents a source that serves a kubelet binary.

type UninstallOptions added in v1.0.4

type UninstallOptions struct {
	// InstallRoot is optionally the root directory of the installation
	// If not provided, the default will be /
	InstallRoot string
}

Jump to

Keyboard shortcuts

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