Documentation ¶
Index ¶
- Variables
- func AddToScheme(scheme *runtime.Scheme)
- func DefaultKubeProxyConfiguration(internalcfg *kubeadmapi.ClusterConfiguration)
- func DefaultKubeletConfiguration(internalcfg *kubeadmapi.ClusterConfiguration)
- func GetFromKubeProxyConfigMap(client clientset.Interface, version *version.Version) (runtime.Object, error)
- func GetFromKubeletConfigMap(client clientset.Interface, version *version.Version) (runtime.Object, error)
- func NoValidator(component string) func(*kubeadmapi.ClusterConfiguration, *field.Path) field.ErrorList
- type AddToSchemeFunc
- type Registration
- type RegistrationKind
- type Registrations
Constants ¶
This section is empty.
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.
Functions ¶
func AddToScheme ¶
AddToScheme builds the kubeadm ComponentConfig scheme using all known ComponentConfig versions.
func DefaultKubeProxyConfiguration ¶
func DefaultKubeProxyConfiguration(internalcfg *kubeadmapi.ClusterConfiguration)
DefaultKubeProxyConfiguration assigns default values for the kube-proxy ComponentConfig
func DefaultKubeletConfiguration ¶
func DefaultKubeletConfiguration(internalcfg *kubeadmapi.ClusterConfiguration)
DefaultKubeletConfiguration assigns default values for the kubelet ComponentConfig
func GetFromKubeProxyConfigMap ¶
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 ¶
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 NoValidator ¶ added in v1.17.0
func NoValidator(component string) func(*kubeadmapi.ClusterConfiguration, *field.Path) field.ErrorList
NoValidator returns a dummy validator function when no validation method is available for the component
Types ¶
type AddToSchemeFunc ¶
AddToSchemeFunc is a function that adds known types and API GroupVersions to a scheme
type Registration ¶
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
type RegistrationKind ¶
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 ¶
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{kubeproxyconfigv1alpha1.AddToScheme}, DefaulterFunc: DefaultKubeProxyConfiguration, ValidateFunc: NoValidator("kube-proxy"), EmptyValue: &kubeproxyconfigv1alpha1.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.(*kubeproxyconfigv1alpha1.KubeProxyConfiguration) if ok { cfg.ComponentConfigs.KubeProxy = kubeproxyConfig } return ok }, GetFromConfigMap: GetFromKubeProxyConfigMap, }, KubeletConfigurationKind: { MarshalGroupVersion: kubeletconfigv1beta1.SchemeGroupVersion, AddToSchemeFuncs: []AddToSchemeFunc{kubeletconfigv1beta1.AddToScheme}, DefaulterFunc: DefaultKubeletConfiguration, ValidateFunc: NoValidator("kubelet"), EmptyValue: &kubeletconfigv1beta1.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.(*kubeletconfigv1beta1.KubeletConfiguration) if ok { cfg.ComponentConfigs.Kubelet = kubeletConfig } return ok }, GetFromConfigMap: GetFromKubeletConfigMap, }, }
Known contains the known ComponentConfig registrations to kubeadm
func (*Registrations) AddToScheme ¶
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 ¶
func (rs *Registrations) Default(internalcfg *kubeadmapi.ClusterConfiguration)
Default applies to the ComponentConfig defaults to the internal kubeadm API type
func (*Registrations) Validate ¶
func (rs *Registrations) Validate(internalcfg *kubeadmapi.ClusterConfiguration) field.ErrorList
Validate validates the ComponentConfig parts of the internal kubeadm API type