From 3740aa238a93b7023c8837f816719d5e5f7049f5 Mon Sep 17 00:00:00 2001 From: Aditya Sharma Date: Wed, 6 Mar 2019 18:54:12 -0500 Subject: [PATCH] Remove `--api-port` flag from the cli (#2429) * Changed the protobuf definition to take out destinationApiPort entirely * Store destinationAPIPort as a constant in pkg/inject.go Fixes #2351 Signed-off-by: Aditya Sharma --- chart/templates/controller.yaml | 8 +- cli/cmd/inject.go | 1 - cli/cmd/install.go | 5 - cli/cmd/install_test.go | 2 - cli/cmd/root.go | 4 - cli/cmd/testdata/install_default.golden | 2 +- cli/cmd/testdata/install_ha_output.golden | 2 +- .../install_ha_with_overrides_output.golden | 2 +- .../testdata/install_no_init_container.golden | 2 +- ...stall_no_init_container_auto_inject.golden | 2 +- cli/cmd/testdata/install_output.golden | 8 +- .../install_single_namespace_output.golden | 8 +- controller/gen/config/config.pb.go | 129 ++++++++---------- controller/proxy-injector/webhook_test.go | 1 - pkg/inject/inject.go | 4 +- proto/config/config.proto | 21 ++- 16 files changed, 90 insertions(+), 111 deletions(-) diff --git a/chart/templates/controller.yaml b/chart/templates/controller.yaml index 258336e25..e28b1c98c 100644 --- a/chart/templates/controller.yaml +++ b/chart/templates/controller.yaml @@ -86,8 +86,8 @@ spec: {{.Values.ControllerComponentLabel}}: controller ports: - name: grpc - port: {{.Values.DestinationAPIPort}} - targetPort: {{.Values.DestinationAPIPort}} + port: 8086 + targetPort: 8086 --- kind: Deployment apiVersion: extensions/v1beta1 @@ -143,14 +143,14 @@ spec: - name: destination ports: - name: grpc - containerPort: {{.Values.DestinationAPIPort}} + containerPort: 8086 - name: admin-http containerPort: 9996 image: {{.Values.ControllerImage}} imagePullPolicy: {{.Values.ImagePullPolicy}} args: - "destination" - - "-addr=:{{.Values.DestinationAPIPort}}" + - "-addr=:8086" - "-controller-namespace={{.Values.Namespace}}" - "-enable-tls={{.Values.EnableTLS}}" - "-enable-h2-upgrade={{.Values.EnableH2Upgrade}}" diff --git a/cli/cmd/inject.go b/cli/cmd/inject.go index dd9d7de9e..d37149b5a 100644 --- a/cli/cmd/inject.go +++ b/cli/cmd/inject.go @@ -278,7 +278,6 @@ func injectOptionsToConfigs(options *injectOptions) configs { ImageName: registryOverride(options.initImage, options.dockerRegistry), PullPolicy: options.imagePullPolicy, }, - DestinationApiPort: &config.Port{Port: uint32(options.destinationAPIPort)}, ControlPort: &config.Port{Port: uint32(options.proxyControlPort)}, IgnoreInboundPorts: ignoreInboundPorts, IgnoreOutboundPorts: ignoreOutboundPorts, diff --git a/cli/cmd/install.go b/cli/cmd/install.go index 5003a9e3e..aae77e17e 100644 --- a/cli/cmd/install.go +++ b/cli/cmd/install.go @@ -37,7 +37,6 @@ type installConfig struct { ControllerLogLevel string ControllerComponentLabel string CreatedByAnnotation string - DestinationAPIPort uint EnableTLS bool TLSTrustAnchorConfigMapName string ProxyContainerName string @@ -170,7 +169,6 @@ func validateAndBuildConfig(options *installOptions) (*installConfig, error) { ControllerComponentLabel: k8s.ControllerComponentLabel, ControllerUID: options.controllerUID, CreatedByAnnotation: k8s.CreatedByAnnotation, - DestinationAPIPort: options.destinationAPIPort, EnableTLS: options.enableTLS(), TLSTrustAnchorConfigMapName: k8s.TLSTrustAnchorConfigMapName, ProxyContainerName: k8s.ProxyContainerName, @@ -326,9 +324,6 @@ func proxyConfig(options *installOptions) *config.Proxy { ImageName: registryOverride(options.initImage, options.dockerRegistry), PullPolicy: options.imagePullPolicy, }, - DestinationApiPort: &config.Port{ - Port: uint32(options.destinationAPIPort), - }, ControlPort: &config.Port{ Port: uint32(options.proxyControlPort), }, diff --git a/cli/cmd/install_test.go b/cli/cmd/install_test.go index 62d2890ac..3e014a783 100644 --- a/cli/cmd/install_test.go +++ b/cli/cmd/install_test.go @@ -36,7 +36,6 @@ func TestRender(t *testing.T) { ControllerLogLevel: "ControllerLogLevel", ControllerComponentLabel: "ControllerComponentLabel", CreatedByAnnotation: "CreatedByAnnotation", - DestinationAPIPort: 123, EnableTLS: true, TLSTrustAnchorConfigMapName: "TLSTrustAnchorConfigMapName", ProxyContainerName: "ProxyContainerName", @@ -66,7 +65,6 @@ func TestRender(t *testing.T) { ControllerLogLevel: "ControllerLogLevel", ControllerComponentLabel: "ControllerComponentLabel", CreatedByAnnotation: "CreatedByAnnotation", - DestinationAPIPort: 123, ControllerUID: 2103, EnableTLS: true, TLSTrustAnchorConfigMapName: "TLSTrustAnchorConfigMapName", diff --git a/cli/cmd/root.go b/cli/cmd/root.go index 1348b0c64..9395ac3a0 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -256,7 +256,6 @@ type proxyConfigOptions struct { ignoreOutboundPorts []uint proxyUID int64 proxyLogLevel string - destinationAPIPort uint proxyControlPort uint proxyMetricsPort uint proxyCPURequest string @@ -287,7 +286,6 @@ func newProxyConfigOptions() *proxyConfigOptions { ignoreOutboundPorts: nil, proxyUID: 2102, proxyLogLevel: "warn,linkerd2_proxy=info", - destinationAPIPort: 8086, proxyControlPort: 4190, proxyMetricsPort: 4191, proxyCPURequest: "", @@ -310,7 +308,6 @@ func newConfig() configs { proxyConfig := &config.Proxy{ ProxyImage: &config.Image{ImageName: defaultDockerRegistry + "/proxy", PullPolicy: "IfNotPresent"}, ProxyInitImage: &config.Image{ImageName: defaultDockerRegistry + "/proxy-init", PullPolicy: "IfNotPresent"}, - DestinationApiPort: &config.Port{Port: 8086}, ControlPort: &config.Port{Port: 4190}, IgnoreInboundPorts: nil, IgnoreOutboundPorts: nil, @@ -413,7 +410,6 @@ func addProxyConfigFlags(cmd *cobra.Command, options *proxyConfigOptions) { cmd.PersistentFlags().UintSliceVar(&options.ignoreOutboundPorts, "skip-outbound-ports", options.ignoreOutboundPorts, "Outbound ports that should skip the proxy") 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().UintVar(&options.destinationAPIPort, "api-port", options.destinationAPIPort, "Port where the Linkerd controller's destination API is running") cmd.PersistentFlags().UintVar(&options.proxyControlPort, "control-port", options.proxyControlPort, "Proxy port to use for control") cmd.PersistentFlags().UintVar(&options.proxyMetricsPort, "metrics-port", options.proxyMetricsPort, "Proxy port to serve metrics on") cmd.PersistentFlags().StringVar(&options.proxyCPURequest, "proxy-cpu-request", options.proxyCPURequest, "Amount of CPU units that the proxy sidecar requests") diff --git a/cli/cmd/testdata/install_default.golden b/cli/cmd/testdata/install_default.golden index 494ad52a2..d5f41b9df 100644 --- a/cli/cmd/testdata/install_default.golden +++ b/cli/cmd/testdata/install_default.golden @@ -273,7 +273,7 @@ data: global: | {"linkerdNamespace":"linkerd","cniEnabled":false,"version":"dev-undefined","identityContext":null} proxy: | - {"proxyImage":{"imageName":"gcr.io/linkerd-io/proxy","pullPolicy":"IfNotPresent"},"proxyInitImage":{"imageName":"gcr.io/linkerd-io/proxy-init","pullPolicy":"IfNotPresent"},"destinationApiPort":{"port":8086},"controlPort":{"port":4190},"ignoreInboundPorts":[],"ignoreOutboundPorts":[],"inboundPort":{"port":4143},"metricsPort":{"port":4191},"outboundPort":{"port":4140},"resource":{"requestCpu":"","requestMemory":"","limitCpu":"","limitMemory":""},"proxyUid":"2102","logLevel":{"level":"warn,linkerd2_proxy=info"},"disableExternalProfiles":false} + {"proxyImage":{"imageName":"gcr.io/linkerd-io/proxy","pullPolicy":"IfNotPresent"},"proxyInitImage":{"imageName":"gcr.io/linkerd-io/proxy-init","pullPolicy":"IfNotPresent"},"controlPort":{"port":4190},"ignoreInboundPorts":[],"ignoreOutboundPorts":[],"inboundPort":{"port":4143},"metricsPort":{"port":4191},"outboundPort":{"port":4140},"resource":{"requestCpu":"","requestMemory":"","limitCpu":"","limitMemory":""},"proxyUid":"2102","logLevel":{"level":"warn,linkerd2_proxy=info"},"disableExternalProfiles":false} --- ### diff --git a/cli/cmd/testdata/install_ha_output.golden b/cli/cmd/testdata/install_ha_output.golden index c62658bce..0afd3e467 100644 --- a/cli/cmd/testdata/install_ha_output.golden +++ b/cli/cmd/testdata/install_ha_output.golden @@ -285,7 +285,7 @@ data: global: | {"linkerdNamespace":"linkerd","cniEnabled":false,"version":"dev-undefined","identityContext":null} proxy: | - {"proxyImage":{"imageName":"gcr.io/linkerd-io/proxy","pullPolicy":"IfNotPresent"},"proxyInitImage":{"imageName":"gcr.io/linkerd-io/proxy-init","pullPolicy":"IfNotPresent"},"destinationApiPort":{"port":8086},"controlPort":{"port":4190},"ignoreInboundPorts":[],"ignoreOutboundPorts":[],"inboundPort":{"port":4143},"metricsPort":{"port":4191},"outboundPort":{"port":4140},"resource":{"requestCpu":"10m","requestMemory":"20Mi","limitCpu":"","limitMemory":""},"proxyUid":"2102","logLevel":{"level":"warn,linkerd2_proxy=info"},"disableExternalProfiles":false} + {"proxyImage":{"imageName":"gcr.io/linkerd-io/proxy","pullPolicy":"IfNotPresent"},"proxyInitImage":{"imageName":"gcr.io/linkerd-io/proxy-init","pullPolicy":"IfNotPresent"},"controlPort":{"port":4190},"ignoreInboundPorts":[],"ignoreOutboundPorts":[],"inboundPort":{"port":4143},"metricsPort":{"port":4191},"outboundPort":{"port":4140},"resource":{"requestCpu":"10m","requestMemory":"20Mi","limitCpu":"","limitMemory":""},"proxyUid":"2102","logLevel":{"level":"warn,linkerd2_proxy=info"},"disableExternalProfiles":false} --- ### diff --git a/cli/cmd/testdata/install_ha_with_overrides_output.golden b/cli/cmd/testdata/install_ha_with_overrides_output.golden index caa031901..2c5c10719 100644 --- a/cli/cmd/testdata/install_ha_with_overrides_output.golden +++ b/cli/cmd/testdata/install_ha_with_overrides_output.golden @@ -285,7 +285,7 @@ data: global: | {"linkerdNamespace":"linkerd","cniEnabled":false,"version":"dev-undefined","identityContext":null} proxy: | - {"proxyImage":{"imageName":"gcr.io/linkerd-io/proxy","pullPolicy":"IfNotPresent"},"proxyInitImage":{"imageName":"gcr.io/linkerd-io/proxy-init","pullPolicy":"IfNotPresent"},"destinationApiPort":{"port":8086},"controlPort":{"port":4190},"ignoreInboundPorts":[],"ignoreOutboundPorts":[],"inboundPort":{"port":4143},"metricsPort":{"port":4191},"outboundPort":{"port":4140},"resource":{"requestCpu":"400m","requestMemory":"300Mi","limitCpu":"","limitMemory":""},"proxyUid":"2102","logLevel":{"level":"warn,linkerd2_proxy=info"},"disableExternalProfiles":false} + {"proxyImage":{"imageName":"gcr.io/linkerd-io/proxy","pullPolicy":"IfNotPresent"},"proxyInitImage":{"imageName":"gcr.io/linkerd-io/proxy-init","pullPolicy":"IfNotPresent"},"controlPort":{"port":4190},"ignoreInboundPorts":[],"ignoreOutboundPorts":[],"inboundPort":{"port":4143},"metricsPort":{"port":4191},"outboundPort":{"port":4140},"resource":{"requestCpu":"400m","requestMemory":"300Mi","limitCpu":"","limitMemory":""},"proxyUid":"2102","logLevel":{"level":"warn,linkerd2_proxy=info"},"disableExternalProfiles":false} --- ### diff --git a/cli/cmd/testdata/install_no_init_container.golden b/cli/cmd/testdata/install_no_init_container.golden index a02eba833..427889bee 100644 --- a/cli/cmd/testdata/install_no_init_container.golden +++ b/cli/cmd/testdata/install_no_init_container.golden @@ -249,7 +249,7 @@ data: global: | {"linkerdNamespace":"linkerd","cniEnabled":true,"version":"dev-undefined","identityContext":null} proxy: | - {"proxyImage":{"imageName":"gcr.io/linkerd-io/proxy","pullPolicy":"IfNotPresent"},"proxyInitImage":{"imageName":"gcr.io/linkerd-io/proxy-init","pullPolicy":"IfNotPresent"},"destinationApiPort":{"port":8086},"controlPort":{"port":4190},"ignoreInboundPorts":[],"ignoreOutboundPorts":[],"inboundPort":{"port":4143},"metricsPort":{"port":4191},"outboundPort":{"port":4140},"resource":{"requestCpu":"","requestMemory":"","limitCpu":"","limitMemory":""},"proxyUid":"2102","logLevel":{"level":"warn,linkerd2_proxy=info"},"disableExternalProfiles":false} + {"proxyImage":{"imageName":"gcr.io/linkerd-io/proxy","pullPolicy":"IfNotPresent"},"proxyInitImage":{"imageName":"gcr.io/linkerd-io/proxy-init","pullPolicy":"IfNotPresent"},"controlPort":{"port":4190},"ignoreInboundPorts":[],"ignoreOutboundPorts":[],"inboundPort":{"port":4143},"metricsPort":{"port":4191},"outboundPort":{"port":4140},"resource":{"requestCpu":"","requestMemory":"","limitCpu":"","limitMemory":""},"proxyUid":"2102","logLevel":{"level":"warn,linkerd2_proxy=info"},"disableExternalProfiles":false} --- ### diff --git a/cli/cmd/testdata/install_no_init_container_auto_inject.golden b/cli/cmd/testdata/install_no_init_container_auto_inject.golden index bc2b8e653..856c85595 100644 --- a/cli/cmd/testdata/install_no_init_container_auto_inject.golden +++ b/cli/cmd/testdata/install_no_init_container_auto_inject.golden @@ -279,7 +279,7 @@ data: global: | {"linkerdNamespace":"linkerd","cniEnabled":true,"version":"dev-undefined","identityContext":{}} proxy: | - {"proxyImage":{"imageName":"gcr.io/linkerd-io/proxy","pullPolicy":"IfNotPresent"},"proxyInitImage":{"imageName":"gcr.io/linkerd-io/proxy-init","pullPolicy":"IfNotPresent"},"destinationApiPort":{"port":8086},"controlPort":{"port":4190},"ignoreInboundPorts":[],"ignoreOutboundPorts":[],"inboundPort":{"port":4143},"metricsPort":{"port":4191},"outboundPort":{"port":4140},"resource":{"requestCpu":"","requestMemory":"","limitCpu":"","limitMemory":""},"proxyUid":"2102","logLevel":{"level":"warn,linkerd2_proxy=info"},"disableExternalProfiles":false} + {"proxyImage":{"imageName":"gcr.io/linkerd-io/proxy","pullPolicy":"IfNotPresent"},"proxyInitImage":{"imageName":"gcr.io/linkerd-io/proxy-init","pullPolicy":"IfNotPresent"},"controlPort":{"port":4190},"ignoreInboundPorts":[],"ignoreOutboundPorts":[],"inboundPort":{"port":4143},"metricsPort":{"port":4191},"outboundPort":{"port":4140},"resource":{"requestCpu":"","requestMemory":"","limitCpu":"","limitMemory":""},"proxyUid":"2102","logLevel":{"level":"warn,linkerd2_proxy=info"},"disableExternalProfiles":false} --- ### diff --git a/cli/cmd/testdata/install_output.golden b/cli/cmd/testdata/install_output.golden index 93e8f3a85..7cb0fd2e0 100644 --- a/cli/cmd/testdata/install_output.golden +++ b/cli/cmd/testdata/install_output.golden @@ -80,8 +80,8 @@ spec: ControllerComponentLabel: controller ports: - name: grpc - port: 123 - targetPort: 123 + port: 8086 + targetPort: 8086 --- apiVersion: extensions/v1beta1 kind: Deployment @@ -138,7 +138,7 @@ spec: runAsUser: 2103 - args: - destination - - -addr=:123 + - -addr=:8086 - -controller-namespace=Namespace - -enable-tls=true - -enable-h2-upgrade=true @@ -152,7 +152,7 @@ spec: initialDelaySeconds: 10 name: destination ports: - - containerPort: 123 + - containerPort: 8086 name: grpc - containerPort: 9996 name: admin-http diff --git a/cli/cmd/testdata/install_single_namespace_output.golden b/cli/cmd/testdata/install_single_namespace_output.golden index 2c1e3afc0..03f29e4ae 100644 --- a/cli/cmd/testdata/install_single_namespace_output.golden +++ b/cli/cmd/testdata/install_single_namespace_output.golden @@ -76,8 +76,8 @@ spec: ControllerComponentLabel: controller ports: - name: grpc - port: 123 - targetPort: 123 + port: 8086 + targetPort: 8086 --- apiVersion: extensions/v1beta1 kind: Deployment @@ -134,7 +134,7 @@ spec: runAsUser: 2103 - args: - destination - - -addr=:123 + - -addr=:8086 - -controller-namespace=Namespace - -enable-tls=true - -enable-h2-upgrade=true @@ -148,7 +148,7 @@ spec: initialDelaySeconds: 10 name: destination ports: - - containerPort: 123 + - containerPort: 8086 name: grpc - containerPort: 9996 name: admin-http diff --git a/controller/gen/config/config.pb.go b/controller/gen/config/config.pb.go index a699108b5..f879a9ad4 100644 --- a/controller/gen/config/config.pb.go +++ b/controller/gen/config/config.pb.go @@ -35,7 +35,7 @@ func (m *Global) Reset() { *m = Global{} } func (m *Global) String() string { return proto.CompactTextString(m) } func (*Global) ProtoMessage() {} func (*Global) Descriptor() ([]byte, []int) { - return fileDescriptor_config_258e78b4e2a10c28, []int{0} + return fileDescriptor_config_433876e2a8cfc063, []int{0} } func (m *Global) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Global.Unmarshal(m, b) @@ -86,17 +86,16 @@ func (m *Global) GetIdentityContext() *IdentityContext { type Proxy struct { ProxyImage *Image `protobuf:"bytes,1,opt,name=proxy_image,json=proxyImage,proto3" json:"proxy_image,omitempty"` ProxyInitImage *Image `protobuf:"bytes,2,opt,name=proxy_init_image,json=proxyInitImage,proto3" json:"proxy_init_image,omitempty"` - DestinationApiPort *Port `protobuf:"bytes,3,opt,name=destination_api_port,json=destinationApiPort,proto3" json:"destination_api_port,omitempty"` - ControlPort *Port `protobuf:"bytes,4,opt,name=control_port,json=controlPort,proto3" json:"control_port,omitempty"` - IgnoreInboundPorts []*Port `protobuf:"bytes,5,rep,name=ignore_inbound_ports,json=ignoreInboundPorts,proto3" json:"ignore_inbound_ports,omitempty"` - IgnoreOutboundPorts []*Port `protobuf:"bytes,6,rep,name=ignore_outbound_ports,json=ignoreOutboundPorts,proto3" json:"ignore_outbound_ports,omitempty"` - InboundPort *Port `protobuf:"bytes,7,opt,name=inbound_port,json=inboundPort,proto3" json:"inbound_port,omitempty"` - MetricsPort *Port `protobuf:"bytes,8,opt,name=metrics_port,json=metricsPort,proto3" json:"metrics_port,omitempty"` - OutboundPort *Port `protobuf:"bytes,9,opt,name=outbound_port,json=outboundPort,proto3" json:"outbound_port,omitempty"` - Resource *ResourceRequirements `protobuf:"bytes,10,opt,name=resource,proto3" json:"resource,omitempty"` - ProxyUid int64 `protobuf:"varint,11,opt,name=proxy_uid,json=proxyUid,proto3" json:"proxy_uid,omitempty"` - LogLevel *LogLevel `protobuf:"bytes,12,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"` - DisableExternalProfiles bool `protobuf:"varint,13,opt,name=disable_external_profiles,json=disableExternalProfiles,proto3" json:"disable_external_profiles,omitempty"` + ControlPort *Port `protobuf:"bytes,3,opt,name=control_port,json=controlPort,proto3" json:"control_port,omitempty"` + IgnoreInboundPorts []*Port `protobuf:"bytes,4,rep,name=ignore_inbound_ports,json=ignoreInboundPorts,proto3" json:"ignore_inbound_ports,omitempty"` + IgnoreOutboundPorts []*Port `protobuf:"bytes,5,rep,name=ignore_outbound_ports,json=ignoreOutboundPorts,proto3" json:"ignore_outbound_ports,omitempty"` + InboundPort *Port `protobuf:"bytes,6,opt,name=inbound_port,json=inboundPort,proto3" json:"inbound_port,omitempty"` + MetricsPort *Port `protobuf:"bytes,7,opt,name=metrics_port,json=metricsPort,proto3" json:"metrics_port,omitempty"` + OutboundPort *Port `protobuf:"bytes,8,opt,name=outbound_port,json=outboundPort,proto3" json:"outbound_port,omitempty"` + Resource *ResourceRequirements `protobuf:"bytes,9,opt,name=resource,proto3" json:"resource,omitempty"` + ProxyUid int64 `protobuf:"varint,10,opt,name=proxy_uid,json=proxyUid,proto3" json:"proxy_uid,omitempty"` + LogLevel *LogLevel `protobuf:"bytes,11,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"` + DisableExternalProfiles bool `protobuf:"varint,12,opt,name=disable_external_profiles,json=disableExternalProfiles,proto3" json:"disable_external_profiles,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -106,7 +105,7 @@ func (m *Proxy) Reset() { *m = Proxy{} } func (m *Proxy) String() string { return proto.CompactTextString(m) } func (*Proxy) ProtoMessage() {} func (*Proxy) Descriptor() ([]byte, []int) { - return fileDescriptor_config_258e78b4e2a10c28, []int{1} + return fileDescriptor_config_433876e2a8cfc063, []int{1} } func (m *Proxy) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Proxy.Unmarshal(m, b) @@ -140,13 +139,6 @@ func (m *Proxy) GetProxyInitImage() *Image { return nil } -func (m *Proxy) GetDestinationApiPort() *Port { - if m != nil { - return m.DestinationApiPort - } - return nil -} - func (m *Proxy) GetControlPort() *Port { if m != nil { return m.ControlPort @@ -229,7 +221,7 @@ func (m *Image) Reset() { *m = Image{} } func (m *Image) String() string { return proto.CompactTextString(m) } func (*Image) ProtoMessage() {} func (*Image) Descriptor() ([]byte, []int) { - return fileDescriptor_config_258e78b4e2a10c28, []int{2} + return fileDescriptor_config_433876e2a8cfc063, []int{2} } func (m *Image) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Image.Unmarshal(m, b) @@ -274,7 +266,7 @@ func (m *Port) Reset() { *m = Port{} } func (m *Port) String() string { return proto.CompactTextString(m) } func (*Port) ProtoMessage() {} func (*Port) Descriptor() ([]byte, []int) { - return fileDescriptor_config_258e78b4e2a10c28, []int{3} + return fileDescriptor_config_433876e2a8cfc063, []int{3} } func (m *Port) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Port.Unmarshal(m, b) @@ -315,7 +307,7 @@ func (m *ResourceRequirements) Reset() { *m = ResourceRequirements{} } func (m *ResourceRequirements) String() string { return proto.CompactTextString(m) } func (*ResourceRequirements) ProtoMessage() {} func (*ResourceRequirements) Descriptor() ([]byte, []int) { - return fileDescriptor_config_258e78b4e2a10c28, []int{4} + return fileDescriptor_config_433876e2a8cfc063, []int{4} } func (m *ResourceRequirements) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResourceRequirements.Unmarshal(m, b) @@ -373,7 +365,7 @@ func (m *IdentityContext) Reset() { *m = IdentityContext{} } func (m *IdentityContext) String() string { return proto.CompactTextString(m) } func (*IdentityContext) ProtoMessage() {} func (*IdentityContext) Descriptor() ([]byte, []int) { - return fileDescriptor_config_258e78b4e2a10c28, []int{5} + return fileDescriptor_config_433876e2a8cfc063, []int{5} } func (m *IdentityContext) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IdentityContext.Unmarshal(m, b) @@ -404,7 +396,7 @@ func (m *LogLevel) Reset() { *m = LogLevel{} } func (m *LogLevel) String() string { return proto.CompactTextString(m) } func (*LogLevel) ProtoMessage() {} func (*LogLevel) Descriptor() ([]byte, []int) { - return fileDescriptor_config_258e78b4e2a10c28, []int{6} + return fileDescriptor_config_433876e2a8cfc063, []int{6} } func (m *LogLevel) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LogLevel.Unmarshal(m, b) @@ -441,49 +433,48 @@ func init() { proto.RegisterType((*LogLevel)(nil), "linkerd2.config.LogLevel") } -func init() { proto.RegisterFile("config/config.proto", fileDescriptor_config_258e78b4e2a10c28) } +func init() { proto.RegisterFile("config/config.proto", fileDescriptor_config_433876e2a8cfc063) } -var fileDescriptor_config_258e78b4e2a10c28 = []byte{ - // 654 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0x6d, 0x6f, 0xd3, 0x30, - 0x10, 0xc7, 0xd5, 0xad, 0xed, 0xda, 0x4b, 0xbb, 0x07, 0xaf, 0x83, 0x0c, 0x84, 0x28, 0x91, 0x26, - 0x55, 0x42, 0x6a, 0x45, 0x27, 0xc1, 0xb4, 0x57, 0x8c, 0x69, 0xaa, 0x26, 0x06, 0x54, 0x91, 0x78, - 0xc3, 0x9b, 0x28, 0x4d, 0xbc, 0x70, 0xc2, 0xb1, 0x33, 0xc7, 0x99, 0xb6, 0x0f, 0x03, 0xdf, 0x84, - 0xef, 0x86, 0xfc, 0x50, 0xe8, 0x56, 0x94, 0x57, 0x71, 0xfe, 0x77, 0xbf, 0xbf, 0x2f, 0x17, 0x9f, - 0x61, 0x3f, 0x11, 0xfc, 0x1a, 0xb3, 0x89, 0x7d, 0x8c, 0x0b, 0x29, 0x94, 0x20, 0x3b, 0x0c, 0xf9, - 0x0f, 0x2a, 0xd3, 0xe9, 0xd8, 0xca, 0xc1, 0xef, 0x06, 0xb4, 0x67, 0x4c, 0x2c, 0x62, 0x46, 0x5e, - 0xc3, 0x9e, 0x8b, 0x46, 0x3c, 0xce, 0x69, 0x59, 0xc4, 0x09, 0xf5, 0x1b, 0xc3, 0xc6, 0xa8, 0x1b, - 0xee, 0xba, 0xc0, 0xe7, 0xa5, 0x4e, 0x5e, 0x82, 0x97, 0x70, 0x8c, 0x28, 0x8f, 0x17, 0x8c, 0xa6, - 0xfe, 0xc6, 0xb0, 0x31, 0xea, 0x84, 0x90, 0x70, 0xbc, 0xb0, 0x0a, 0xf1, 0x61, 0xeb, 0x96, 0xca, - 0x12, 0x05, 0xf7, 0x37, 0x8d, 0xc7, 0xf2, 0x95, 0x7c, 0x84, 0x5d, 0x4c, 0x29, 0x57, 0xa8, 0xee, - 0xa3, 0x44, 0x70, 0x45, 0xef, 0x94, 0xdf, 0x1c, 0x36, 0x46, 0xde, 0x74, 0x38, 0x7e, 0x54, 0xde, - 0xf8, 0xd2, 0x25, 0x9e, 0xdb, 0xbc, 0x70, 0x07, 0x1f, 0x0a, 0xc1, 0xcf, 0x36, 0xb4, 0xe6, 0x52, - 0xdc, 0xdd, 0x93, 0x77, 0xe0, 0x15, 0x7a, 0x11, 0x61, 0x1e, 0x67, 0xb6, 0x70, 0x6f, 0xfa, 0x64, - 0xdd, 0x51, 0x47, 0x43, 0x30, 0xa9, 0x66, 0x4d, 0xde, 0xc3, 0xae, 0x03, 0x39, 0x2a, 0x47, 0x6f, - 0xd4, 0xd2, 0xdb, 0x96, 0xe6, 0xa8, 0xac, 0xc3, 0x0c, 0x06, 0x29, 0x2d, 0x15, 0xf2, 0x58, 0xa1, - 0xe0, 0x51, 0x5c, 0x60, 0x54, 0x08, 0xa9, 0xcc, 0x87, 0x7b, 0xd3, 0x83, 0x35, 0x97, 0xb9, 0x90, - 0x2a, 0x24, 0x2b, 0xc8, 0x59, 0x81, 0x5a, 0x23, 0x27, 0xd0, 0xd3, 0x1d, 0x91, 0x82, 0x59, 0x83, - 0x66, 0x9d, 0x81, 0xe7, 0x52, 0x0d, 0x39, 0x83, 0x01, 0x66, 0x5c, 0x48, 0x1a, 0x21, 0x5f, 0x88, - 0x8a, 0xa7, 0xc6, 0xa0, 0xf4, 0x5b, 0xc3, 0xcd, 0x9a, 0x12, 0x2c, 0x72, 0x69, 0x09, 0x2d, 0x95, - 0xe4, 0x12, 0x0e, 0x9c, 0x91, 0xa8, 0xd4, 0xaa, 0x53, 0xbb, 0xce, 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cf, 0xa0, 0x69, 0x9a, 0x44, 0xa0, 0x69, 0xfa, 0xaa, 0x1d, 0xfa, 0xa1, 0x59, 0x07, 0xbf, 0x1a, - 0x30, 0xf8, 0x5f, 0x63, 0xb4, 0xab, 0xa4, 0x37, 0x15, 0x2d, 0x55, 0x94, 0x14, 0x95, 0xdb, 0x15, - 0x9c, 0x74, 0x5e, 0x54, 0xe4, 0x08, 0xb6, 0x97, 0x09, 0x39, 0xcd, 0x85, 0x5c, 0xee, 0xdc, 0x77, - 0xea, 0x27, 0x23, 0xea, 0xb6, 0x32, 0xcc, 0xd1, 0xba, 0xd8, 0xeb, 0xa4, 0x63, 0x04, 0xed, 0xf1, - 0x0a, 0x7a, 0x36, 0xe8, 0x1c, 0x9a, 0x26, 0xee, 0x19, 0xcd, 0xf2, 0xc1, 0x1e, 0xec, 0x3c, 0xba, - 0x49, 0x82, 0x21, 0x74, 0x96, 0xad, 0x26, 0x03, 0x68, 0xd9, 0x9f, 0x62, 0x0b, 0xb4, 0x2f, 0x1f, - 0x8e, 0xbf, 0xbd, 0xc9, 0x50, 0x7d, 0xaf, 0x16, 0xe3, 0x44, 0xe4, 0x13, 0xf7, 0x9f, 0x96, 0xcf, - 0xe9, 0xc4, 0x4d, 0x1f, 0xa3, 0x72, 0x92, 0x51, 0xee, 0xae, 0xd9, 0x45, 0xdb, 0xdc, 0xb3, 0xc7, - 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xbe, 0x0a, 0x40, 0x7e, 0x05, 0x00, 0x00, +var fileDescriptor_config_433876e2a8cfc063 = []byte{ + // 632 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xdd, 0x6e, 0xd3, 0x30, + 0x14, 0x56, 0xb6, 0x76, 0x4b, 0x4f, 0xba, 0x3f, 0x6f, 0x83, 0x0c, 0x84, 0x08, 0x91, 0x26, 0x55, + 0x42, 0x6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x62, 0x13, 0xb4, 0x9b, 0xf7, 0x47, 0x5f, 0x5f, 0x15, 0x54, 0x7d, + 0x6b, 0x66, 0xc3, 0x4c, 0x94, 0x23, 0xf7, 0x9f, 0xda, 0xef, 0x78, 0xe4, 0xa6, 0x8f, 0xa1, 0x1c, + 0x15, 0xc8, 0xdd, 0xeb, 0x38, 0x5b, 0x33, 0xcf, 0xe3, 0xd1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xf4, 0x34, 0xf2, 0xba, 0x35, 0x05, 0x00, 0x00, } diff --git a/controller/proxy-injector/webhook_test.go b/controller/proxy-injector/webhook_test.go index d8f5bc9b1..baf9ec36a 100644 --- a/controller/proxy-injector/webhook_test.go +++ b/controller/proxy-injector/webhook_test.go @@ -24,7 +24,6 @@ var ( proxyConfig = &config.Proxy{ ProxyImage: &config.Image{ImageName: "gcr.io/linkerd-io/proxy", PullPolicy: "IfNotPresent"}, ProxyInitImage: &config.Image{ImageName: "gcr.io/linkerd-io/proxy-init", PullPolicy: "IfNotPresent"}, - DestinationApiPort: &config.Port{Port: 8086}, ControlPort: &config.Port{Port: 4190}, IgnoreInboundPorts: nil, IgnoreOutboundPorts: nil, diff --git a/pkg/inject/inject.go b/pkg/inject/inject.go index ef42c2168..9f40a0aa3 100644 --- a/pkg/inject/inject.go +++ b/pkg/inject/inject.go @@ -31,6 +31,8 @@ const ( podNamespaceEnvVarName = "LINKERD2_PROXY_POD_NAMESPACE" // defaultKeepaliveMs is used in the proxy configuration for remote connections defaultKeepaliveMs = 10000 + // destinationAPIPort is the port exposed by the linkerd-destination service + destinationAPIPort = 8086 ) var injectableKinds = []string{ @@ -420,7 +422,7 @@ func (conf *ResourceConfig) injectPodSpec(patch *Patch, identity k8s.TLSIdentity {Name: "LINKERD2_PROXY_LOG", Value: conf.proxyConfig.GetLogLevel().GetLevel()}, { Name: "LINKERD2_PROXY_CONTROL_URL", - Value: fmt.Sprintf("tcp://%s:%d", controlPlaneDNS, conf.proxyConfig.GetDestinationApiPort().GetPort()), + Value: fmt.Sprintf("tcp://%s:%d", controlPlaneDNS, destinationAPIPort), }, {Name: "LINKERD2_PROXY_CONTROL_LISTENER", Value: fmt.Sprintf("tcp://0.0.0.0:%d", conf.proxyConfig.GetControlPort().GetPort())}, {Name: "LINKERD2_PROXY_METRICS_LISTENER", Value: fmt.Sprintf("tcp://0.0.0.0:%d", conf.proxyConfig.GetMetricsPort().GetPort())}, diff --git a/proto/config/config.proto b/proto/config/config.proto index 13cb0f17e..8c72e315d 100644 --- a/proto/config/config.proto +++ b/proto/config/config.proto @@ -19,19 +19,18 @@ message Proxy { Image proxy_image = 1; Image proxy_init_image = 2; - Port destination_api_port = 3; - Port control_port = 4; - repeated Port ignore_inbound_ports = 5; - repeated Port ignore_outbound_ports = 6; - Port inbound_port = 7; - Port metrics_port = 8; - Port outbound_port = 9; + Port control_port = 3; + repeated Port ignore_inbound_ports = 4; + repeated Port ignore_outbound_ports = 5; + Port inbound_port = 6; + Port metrics_port = 7; + Port outbound_port = 8; - ResourceRequirements resource = 10; + ResourceRequirements resource = 9; - int64 proxy_uid = 11; - LogLevel log_level = 12; - bool disable_external_profiles = 13; + int64 proxy_uid = 10; + LogLevel log_level = 11; + bool disable_external_profiles = 12; } message Image {