Skip to content

Commit

Permalink
Merge pull request #5456 from mikesplain/configurable_conntrack
Browse files Browse the repository at this point in the history
Add configurable conntrack settings
  • Loading branch information
k8s-ci-robot authored Jul 19, 2018
2 parents 266b764 + 188824c commit 0e64d32
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 5 deletions.
6 changes: 5 additions & 1 deletion nodeup/pkg/model/kube_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,18 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) {
resourceLimits["memory"] = memoryLimit
}

if c.ConntrackMaxPerCore == nil {
defaultConntrackMaxPerCore := int32(131072)
c.ConntrackMaxPerCore = &defaultConntrackMaxPerCore
}

flags, err := flagbuilder.BuildFlagsList(c)
if err != nil {
return nil, fmt.Errorf("error building kubeproxy flags: %v", err)
}
image := c.Image

flags = append(flags, []string{
"--conntrack-max-per-core=131072",
"--kubeconfig=/var/lib/kube-proxy/kubeconfig",
"--oom-score-adj=-998",
`--resource-container=""`}...)
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ type KubeProxyConfig struct {
ProxyMode string `json:"proxyMode,omitempty" flag:"proxy-mode"`
// FeatureGates is a series of key pairs used to switch on features for the proxy
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
// Maximum number of NAT connections to track per CPU core (default: 131072)
ConntrackMaxPerCore *int32 `json:"conntrackMaxPerCore,omitempty" flag:"conntrack-max-per-core"`
// Minimum number of conntrack entries to allocate, regardless of conntrack-max-per-core
ConntrackMin *int32 `json:"conntrackMin,omitempty" flag:"conntrack-min"`
}

// KubeAPIServerConfig defines the configuration for the kube api
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/kops/v1alpha1/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ type KubeProxyConfig struct {
ProxyMode string `json:"proxyMode,omitempty" flag:"proxy-mode"`
// FeatureGates is a series of key pairs used to switch on features for the proxy
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
// Maximum number of NAT connections to track per CPU core (default: 131072)
ConntrackMaxPerCore *int32 `json:"conntrackMaxPerCore,omitempty" flag:"conntrack-max-per-core"`
// Minimum number of conntrack entries to allocate, regardless of conntrack-max-per-core
ConntrackMin *int32 `json:"conntrackMin,omitempty" flag:"conntrack-min"`
}

// KubeAPIServerConfig defines the configuration for the kube api
Expand Down
8 changes: 6 additions & 2 deletions pkg/apis/kops/v1alpha1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions pkg/apis/kops/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ type KubeProxyConfig struct {
ProxyMode string `json:"proxyMode,omitempty" flag:"proxy-mode"`
// FeatureGates is a series of key pairs used to switch on features for the proxy
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"`
// Maximum number of NAT connections to track per CPU core (default: 131072)
ConntrackMaxPerCore *int32 `json:"conntrackMaxPerCore,omitempty" flag:"conntrack-max-per-core"`
// Minimum number of conntrack entries to allocate, regardless of conntrack-max-per-core
ConntrackMin *int32 `json:"conntrackMin,omitempty" flag:"conntrack-min"`
}

// KubeAPIServerConfig defines the configuration for the kube api
Expand Down
8 changes: 6 additions & 2 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e64d32

Please sign in to comment.