kubernetes: k8s.io/kubernetes/cmd/kubeadm/app/componentconfigs Index | Files

package componentconfigs

import "k8s.io/kubernetes/cmd/kubeadm/app/componentconfigs"

Index

Package Files

config.go defaults.go registrations.go scheme.go validation.go

Variables

var Codecs = serializer.NewCodecFactory(Scheme)

Codecs provides access to encoding and decoding for the scheme.

var Scheme = runtime.NewScheme()

Scheme is the runtime.Scheme to which all supported kubeadm ComponentConfig API types are registered.

func AddToScheme Uses

func AddToScheme(scheme *runtime.Scheme)

AddToScheme builds the kubeadm ComponentConfig scheme using all known ComponentConfig versions.

func DefaultKubeProxyConfiguration Uses

func DefaultKubeProxyConfiguration(internalcfg *kubeadmapi.ClusterConfiguration)

DefaultKubeProxyConfiguration assigns default values for the kube-proxy ComponentConfig

func DefaultKubeletConfiguration Uses

func DefaultKubeletConfiguration(internalcfg *kubeadmapi.ClusterConfiguration)

DefaultKubeletConfiguration assigns default values for the kubelet ComponentConfig

func GetFromKubeProxyConfigMap Uses

func GetFromKubeProxyConfigMap(client clientset.Interface, version *version.Version) (runtime.Object, error)

GetFromKubeProxyConfigMap returns the pointer to the ComponentConfig API object read from the kube-proxy ConfigMap map stored in the cluster

func GetFromKubeletConfigMap Uses

func GetFromKubeletConfigMap(client clientset.Interface, version *version.Version) (runtime.Object, error)

GetFromKubeletConfigMap returns the pointer to the ComponentConfig API object read from the kubelet-config-version ConfigMap map stored in the cluster

func ValidateKubeProxyConfiguration Uses

func ValidateKubeProxyConfiguration(internalcfg *kubeadmapi.ClusterConfiguration, _ *field.Path) field.ErrorList

ValidateKubeProxyConfiguration validates proxy configuration and collects all encountered errors

func ValidateKubeletConfiguration Uses

func ValidateKubeletConfiguration(internalcfg *kubeadmapi.ClusterConfiguration, fldPath *field.Path) field.ErrorList

ValidateKubeletConfiguration validates kubelet configuration and collects all encountered errors

type AddToSchemeFunc Uses

type AddToSchemeFunc func(*runtime.Scheme) error

AddToSchemeFunc is a function that adds known types and API GroupVersions to a scheme

type Registration Uses

type Registration struct {
    // MarshalGroupVersion is the preferred external API version to use when marshalling the ComponentConfig
    MarshalGroupVersion schema.GroupVersion
    // AddToSchemeFuncs are a set of functions that register APIs to the scheme
    AddToSchemeFuncs []AddToSchemeFunc
    // DefaulterFunc is a function that based on the internal kubeadm configuration defaults the ComponentConfig struct
    DefaulterFunc func(*kubeadmapi.ClusterConfiguration)
    // ValidateFunc is a function that should validate the ComponentConfig type embedded in the internal kubeadm config struct
    ValidateFunc func(*kubeadmapi.ClusterConfiguration, *field.Path) field.ErrorList
    // EmptyValue holds a pointer to an empty struct of the internal ComponentConfig type
    EmptyValue runtime.Object
    // GetFromInternalConfig returns the pointer to the ComponentConfig API object from the internal kubeadm config struct
    GetFromInternalConfig func(*kubeadmapi.ClusterConfiguration) (runtime.Object, bool)
    // SetToInternalConfig sets the pointer to a ComponentConfig API object embedded in the internal kubeadm config struct
    SetToInternalConfig func(runtime.Object, *kubeadmapi.ClusterConfiguration) bool
    // GetFromConfigMap returns the pointer to the ComponentConfig API object read from the config map stored in the cluster
    GetFromConfigMap func(clientset.Interface, *version.Version) (runtime.Object, error)
}

Registration is an object for registering a Kubernetes ComponentConfig type to be recognized and handled by kubeadm

func (Registration) Marshal Uses

func (r Registration) Marshal(obj runtime.Object) ([]byte, error)

Marshal marshals obj to bytes for the current Registration

func (Registration) Unmarshal Uses

func (r Registration) Unmarshal(fileContent []byte) (runtime.Object, error)

Unmarshal unmarshals the bytes to a runtime.Object using the Codecs registered in this Scheme

type RegistrationKind Uses

type RegistrationKind string

RegistrationKind is a string type to ensure not any string can be a key in the Registrations map

const (
    // KubeletConfigurationKind is the kind for the kubelet ComponentConfig
    KubeletConfigurationKind RegistrationKind = "KubeletConfiguration"
    // KubeProxyConfigurationKind is the kind for the kubelet ComponentConfig
    KubeProxyConfigurationKind RegistrationKind = "KubeProxyConfiguration"
)

type Registrations Uses

type Registrations map[RegistrationKind]Registration

Registrations holds a set of ComponentConfig Registration objects, where the map key is the kind

var Known Registrations = map[RegistrationKind]Registration{
    KubeProxyConfigurationKind: {

        MarshalGroupVersion: kubeproxyconfigv1alpha1.SchemeGroupVersion,

        AddToSchemeFuncs: []AddToSchemeFunc{kubeproxyconfig.AddToScheme, kubeproxyconfigv1alpha1scheme.AddToScheme},
        DefaulterFunc:    DefaultKubeProxyConfiguration,
        ValidateFunc:     ValidateKubeProxyConfiguration,
        EmptyValue:       &kubeproxyconfig.KubeProxyConfiguration{},
        GetFromInternalConfig: func(cfg *kubeadmapi.ClusterConfiguration) (runtime.Object, bool) {
            return cfg.ComponentConfigs.KubeProxy, cfg.ComponentConfigs.KubeProxy != nil
        },
        SetToInternalConfig: func(obj runtime.Object, cfg *kubeadmapi.ClusterConfiguration) bool {
            kubeproxyConfig, ok := obj.(*kubeproxyconfig.KubeProxyConfiguration)
            if ok {
                cfg.ComponentConfigs.KubeProxy = kubeproxyConfig
            }
            return ok
        },
        GetFromConfigMap: GetFromKubeProxyConfigMap,
    },
    KubeletConfigurationKind: {
        MarshalGroupVersion: kubeletconfigv1beta1.SchemeGroupVersion,

        AddToSchemeFuncs: []AddToSchemeFunc{kubeletconfig.AddToScheme, kubeletconfigv1beta1scheme.AddToScheme},
        DefaulterFunc:    DefaultKubeletConfiguration,
        ValidateFunc:     ValidateKubeletConfiguration,
        EmptyValue:       &kubeletconfig.KubeletConfiguration{},
        GetFromInternalConfig: func(cfg *kubeadmapi.ClusterConfiguration) (runtime.Object, bool) {
            return cfg.ComponentConfigs.Kubelet, cfg.ComponentConfigs.Kubelet != nil
        },
        SetToInternalConfig: func(obj runtime.Object, cfg *kubeadmapi.ClusterConfiguration) bool {
            kubeletConfig, ok := obj.(*kubeletconfig.KubeletConfiguration)
            if ok {
                cfg.ComponentConfigs.Kubelet = kubeletConfig
            }
            return ok
        },
        GetFromConfigMap: GetFromKubeletConfigMap,
    },
}

Known contains the known ComponentConfig registrations to kubeadm

func (*Registrations) AddToScheme Uses

func (rs *Registrations) AddToScheme(scheme *runtime.Scheme) error

AddToScheme adds all the known ComponentConfig API types referenced in the Registrations object to the scheme

func (*Registrations) Default Uses

func (rs *Registrations) Default(internalcfg *kubeadmapi.ClusterConfiguration)

Default applies to the ComponentConfig defaults to the internal kubeadm API type

func (*Registrations) Validate Uses

func (rs *Registrations) Validate(internalcfg *kubeadmapi.ClusterConfiguration) field.ErrorList

Validate validates the ComponentConfig parts of the internal kubeadm API type

Package componentconfigs imports 27 packages (graph) and is imported by 21 packages. Updated 2019-10-07. Refresh now. Tools for package owners.