kubelet

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Overview

Package kubelet implements logic needed for creating and managing kubelet instances running as containers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromYaml

func FromYaml(c []byte) (types.Resource, error)

FromYaml allows to restore cluster state from YAML.

Types

type Kubelet

type Kubelet struct {
	Address             string    `json:"address,omitempty"`
	Image               string    `json:"image,omitempty"`
	Host                host.Host `json:"host,omitempty"`
	BootstrapKubeconfig string    `json:"bootstrapKubeconfig,omitempty"`
	// TODO we require CA certificate, so it can be referred in bootstrap-kubeconfig. Maybe we should be responsible for creating
	// bootstrap-kubeconfig too then?
	KubernetesCACertificate    types.Certificate      `json:"kubernetesCACertificate,omitempty"`
	ClusterDNSIPs              []string               `json:"clusterDNSIPs,omitempty"`
	Name                       string                 `json:"name,omitempty"`
	Taints                     map[string]string      `json:"taints,omitempty"`
	Labels                     map[string]string      `json:"labels,omitempty"`
	PrivilegedLabels           map[string]string      `json:"privilegedLabels,omitempty"`
	PrivilegedLabelsKubeconfig string                 `json:"privilegedLabelsKubeconfig,omitempty"`
	CgroupDriver               string                 `json:"cgroupDriver,omitempty"`
	NetworkPlugin              string                 `json:"networkPlugin,omitempty"`
	SystemReserved             map[string]string      `json:"systemReserved,omitempty"`
	KubeReserved               map[string]string      `json:"kubeReserved,omitempty"`
	HairpinMode                string                 `json:"hairpinMode,omitempty"`
	VolumePluginDir            string                 `json:"volumePluginDir,omitempty"`
	ExtraMounts                []containertypes.Mount `json:"extraMounts,omitempty"`

	// Depending on the network plugin, this should be optional, but for now it's required.
	PodCIDR string `json:"podCIDR,omitempty"`
}

Kubelet represents single kubelet instance.

func (*Kubelet) New

New validates Kubelet configuration and returns it's usable version.

func (*Kubelet) Validate

func (k *Kubelet) Validate() error

Validate validates kubelet configuration.

TODO better validation should be done here

type Pool

type Pool struct {
	// User-configurable fields.
	Image                      string                 `json:"image,omitempty"`
	SSH                        *ssh.Config            `json:"ssh,omitempty"`
	BootstrapKubeconfig        string                 `json:"bootstrapKubeconfig,omitempty"`
	Kubelets                   []Kubelet              `json:"kubelets,omitempty"`
	KubernetesCACertificate    types.Certificate      `json:"kubernetesCACertificate,omitempty"`
	ClusterDNSIPs              []string               `json:"clusterDNSIPs,omitempty"`
	Taints                     map[string]string      `json:"taints,omitempty"`
	Labels                     map[string]string      `json:"labels,omitempty"`
	PrivilegedLabels           map[string]string      `json:"privilegedLabels,omitempty"`
	PrivilegedLabelsKubeconfig string                 `json:"privilegedLabelsKubeconfig,omitempty"`
	CgroupDriver               string                 `json:"cgroupDriver,omitempty"`
	NetworkPlugin              string                 `json:"networkPlugin,omitempty"`
	SystemReserved             map[string]string      `json:"systemReserved,omitempty"`
	KubeReserved               map[string]string      `json:"kubeReserved,omitempty"`
	HairpinMode                string                 `json:"hairpinMode,omitempty"`
	VolumePluginDir            string                 `json:"volumePluginDir,omitempty"`
	ExtraMounts                []containertypes.Mount `json:"extraMounts,omitempty"`

	// Serializable fields.
	State container.ContainersState `json:"state,omitempty"`
}

Pool represents group of kubelet instances and their configuration.

func (*Pool) New

func (p *Pool) New() (types.Resource, error)

New validates kubelet pool configuration and fills all members with configured values.

func (*Pool) Validate

func (p *Pool) Validate() error

Validate validates Pool configuration.

TODO add actual validation

Jump to

Keyboard shortcuts

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