Documentation
¶
Index ¶
- Constants
- 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 ValidateKubeProxyConfiguration(internalcfg *kubeadmapi.ClusterConfiguration, _ *field.Path) field.ErrorList
- func ValidateKubeletConfiguration(internalcfg *kubeadmapi.ClusterConfiguration, fldPath *field.Path) field.ErrorList
- type AddToSchemeFunc
- type Registration
- type RegistrationKind
- type Registrations
Constants ¶
const (
// KubeproxyKubeConfigFileName defines the file name for the kube-proxy's KubeConfig file
KubeproxyKubeConfigFileName = "/var/lib/kube-proxy/kubeconfig.conf"
)
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 ¶
func AddToScheme(scheme *runtime.Scheme)
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 ValidateKubeProxyConfiguration ¶
func ValidateKubeProxyConfiguration(internalcfg *kubeadmapi.ClusterConfiguration, _ *field.Path) field.ErrorList
ValidateKubeProxyConfiguration validates proxy configuration and collects all encountered errors
func ValidateKubeletConfiguration ¶
func ValidateKubeletConfiguration(internalcfg *kubeadmapi.ClusterConfiguration, fldPath *field.Path) field.ErrorList
ValidateKubeletConfiguration validates kubelet configuration and collects all encountered errors
Types ¶
type AddToSchemeFunc ¶
type AddToSchemeFunc func(*runtime.Scheme) error
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{kubeproxyconfig.AddToScheme, kubeproxyconfigv1alpha1.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, kubeletconfigv1beta1.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 ¶
func (rs *Registrations) AddToScheme(scheme *runtime.Scheme) error
AddToScheme adds all the known ComponentConfig API types referenced in the Registrations object to the scheme