diff --git a/pkg/apis/config/v1alpha4/types.go b/pkg/apis/config/v1alpha4/types.go index 232c61c1ec..d400c2c91b 100644 --- a/pkg/apis/config/v1alpha4/types.go +++ b/pkg/apis/config/v1alpha4/types.go @@ -100,6 +100,8 @@ type Node struct { // binded to a host Port ExtraPortMappings []PortMapping `yaml:"extraPortMappings,omitempty"` + ExtraDockerOptions []string `yaml:"extraDockerOptions,omitempty"` + // KubeadmConfigPatches are applied to the generated kubeadm config as // merge patches. The `kind` field must match the target object, and // if `apiVersion` is specified it will only be applied to matching objects. diff --git a/pkg/cluster/internal/providers/docker/provision.go b/pkg/cluster/internal/providers/docker/provision.go index 6177bee862..7c67317667 100644 --- a/pkg/cluster/internal/providers/docker/provision.go +++ b/pkg/cluster/internal/providers/docker/provision.go @@ -183,6 +183,7 @@ func runArgsForNode(node *config.Node, name string, args []string) []string { // convert mounts and port mappings to container run args args = append(args, generateMountBindings(node.ExtraMounts...)...) args = append(args, generatePortMappings(node.ExtraPortMappings...)...) + args = append(args, node.ExtraDockerOptions...) // finally, specify the image to run return append(args, node.Image) diff --git a/pkg/internal/apis/config/convert_v1alpha4.go b/pkg/internal/apis/config/convert_v1alpha4.go index 90eb28bf13..eeceb30c3a 100644 --- a/pkg/internal/apis/config/convert_v1alpha4.go +++ b/pkg/internal/apis/config/convert_v1alpha4.go @@ -48,6 +48,8 @@ func convertv1alpha4Node(in *v1alpha4.Node, out *Node) { out.Role = NodeRole(in.Role) out.Image = in.Image + out.ExtraDockerOptions = in.ExtraDockerOptions + out.KubeadmConfigPatches = in.KubeadmConfigPatches out.ExtraMounts = make([]Mount, len(in.ExtraMounts)) out.ExtraPortMappings = make([]PortMapping, len(in.ExtraPortMappings)) diff --git a/pkg/internal/apis/config/types.go b/pkg/internal/apis/config/types.go index b0b07e7436..9dec3a72c8 100644 --- a/pkg/internal/apis/config/types.go +++ b/pkg/internal/apis/config/types.go @@ -74,6 +74,8 @@ type Node struct { // binded to a host Port ExtraPortMappings []PortMapping + ExtraDockerOptions []string + // KubeadmConfigPatches are applied to the generated kubeadm config as // strategic merge patches to `kustomize build` internally // https://github.com/kubernetes/community/blob/a9cf5c8f3380bb52ebe57b1e2dbdec136d8dd484/contributors/devel/sig-api-machinery/strategic-merge-patch.md