func (k *Kubelet) New() (container.ResourceInstance, error) {
	if err := k.Validate(); err != nil {
		return nil, fmt.Errorf("validating kubelet configuration: %w", err)
	}
	nk := &kubelet{
		config: *k,
	}
	if nk.config.Image == "" {
		nk.config.Image = defaults.KubeletImage
	}
	return nk, nil
}
New validates Kubelet configuration and returns it's usable version.
package kubelet
import (
	"fmt"
	"path/filepath"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	kubeletconfig "k8s.io/kubelet/config/v1beta1"
	"sigs.k8s.io/yaml"
	"github.com/flexkube/libflexkube/internal/util"
	"github.com/flexkube/libflexkube/pkg/container"
	"github.com/flexkube/libflexkube/pkg/container/runtime/docker"
	containertypes "github.com/flexkube/libflexkube/pkg/container/types"
	"github.com/flexkube/libflexkube/pkg/defaults"
	"github.com/flexkube/libflexkube/pkg/host"
	"github.com/flexkube/libflexkube/pkg/kubernetes/client"
	"github.com/flexkube/libflexkube/pkg/types"
)
const (
	KubenetNetworkPlugin = "kubenet"
)
type Kubelet struct {
	Address string `json:"address,omitempty"`
	Image string `json:"image,omitempty"`
	Host host.Host `json:"host,omitempty"`
	BootstrapConfig *client.Config `json:"bootstrapConfig,omitempty"`
	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"`
	AdminConfig *client.Config `json:"adminConfig,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"`
	PodCIDR string `json:"podCIDR,omitempty"`
	WaitForNodeReady bool `json:"waitForNodeReady,omitempty"`
	ExtraArgs []string `json:"extraArgs,omitempty"`
}
type kubelet struct {
	config Kubelet
}