Documentation
¶
Index ¶
- Constants
- Variables
- func CalcMaxPods(awsRegion, instanceType string) int32
- func GetKubeClientFromKubeConfig(opts ...KubeClientOption) (kubernetes.Interface, error)
- func GetKubeletVersion() (string, error)
- func GetKubeletVersionRaw() (*string, error)
- func GetNodeName() (string, error)
- func Install(ctx context.Context, opts InstallOptions) error
- func KubeconfigPath() string
- func NewKubeletDaemon(daemonManager daemon.DaemonManager, cfg *api.NodeConfig, awsConfig *aws.Config, ...) daemon.Daemon
- func Uninstall(opts UninstallOptions) error
- func Upgrade(ctx context.Context, src Source, log *zap.Logger) error
- type CredentialProviderAwsConfig
- type InstallOptions
- type KubeClientOption
- type KubeClientOptions
- type Kubeconfig
- type Kubelet
- type Source
- type UninstallOptions
Constants ¶
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" )
const (
KubeletDaemonName = "kubelet"
)
Variables ¶
var MaxPodsPerInstanceType map[string]int
Functions ¶
func CalcMaxPods ¶
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 GetKubeletVersionRaw ¶
func GetNodeName ¶
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
Types ¶
type CredentialProviderAwsConfig ¶ added in v1.0.5
type InstallOptions ¶ added in v1.0.4
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 (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
KubeconfigPath returns the path to the kubelet's kubeconfig.
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
}