Merge pull request #1574 from justinsb/lots_of_flags

Map a bunch of flags
This commit is contained in:
Kris Nova 2017-01-21 10:50:20 -07:00 committed by GitHub
commit 1b50cab930
7 changed files with 84 additions and 30 deletions

View File

@ -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.
@ -220,8 +214,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
@ -273,8 +269,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'.
@ -296,6 +294,19 @@ 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"`
// 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 {
@ -482,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"`

View File

@ -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"`

View File

@ -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.
@ -220,8 +213,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
@ -273,8 +268,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'.
@ -296,6 +293,19 @@ 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"`
// 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 {
@ -479,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"`

View File

@ -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"`

View File

@ -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
}

View File

@ -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"`
@ -91,10 +95,26 @@ 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).
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"`
// 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 {

View File

@ -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"`