Skip to content

Commit

Permalink
Remove proxy bind timeout from CLIs (#2017)
Browse files Browse the repository at this point in the history
This branch removes the `--proxy-bind-timeout` flag from the 
`linkerd inject` and `linkerd install` CLI commands, and the
`LINKERD2_PROXY_BIND_TIMEOUT` environment variable from their output.
This is in preparation for removing that timeout from the proxy (as
described in #2013). 

I thought it was prudent to remove this from the CLIs before removing it
from the proxy, so we can't create a situation where the CLIs produce
output that results in broken proxy containers.

Fixes #2013

Signed-off-by: Eliza Weisman <[email protected]>
  • Loading branch information
hawkw authored Jan 24, 2019
1 parent d542571 commit 846975a
Show file tree
Hide file tree
Showing 29 changed files with 20 additions and 129 deletions.
1 change: 0 additions & 1 deletion cli/cmd/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ func injectPodSpec(t *v1.PodSpec, identity k8s.TLSIdentity, controlPlaneDNSNameO
Resources: resources,
Env: []v1.EnvVar{
{Name: "LINKERD2_PROXY_LOG", Value: options.proxyLogLevel},
{Name: "LINKERD2_PROXY_BIND_TIMEOUT", Value: options.proxyBindTimeout},
{
Name: "LINKERD2_PROXY_CONTROL_URL",
Value: fmt.Sprintf("tcp://%s:%d", controlPlaneDNS, options.proxyAPIPort),
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ type installConfig struct {
ProxyImage string
ProxyResourceRequestCPU string
ProxyResourceRequestMemory string
ProxyBindTimeout string
SingleNamespace bool
EnableHA bool
ControllerUID int64
Expand Down Expand Up @@ -201,7 +200,6 @@ func validateAndBuildConfig(options *installOptions) (*installConfig, error) {
ProxyImage: options.taggedProxyImage(),
ProxyResourceRequestCPU: options.proxyCPURequest,
ProxyResourceRequestMemory: options.proxyMemoryRequest,
ProxyBindTimeout: "1m",
SingleNamespace: options.singleNamespace,
EnableHA: options.highAvailability,
ProfileSuffixes: profileSuffixes,
Expand Down
1 change: 0 additions & 1 deletion cli/cmd/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func TestRender(t *testing.T) {
IgnoreOutboundPorts: "2,3,4",
ProxyResourceRequestCPU: "RequestCPU",
ProxyResourceRequestMemory: "RequestMemory",
ProxyBindTimeout: "1m",
ProfileSuffixes: "suffix.",
EnableH2Upgrade: true,
}
Expand Down
43 changes: 18 additions & 25 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ type proxyConfigOptions struct {
ignoreOutboundPorts []uint
proxyUID int64
proxyLogLevel string
proxyBindTimeout string
proxyAPIPort uint
proxyControlPort uint
proxyMetricsPort uint
Expand All @@ -251,25 +250,24 @@ const (

func newProxyConfigOptions() *proxyConfigOptions {
return &proxyConfigOptions{
linkerdVersion: version.Version,
proxyImage: defaultDockerRegistry + "/proxy",
initImage: defaultDockerRegistry + "/proxy-init",
dockerRegistry: defaultDockerRegistry,
imagePullPolicy: "IfNotPresent",
inboundPort: 4143,
outboundPort: 4140,
ignoreInboundPorts: nil,
ignoreOutboundPorts: nil,
proxyUID: 2102,
proxyLogLevel: "warn,linkerd2_proxy=info",
proxyBindTimeout: "10s",
proxyAPIPort: 8086,
proxyControlPort: 4190,
proxyMetricsPort: 4191,
proxyOutboundCapacity: map[string]uint{},
proxyCPURequest: "",
proxyMemoryRequest: "",
tls: "",
linkerdVersion: version.Version,
proxyImage: defaultDockerRegistry + "/proxy",
initImage: defaultDockerRegistry + "/proxy-init",
dockerRegistry: defaultDockerRegistry,
imagePullPolicy: "IfNotPresent",
inboundPort: 4143,
outboundPort: 4140,
ignoreInboundPorts: nil,
ignoreOutboundPorts: nil,
proxyUID: 2102,
proxyLogLevel: "warn,linkerd2_proxy=info",
proxyAPIPort: 8086,
proxyControlPort: 4190,
proxyMetricsPort: 4191,
proxyOutboundCapacity: map[string]uint{},
proxyCPURequest: "",
proxyMemoryRequest: "",
tls: "",
disableExternalProfiles: false,
}
}
Expand All @@ -287,10 +285,6 @@ func (options *proxyConfigOptions) validate() error {
return fmt.Errorf("--image-pull-policy must be one of: Always, IfNotPresent, Never")
}

if _, err := time.ParseDuration(options.proxyBindTimeout); err != nil {
return fmt.Errorf("Invalid duration '%s' for --proxy-bind-timeout flag", options.proxyBindTimeout)
}

if options.proxyCPURequest != "" {
if _, err := k8sResource.ParseQuantity(options.proxyCPURequest); err != nil {
return fmt.Errorf("Invalid cpu request '%s' for --proxy-cpu flag", options.proxyCPURequest)
Expand Down Expand Up @@ -332,7 +326,6 @@ func addProxyConfigFlags(cmd *cobra.Command, options *proxyConfigOptions) {
cmd.PersistentFlags().StringVar(&options.imagePullPolicy, "image-pull-policy", options.imagePullPolicy, "Docker image pull policy")
cmd.PersistentFlags().Int64Var(&options.proxyUID, "proxy-uid", options.proxyUID, "Run the proxy under this user ID")
cmd.PersistentFlags().StringVar(&options.proxyLogLevel, "proxy-log-level", options.proxyLogLevel, "Log level for the proxy")
cmd.PersistentFlags().StringVar(&options.proxyBindTimeout, "proxy-bind-timeout", options.proxyBindTimeout, "Timeout the proxy will use")
cmd.PersistentFlags().UintVar(&options.inboundPort, "inbound-port", options.inboundPort, "Proxy port to use for inbound traffic")
cmd.PersistentFlags().UintVar(&options.outboundPort, "outbound-port", options.outboundPort, "Proxy port to use for outbound traffic")
cmd.PersistentFlags().UintVar(&options.proxyAPIPort, "api-port", options.proxyAPIPort, "Port where the Linkerd controller is running")
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/testdata/inject-filepath/expected/injected_nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -124,8 +122,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/testdata/inject-filepath/expected/injected_redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
8 changes: 0 additions & 8 deletions cli/cmd/testdata/inject_emojivoto_already_injected.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -146,8 +144,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -252,8 +248,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -358,8 +352,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/testdata/inject_emojivoto_deployment.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -146,8 +144,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/testdata/inject_emojivoto_deployment_tls.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/testdata/inject_emojivoto_deployment_udp.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
4 changes: 0 additions & 4 deletions cli/cmd/testdata/inject_emojivoto_list.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ items:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -142,8 +140,6 @@ items:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/testdata/inject_emojivoto_pod.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/testdata/inject_emojivoto_pod_tls.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/testdata/inject_emojivoto_statefulset.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
4 changes: 0 additions & 4 deletions cli/cmd/testdata/inject_gettest_deployment.good.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -150,8 +148,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
8 changes: 0 additions & 8 deletions cli/cmd/testdata/install_default.golden
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://localhost.:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -466,8 +464,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -609,8 +605,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -854,8 +848,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
8 changes: 0 additions & 8 deletions cli/cmd/testdata/install_ha_output.golden
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://localhost.:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -481,8 +479,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -630,8 +626,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down Expand Up @@ -881,8 +875,6 @@ spec:
- env:
- name: LINKERD2_PROXY_LOG
value: warn,linkerd2_proxy=info
- name: LINKERD2_PROXY_BIND_TIMEOUT
value: 10s
- name: LINKERD2_PROXY_CONTROL_URL
value: tcp://linkerd-proxy-api.linkerd.svc.cluster.local:8086
- name: LINKERD2_PROXY_CONTROL_LISTENER
Expand Down
Loading

0 comments on commit 846975a

Please sign in to comment.