Skip to content

Commit

Permalink
Add ExtraDockerOptions in node configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
fllaca committed Dec 24, 2019
1 parent 03a4b51 commit 71973fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/apis/config/v1alpha4/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions pkg/cluster/internal/providers/docker/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions pkg/internal/apis/config/convert_v1alpha4.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 2 additions & 0 deletions pkg/internal/apis/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71973fe

Please sign in to comment.