From db54ecf23de0de7ef15b4bd453365fa7290309f4 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Fri, 20 Jan 2017 11:46:06 -0500 Subject: [PATCH 1/6] Map enable-custom-metrics kubelet flag Fix #1467 --- pkg/apis/kops/componentconfig.go | 6 ++++-- pkg/apis/kops/v1alpha1/componentconfig.go | 6 ++++-- pkg/apis/kops/v1alpha2/componentconfig.go | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index 03d659f20d..f3d61a2b39 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -273,8 +273,10 @@ type KubeletConfigSpec struct { NodeLabels map[string]string `json:"nodeLabels,omitempty" flag:"node-labels"` // nonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade. NonMasqueradeCIDR string `json:"nonMasqueradeCIDR,omitempty" flag:"non-masquerade-cidr"` - //// enable gathering custom metrics. - //EnableCustomMetrics bool `json:"enableCustomMetrics"` + + // enable gathering custom metrics. + EnableCustomMetrics *bool `json:"enableCustomMetrics,omitempty" flag:"enable-custom-metrics"` + //// Comma-delimited list of hard eviction expressions. For example, 'memory.available<300Mi'. //EvictionHard string `json:"evictionHard,omitempty"` //// Comma-delimited list of soft eviction expressions. For example, 'memory.available<300Mi'. diff --git a/pkg/apis/kops/v1alpha1/componentconfig.go b/pkg/apis/kops/v1alpha1/componentconfig.go index 5c7434fa46..87a9f4980f 100644 --- a/pkg/apis/kops/v1alpha1/componentconfig.go +++ b/pkg/apis/kops/v1alpha1/componentconfig.go @@ -273,8 +273,10 @@ type KubeletConfigSpec struct { NodeLabels map[string]string `json:"nodeLabels,omitempty" flag:"node-labels"` // nonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade. NonMasqueradeCIDR string `json:"nonMasqueradeCIDR,omitempty" flag:"non-masquerade-cidr"` - //// enable gathering custom metrics. - //EnableCustomMetrics bool `json:"enableCustomMetrics"` + + // enable gathering custom metrics. + EnableCustomMetrics *bool `json:"enableCustomMetrics,omitempty" flag:"enable-custom-metrics"` + //// Comma-delimited list of hard eviction expressions. For example, 'memory.available<300Mi'. //EvictionHard string `json:"evictionHard,omitempty"` //// Comma-delimited list of soft eviction expressions. For example, 'memory.available<300Mi'. diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index 8284d24c9a..99ec11a76b 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -91,6 +91,9 @@ type KubeletConfigSpec struct { // nonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade. NonMasqueradeCIDR string `json:"nonMasqueradeCIDR,omitempty" flag:"non-masquerade-cidr"` + // enable gathering custom metrics. + EnableCustomMetrics *bool `json:"enableCustomMetrics,omitempty" flag:"enable-custom-metrics"` + // networkPluginMTU is the MTU to be passed to the network plugin, // and overrides the default MTU for cases where it cannot be automatically // computed (such as IPSEC). From 5a7ef0711bb38efb59f3bfb01899f8115f144007 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Fri, 20 Jan 2017 11:48:09 -0500 Subject: [PATCH 2/6] Max kubelet max-pods flag Fix #1445 --- pkg/apis/kops/componentconfig.go | 6 ++++-- pkg/apis/kops/v1alpha1/componentconfig.go | 6 ++++-- pkg/apis/kops/v1alpha2/componentconfig.go | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index f3d61a2b39..7bf282f764 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -220,8 +220,10 @@ type KubeletConfigSpec struct { HairpinMode string `json:"hairpinMode,omitempty" flag:"hairpin-mode"` // The node has babysitter process monitoring docker and kubelet. BabysitDaemons *bool `json:"babysitDaemons,omitempty" flag:"babysit-daemons"` - //// maxPods is the number of pods that can run on this Kubelet. - //MaxPods int32 `json:"maxPods"` + + // maxPods is the number of pods that can run on this Kubelet. + MaxPods *int32 `json:"maxPods,omitempty" flag:"max-pods"` + //// nvidiaGPUs is the number of NVIDIA GPU devices on this node. //NvidiaGPUs int32 `json:"nvidiaGPUs"` //// dockerExecHandlerName is the handler to use when executing a command diff --git a/pkg/apis/kops/v1alpha1/componentconfig.go b/pkg/apis/kops/v1alpha1/componentconfig.go index 87a9f4980f..205137e89a 100644 --- a/pkg/apis/kops/v1alpha1/componentconfig.go +++ b/pkg/apis/kops/v1alpha1/componentconfig.go @@ -220,8 +220,10 @@ type KubeletConfigSpec struct { HairpinMode string `json:"hairpinMode,omitempty" flag:"hairpin-mode"` // The node has babysitter process monitoring docker and kubelet. BabysitDaemons *bool `json:"babysitDaemons,omitempty" flag:"babysit-daemons"` - //// maxPods is the number of pods that can run on this Kubelet. - //MaxPods int32 `json:"maxPods"` + + // maxPods is the number of pods that can run on this Kubelet. + MaxPods *int32 `json:"maxPods,omitempty" flag:"max-pods"` + //// nvidiaGPUs is the number of NVIDIA GPU devices on this node. //NvidiaGPUs int32 `json:"nvidiaGPUs"` //// dockerExecHandlerName is the handler to use when executing a command diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index 99ec11a76b..b493bef115 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -77,6 +77,10 @@ type KubeletConfigSpec struct { HairpinMode string `json:"hairpinMode,omitempty" flag:"hairpin-mode"` // The node has babysitter process monitoring docker and kubelet. BabysitDaemons *bool `json:"babysitDaemons,omitempty" flag:"babysit-daemons"` + + // maxPods is the number of pods that can run on this Kubelet. + MaxPods *int32 `json:"maxPods,omitempty" flag:"max-pods"` + // The CIDR to use for pod IP addresses, only used in standalone mode. // In cluster mode, this is obtained from the master. PodCIDR string `json:"podCIDR,omitempty" flag:"pod-cidr"` From 98603bf6f092d832e9e668fa8967d1c6863cf3cc Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Fri, 20 Jan 2017 11:52:11 -0500 Subject: [PATCH 3/6] Map image-gc-high/low-threshold kubelet flags Fix #1243 --- pkg/apis/kops/componentconfig.go | 16 +++++++++------- pkg/apis/kops/v1alpha1/componentconfig.go | 15 ++++++++------- pkg/apis/kops/v1alpha2/componentconfig.go | 8 ++++++++ 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index 7bf282f764..25974026b2 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -149,13 +149,7 @@ type KubeletConfigSpec struct { //// minimumGCAge is the minimum age for a unused image before it is //// garbage collected. //ImageMinimumGCAge unversioned.Duration `json:"imageMinimumGCAge"` - //// imageGCHighThresholdPercent is the percent of disk usage after which - //// image garbage collection is always run. - //ImageGCHighThresholdPercent int32 `json:"imageGCHighThresholdPercent"` - //// imageGCLowThresholdPercent is the percent of disk usage before which - //// image garbage collection is never run. Lowest disk usage to garbage - //// collect to. - //ImageGCLowThresholdPercent int32 `json:"imageGCLowThresholdPercent"` + //// lowDiskSpaceThresholdMB is the absolute free disk space, in MB, to //// maintain. When disk space falls below this threshold, new pods would //// be rejected. @@ -300,6 +294,14 @@ type KubeletConfigSpec struct { // and overrides the default MTU for cases where it cannot be automatically // computed (such as IPSEC). NetworkPluginMTU *int32 `json:"networkPluginMTU,omitEmpty" flag:"network-plugin-mtu"` + + // imageGCHighThresholdPercent is the percent of disk usage after which + // image garbage collection is always run. + ImageGCHighThresholdPercent *int32 `json:"imageGCHighThresholdPercent,omitempty" flag:"image-gc-high-threshold"` + // imageGCLowThresholdPercent is the percent of disk usage before which + // image garbage collection is never run. Lowest disk usage to garbage + // collect to. + ImageGCLowThresholdPercent *int32 `json:"imageGCLowThresholdPercent,omitempty" flag:"image-gc-low-threshold"` } type KubeProxyConfig struct { diff --git a/pkg/apis/kops/v1alpha1/componentconfig.go b/pkg/apis/kops/v1alpha1/componentconfig.go index 205137e89a..e03cc7fc9c 100644 --- a/pkg/apis/kops/v1alpha1/componentconfig.go +++ b/pkg/apis/kops/v1alpha1/componentconfig.go @@ -149,13 +149,6 @@ type KubeletConfigSpec struct { //// minimumGCAge is the minimum age for a unused image before it is //// garbage collected. //ImageMinimumGCAge unversioned.Duration `json:"imageMinimumGCAge"` - //// imageGCHighThresholdPercent is the percent of disk usage after which - //// image garbage collection is always run. - //ImageGCHighThresholdPercent int32 `json:"imageGCHighThresholdPercent"` - //// imageGCLowThresholdPercent is the percent of disk usage before which - //// image garbage collection is never run. Lowest disk usage to garbage - //// collect to. - //ImageGCLowThresholdPercent int32 `json:"imageGCLowThresholdPercent"` //// lowDiskSpaceThresholdMB is the absolute free disk space, in MB, to //// maintain. When disk space falls below this threshold, new pods would //// be rejected. @@ -300,6 +293,14 @@ type KubeletConfigSpec struct { // and overrides the default MTU for cases where it cannot be automatically // computed (such as IPSEC). NetworkPluginMTU *int32 `json:"networkPluginMTU,omitEmpty" flag:"network-plugin-mtu"` + + // imageGCHighThresholdPercent is the percent of disk usage after which + // image garbage collection is always run. + ImageGCHighThresholdPercent *int32 `json:"imageGCHighThresholdPercent,omitempty" flag:"image-gc-high-threshold"` + // imageGCLowThresholdPercent is the percent of disk usage before which + // image garbage collection is never run. Lowest disk usage to garbage + // collect to. + ImageGCLowThresholdPercent *int32 `json:"imageGCLowThresholdPercent,omitempty" flag:"image-gc-low-threshold"` } type KubeProxyConfig struct { diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index b493bef115..0a22ae2cc2 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -102,6 +102,14 @@ type KubeletConfigSpec struct { // and overrides the default MTU for cases where it cannot be automatically // computed (such as IPSEC). NetworkPluginMTU *int32 `json:"networkPluginMTU,omitEmpty" flag:"network-plugin-mtu"` + + // imageGCHighThresholdPercent is the percent of disk usage after which + // image garbage collection is always run. + ImageGCHighThresholdPercent *int32 `json:"imageGCHighThresholdPercent,omitempty" flag:"image-gc-high-threshold"` + // imageGCLowThresholdPercent is the percent of disk usage before which + // image garbage collection is never run. Lowest disk usage to garbage + // collect to. + ImageGCLowThresholdPercent *int32 `json:"imageGCLowThresholdPercent,omitempty" flag:"image-gc-low-threshold"` } type KubeProxyConfig struct { From 5c177fb5e4aa184ad1f433e758ce0a39ca53b0af Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Fri, 20 Jan 2017 11:55:23 -0500 Subject: [PATCH 4/6] Map terminated-pod-gc-threshold flag Fix #998 --- pkg/apis/kops/componentconfig.go | 9 +++++---- pkg/apis/kops/v1alpha1/componentconfig.go | 9 +++++---- pkg/apis/kops/v1alpha2/componentconfig.go | 5 +++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index 25974026b2..53e140d980 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -302,6 +302,11 @@ type KubeletConfigSpec struct { // image garbage collection is never run. Lowest disk usage to garbage // collect to. ImageGCLowThresholdPercent *int32 `json:"imageGCLowThresholdPercent,omitempty" flag:"image-gc-low-threshold"` + + // terminatedPodGCThreshold is the number of terminated pods that can exist + // before the terminated pod garbage collector starts deleting terminated pods. + // If <= 0, the terminated pod garbage collector is disabled. + TerminatedPodGCThreshold *int32 `json:"terminatedPodGCThreshold,omitempty" flag:"terminated-pod-gc-threshold"` } type KubeProxyConfig struct { @@ -488,10 +493,6 @@ type KubeControllerManagerConfig struct { //// minResyncPeriod is the resync period in reflectors; will be random between //// minResyncPeriod and 2*minResyncPeriod. //MinResyncPeriod unversioned.Duration `json:"minResyncPeriod"` - //// terminatedPodGCThreshold is the number of terminated pods that can exist - //// before the terminated pod garbage collector starts deleting terminated pods. - //// If <= 0, the terminated pod garbage collector is disabled. - //TerminatedPodGCThreshold int32 `json:"terminatedPodGCThreshold"` //// horizontalPodAutoscalerSyncPeriod is the period for syncing the number of //// pods in horizontal pod autoscaler. //HorizontalPodAutoscalerSyncPeriod unversioned.Duration `json:"horizontalPodAutoscalerSyncPeriod"` diff --git a/pkg/apis/kops/v1alpha1/componentconfig.go b/pkg/apis/kops/v1alpha1/componentconfig.go index e03cc7fc9c..260ec06374 100644 --- a/pkg/apis/kops/v1alpha1/componentconfig.go +++ b/pkg/apis/kops/v1alpha1/componentconfig.go @@ -301,6 +301,11 @@ type KubeletConfigSpec struct { // image garbage collection is never run. Lowest disk usage to garbage // collect to. ImageGCLowThresholdPercent *int32 `json:"imageGCLowThresholdPercent,omitempty" flag:"image-gc-low-threshold"` + + // terminatedPodGCThreshold is the number of terminated pods that can exist + // before the terminated pod garbage collector starts deleting terminated pods. + // If <= 0, the terminated pod garbage collector is disabled. + TerminatedPodGCThreshold *int32 `json:"terminatedPodGCThreshold,omitempty" flag:"terminated-pod-gc-threshold"` } type KubeProxyConfig struct { @@ -484,10 +489,6 @@ type KubeControllerManagerConfig struct { //// minResyncPeriod is the resync period in reflectors; will be random between //// minResyncPeriod and 2*minResyncPeriod. //MinResyncPeriod unversioned.Duration `json:"minResyncPeriod"` - //// terminatedPodGCThreshold is the number of terminated pods that can exist - //// before the terminated pod garbage collector starts deleting terminated pods. - //// If <= 0, the terminated pod garbage collector is disabled. - //TerminatedPodGCThreshold int32 `json:"terminatedPodGCThreshold"` //// horizontalPodAutoscalerSyncPeriod is the period for syncing the number of //// pods in horizontal pod autoscaler. //HorizontalPodAutoscalerSyncPeriod unversioned.Duration `json:"horizontalPodAutoscalerSyncPeriod"` diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index 0a22ae2cc2..fce6369ca5 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -110,6 +110,11 @@ type KubeletConfigSpec struct { // image garbage collection is never run. Lowest disk usage to garbage // collect to. ImageGCLowThresholdPercent *int32 `json:"imageGCLowThresholdPercent,omitempty" flag:"image-gc-low-threshold"` + + // terminatedPodGCThreshold is the number of terminated pods that can exist + // before the terminated pod garbage collector starts deleting terminated pods. + // If <= 0, the terminated pod garbage collector is disabled. + TerminatedPodGCThreshold *int32 `json:"terminatedPodGCThreshold,omitempty" flag:"terminated-pod-gc-threshold"` } type KubeProxyConfig struct { From de884f4fb707ab469c350778c810e16c86f85e87 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Fri, 20 Jan 2017 12:31:11 -0500 Subject: [PATCH 5/6] Map docker --bip flag Fix #710 Fix #42 --- pkg/apis/kops/dockerconfig.go | 3 +++ pkg/apis/kops/v1alpha1/dockerconfig.go | 3 +++ pkg/apis/kops/v1alpha2/dockerconfig.go | 3 +++ 3 files changed, 9 insertions(+) diff --git a/pkg/apis/kops/dockerconfig.go b/pkg/apis/kops/dockerconfig.go index 64eceaf398..ccaaa360be 100644 --- a/pkg/apis/kops/dockerconfig.go +++ b/pkg/apis/kops/dockerconfig.go @@ -33,6 +33,9 @@ type DockerConfig struct { InsecureRegistry *string `json:"insecureRegistry,omitempty" flag:"insecure-registry"` MTU *int32 `json:"mtu,omitempty" flag:"mtu"` + // The bridge cidr (--bip) flag + BridgeIP *string `json:"bridgeIP,omitempty" flag:"bip"` + // The version of docker to install // Be careful if changing this; not all docker versions are validated, and they will break in bad ways. Version *string `json:"version,omitempty"` diff --git a/pkg/apis/kops/v1alpha1/dockerconfig.go b/pkg/apis/kops/v1alpha1/dockerconfig.go index d58730175c..218c166a69 100644 --- a/pkg/apis/kops/v1alpha1/dockerconfig.go +++ b/pkg/apis/kops/v1alpha1/dockerconfig.go @@ -29,6 +29,9 @@ type DockerConfig struct { InsecureRegistry *string `json:"insecureRegistry,omitempty" flag:"insecure-registry"` MTU *int32 `json:"mtu,omitempty" flag:"mtu"` + // The bridge cidr (--bip) flag + BridgeIP *string `json:"bridgeIP,omitempty" flag:"bip"` + // The version of docker to install // Be careful if changing this; not all docker versions are validated, and they will break in bad ways. Version *string `json:"version,omitempty"` diff --git a/pkg/apis/kops/v1alpha2/dockerconfig.go b/pkg/apis/kops/v1alpha2/dockerconfig.go index 0c199cb88d..e51e8a25db 100644 --- a/pkg/apis/kops/v1alpha2/dockerconfig.go +++ b/pkg/apis/kops/v1alpha2/dockerconfig.go @@ -29,6 +29,9 @@ type DockerConfig struct { InsecureRegistry *string `json:"insecureRegistry,omitempty" flag:"insecure-registry"` MTU *int32 `json:"mtu,omitempty" flag:"mtu"` + // The bridge cidr (--bip) flag + BridgeIP *string `json:"bridgeIP,omitempty" flag:"bip"` + // The version of docker to install // Be careful if changing this; not all docker versions are validated, and they will break in bad ways. Version *string `json:"version,omitempty"` From 01cd64d8001f1a8d04f46772b6ca6eebd60910e6 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Fri, 20 Jan 2017 12:32:13 -0500 Subject: [PATCH 6/6] apimachinery for the flags added --- pkg/apis/kops/v1alpha1/zz_generated.conversion.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/apis/kops/v1alpha1/zz_generated.conversion.go b/pkg/apis/kops/v1alpha1/zz_generated.conversion.go index 326712f07f..9775801be6 100644 --- a/pkg/apis/kops/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha1/zz_generated.conversion.go @@ -598,6 +598,7 @@ func autoConvert_v1alpha1_DockerConfig_To_kops_DockerConfig(in *DockerConfig, ou out.Storage = in.Storage out.InsecureRegistry = in.InsecureRegistry out.MTU = in.MTU + out.BridgeIP = in.BridgeIP out.Version = in.Version return nil } @@ -614,6 +615,7 @@ func autoConvert_kops_DockerConfig_To_v1alpha1_DockerConfig(in *kops.DockerConfi out.Storage = in.Storage out.InsecureRegistry = in.InsecureRegistry out.MTU = in.MTU + out.BridgeIP = in.BridgeIP out.Version = in.Version return nil } @@ -1168,12 +1170,17 @@ func autoConvert_v1alpha1_KubeletConfigSpec_To_kops_KubeletConfigSpec(in *Kubele out.ConfigureCBR0 = in.ConfigureCBR0 out.HairpinMode = in.HairpinMode out.BabysitDaemons = in.BabysitDaemons + out.MaxPods = in.MaxPods out.PodCIDR = in.PodCIDR out.ReconcileCIDR = in.ReconcileCIDR out.RegisterSchedulable = in.RegisterSchedulable out.NodeLabels = in.NodeLabels out.NonMasqueradeCIDR = in.NonMasqueradeCIDR + out.EnableCustomMetrics = in.EnableCustomMetrics out.NetworkPluginMTU = in.NetworkPluginMTU + out.ImageGCHighThresholdPercent = in.ImageGCHighThresholdPercent + out.ImageGCLowThresholdPercent = in.ImageGCLowThresholdPercent + out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold return nil } @@ -1199,12 +1206,17 @@ func autoConvert_kops_KubeletConfigSpec_To_v1alpha1_KubeletConfigSpec(in *kops.K out.ConfigureCBR0 = in.ConfigureCBR0 out.HairpinMode = in.HairpinMode out.BabysitDaemons = in.BabysitDaemons + out.MaxPods = in.MaxPods out.PodCIDR = in.PodCIDR out.ReconcileCIDR = in.ReconcileCIDR out.RegisterSchedulable = in.RegisterSchedulable out.NodeLabels = in.NodeLabels out.NonMasqueradeCIDR = in.NonMasqueradeCIDR + out.EnableCustomMetrics = in.EnableCustomMetrics out.NetworkPluginMTU = in.NetworkPluginMTU + out.ImageGCHighThresholdPercent = in.ImageGCHighThresholdPercent + out.ImageGCLowThresholdPercent = in.ImageGCLowThresholdPercent + out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold return nil }