Skip to content

Commit

Permalink
chore(dns): remove empty dns port completely (#10338)
Browse files Browse the repository at this point in the history
Refer to #8640, we have drop usage of empty dns port carefully
and left some property for rollback/downgrade. Nowadays, we gonna
remove it completely

Signed-off-by: Icarus Wu <icaruswu66@qq.com>
  • Loading branch information
Icarus9913 authored Jun 5, 2024
1 parent ed8d37c commit a3e04e9
Show file tree
Hide file tree
Showing 33 changed files with 2 additions and 99 deletions.
3 changes: 0 additions & 3 deletions app/kuma-dp/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ func newRunCmd(opts kuma_cmd.RunCmdOpts, rootCtx *RootContext) *cobra.Command {
bootstrap, kumaSidecarConfiguration, err := rootCtx.BootstrapGenerator(gracefulCtx, opts.Config.ControlPlane.URL, opts.Config, envoy.BootstrapParams{
Dataplane: opts.Dataplane,
DNSPort: cfg.DNS.EnvoyDNSPort,
EmptyDNSPort: cfg.DNS.CoreDNSEmptyPort,
EnvoyVersion: *envoyVersion,
Workdir: cfg.DataplaneRuntime.SocketDir,
AccessLogSocketPath: core_xds.AccessLogSocketName(cfg.DataplaneRuntime.SocketDir, cfg.Dataplane.Name, cfg.Dataplane.Mesh),
Expand Down Expand Up @@ -317,14 +316,12 @@ func newRunCmd(opts kuma_cmd.RunCmdOpts, rootCtx *RootContext) *cobra.Command {
cmd.PersistentFlags().BoolVar(&cfg.DNS.Enabled, "dns-enabled", cfg.DNS.Enabled, "If true then builtin DNS functionality is enabled and CoreDNS server is started")
cmd.PersistentFlags().Uint32Var(&cfg.DNS.EnvoyDNSPort, "dns-envoy-port", cfg.DNS.EnvoyDNSPort, "A port that handles Virtual IP resolving by Envoy. CoreDNS should be configured that it first tries to use this DNS resolver and then the real one")
cmd.PersistentFlags().Uint32Var(&cfg.DNS.CoreDNSPort, "dns-coredns-port", cfg.DNS.CoreDNSPort, "A port that handles DNS requests. When transparent proxy is enabled then iptables will redirect DNS traffic to this port.")
cmd.PersistentFlags().Uint32Var(&cfg.DNS.CoreDNSEmptyPort, "dns-coredns-empty-port", cfg.DNS.CoreDNSEmptyPort, "A port that always responds with empty NXDOMAIN respond. It is required to implement a fallback to a real DNS.")
cmd.PersistentFlags().StringVar(&cfg.DNS.CoreDNSBinaryPath, "dns-coredns-path", cfg.DNS.CoreDNSBinaryPath, "A path to CoreDNS binary.")
cmd.PersistentFlags().StringVar(&cfg.DNS.CoreDNSConfigTemplatePath, "dns-coredns-config-template-path", cfg.DNS.CoreDNSConfigTemplatePath, "A path to a CoreDNS config template.")
cmd.PersistentFlags().StringVar(&cfg.DNS.ConfigDir, "dns-server-config-dir", cfg.DNS.ConfigDir, "Directory in which DNS Server config will be generated")
cmd.PersistentFlags().Uint32Var(&cfg.DNS.PrometheusPort, "dns-prometheus-port", cfg.DNS.PrometheusPort, "A port for exposing Prometheus stats")
cmd.PersistentFlags().BoolVar(&cfg.DNS.CoreDNSLogging, "dns-enable-logging", cfg.DNS.CoreDNSLogging, "If true then CoreDNS logging is enabled")

_ = cmd.PersistentFlags().MarkDeprecated("dns-coredns-empty-port", "It's not used anymore. It will be removed in 2.7.x version")
return cmd
}

Expand Down
7 changes: 0 additions & 7 deletions app/kuma-dp/pkg/dataplane/dnsserver/Corefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,3 @@
errors{{ if .CoreDNSLogging}}
log{{end}}
}

.:{{ .CoreDNSEmptyPort }} {
template ANY ANY . {
rcode NXDOMAIN
}{{ if .CoreDNSLogging}}
log{{end}}
}
15 changes: 0 additions & 15 deletions app/kuma-dp/pkg/dataplane/dnsserver/dnsserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ var _ = Describe("DNS Server", func() {
DNS: kuma_dp.DNS{
Enabled: true,
CoreDNSPort: 16001,
CoreDNSEmptyPort: 16002,
EnvoyDNSPort: 16002,
PrometheusPort: 16003,
CoreDNSBinaryPath: filepath.Join("testdata", "binary-mock.exit-0.sh"),
Expand Down Expand Up @@ -127,12 +126,6 @@ var _ = Describe("DNS Server", func() {
prometheus localhost:16003
errors
}
.:16002 {
template ANY ANY . {
rcode NXDOMAIN
}
}
`))
}))

Expand Down Expand Up @@ -194,7 +187,6 @@ var _ = Describe("DNS Server", func() {
DNS: kuma_dp.DNS{
Enabled: true,
CoreDNSPort: 16001,
CoreDNSEmptyPort: 16002,
EnvoyDNSPort: 16002,
PrometheusPort: 16003,
CoreDNSBinaryPath: filepath.Join("testdata", "binary-mock.exit-0.sh"),
Expand Down Expand Up @@ -261,13 +253,6 @@ var _ = Describe("DNS Server", func() {
errors
log
}
.:16002 {
template ANY ANY . {
rcode NXDOMAIN
}
log
}
`))
}))
})
Expand Down
1 change: 0 additions & 1 deletion app/kuma-dp/pkg/dataplane/envoy/envoy.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ var runLog = core.Log.WithName("kuma-dp").WithName("run").WithName("envoy")
type BootstrapParams struct {
Dataplane rest.Resource
DNSPort uint32
EmptyDNSPort uint32
EnvoyVersion EnvoyVersion
DynamicMetadata map[string]string
Workdir string
Expand Down
1 change: 0 additions & 1 deletion app/kuma-dp/pkg/dataplane/envoy/remote_bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ func (b *remoteBootstrap) requestForBootstrap(ctx context.Context, client *http.
},
DynamicMetadata: params.DynamicMetadata,
DNSPort: params.DNSPort,
EmptyDNSPort: params.EmptyDNSPort,
OperatingSystem: b.operatingSystem,
Features: b.features,
Resources: resources,
Expand Down
6 changes: 0 additions & 6 deletions pkg/config/app/kuma-dp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ var DefaultConfig = func() Config {
Enabled: true,
CoreDNSPort: 15053,
EnvoyDNSPort: 15054,
CoreDNSEmptyPort: 15055,
CoreDNSBinaryPath: "coredns",
CoreDNSConfigTemplatePath: "",
ConfigDir: "", // if left empty, a temporary directory will be generated automatically
Expand Down Expand Up @@ -353,8 +352,6 @@ type DNS struct {
Enabled bool `json:"enabled,omitempty" envconfig:"kuma_dns_enabled"`
// CoreDNSPort defines a port that handles DNS requests. When transparent proxy is enabled then iptables will redirect DNS traffic to this port.
CoreDNSPort uint32 `json:"coreDnsPort,omitempty" envconfig:"kuma_dns_core_dns_port"`
// CoreDNSEmptyPort defines a port that always responds with empty NXDOMAIN respond. It is required to implement a fallback to a real DNS
CoreDNSEmptyPort uint32 `json:"coreDnsEmptyPort,omitempty" envconfig:"kuma_dns_core_dns_empty_port"`
// EnvoyDNSPort defines a port that handles Virtual IP resolving by Envoy. CoreDNS should be configured that it first tries to use this DNS resolver and then the real one.
EnvoyDNSPort uint32 `json:"envoyDnsPort,omitempty" envconfig:"kuma_dns_envoy_dns_port"`
// CoreDNSBinaryPath defines a path to CoreDNS binary.
Expand All @@ -376,9 +373,6 @@ func (d *DNS) Validate() error {
if d.CoreDNSPort > 65353 {
return errors.New(".CoreDNSPort has to be in [0, 65353] range")
}
if d.CoreDNSEmptyPort > 65353 {
return errors.New(".CoreDNSEmptyPort has to be in [0, 65353] range")
}
if d.EnvoyDNSPort > 65353 {
return errors.New(".EnvoyDNSPort has to be in [0, 65353] range")
}
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/app/kuma-dp/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ var _ = Describe("Config", func() {
"KUMA_DATAPLANE_RUNTIME_DYNAMIC_CONFIGURATION_REFRESH_INTERVAL": "5s",
"KUMA_DNS_ENABLED": "true",
"KUMA_DNS_CORE_DNS_PORT": "5300",
"KUMA_DNS_CORE_DNS_EMPTY_PORT": "5301",
"KUMA_DNS_ENVOY_DNS_PORT": "5302",
"KUMA_DNS_CORE_DNS_BINARY_PATH": "/tmp/coredns",
"KUMA_DNS_CORE_DNS_CONFIG_TEMPLATE_PATH": "/tmp/Corefile",
Expand Down Expand Up @@ -99,7 +98,6 @@ var _ = Describe("Config", func() {
Expect(cfg.DataplaneRuntime.DynamicConfiguration.RefreshInterval.Duration).To(Equal(5 * time.Second))
Expect(cfg.DNS.Enabled).To(BeTrue())
Expect(cfg.DNS.CoreDNSPort).To(Equal(uint32(5300)))
Expect(cfg.DNS.CoreDNSEmptyPort).To(Equal(uint32(5301)))
Expect(cfg.DNS.EnvoyDNSPort).To(Equal(uint32(5302)))
Expect(cfg.DNS.CoreDNSBinaryPath).To(Equal("/tmp/coredns"))
Expect(cfg.DNS.CoreDNSConfigTemplatePath).To(Equal("/tmp/Corefile"))
Expand Down
1 change: 0 additions & 1 deletion pkg/config/app/kuma-dp/testdata/default-config.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dataplaneRuntime:
resources: {}
dns:
coreDnsBinaryPath: coredns
coreDnsEmptyPort: 15055
coreDnsPort: 15053
enabled: true
envoyDnsPort: 15054
Expand Down
10 changes: 0 additions & 10 deletions pkg/core/xds/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const (
FieldDataplaneAdminPort = "dataplane.admin.port"
FieldDataplaneAdminAddress = "dataplane.admin.address"
FieldDataplaneDNSPort = "dataplane.dns.port"
FieldDataplaneDNSEmptyPort = "dataplane.dns.empty.port"
FieldDataplaneDataplaneResource = "dataplane.resource"
FieldDynamicMetadata = "dynamicMetadata"
FieldDataplaneProxyType = "dataplane.proxyType"
Expand Down Expand Up @@ -56,7 +55,6 @@ type DataplaneMetadata struct {
AdminPort uint32
AdminAddress string
DNSPort uint32
EmptyDNSPort uint32
DynamicMetadata map[string]string
ProxyType mesh_proto.ProxyType
Version *mesh_proto.Version
Expand Down Expand Up @@ -133,13 +131,6 @@ func (m *DataplaneMetadata) GetDNSPort() uint32 {
return m.DNSPort
}

func (m *DataplaneMetadata) GetEmptyDNSPort() uint32 {
if m == nil {
return 0
}
return m.EmptyDNSPort
}

func (m *DataplaneMetadata) GetDynamicMetadata(key string) string {
if m == nil || m.DynamicMetadata == nil {
return ""
Expand Down Expand Up @@ -168,7 +159,6 @@ func DataplaneMetadataFromXdsMetadata(xdsMetadata *structpb.Struct, tmpDir strin
metadata.AdminPort = uint32Metadata(xdsMetadata, FieldDataplaneAdminPort)
metadata.AdminAddress = xdsMetadata.Fields[FieldDataplaneAdminAddress].GetStringValue()
metadata.DNSPort = uint32Metadata(xdsMetadata, FieldDataplaneDNSPort)
metadata.EmptyDNSPort = uint32Metadata(xdsMetadata, FieldDataplaneDNSEmptyPort)
if value := xdsMetadata.Fields[FieldDataplaneDataplaneResource]; value != nil {
res, err := rest.YAML.UnmarshalCore([]byte(value.GetStringValue()))
if err != nil {
Expand Down
6 changes: 0 additions & 6 deletions pkg/core/xds/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ var _ = Describe("DataplaneMetadataFromXdsMetadata", func() {
StringValue: "8000",
},
},
"dataplane.dns.empty.port": {
Kind: &structpb.Value_StringValue{
StringValue: "8001",
},
},
"accessLogSocketPath": {
Kind: &structpb.Value_StringValue{
StringValue: "/tmp/logs",
Expand All @@ -79,7 +74,6 @@ var _ = Describe("DataplaneMetadataFromXdsMetadata", func() {
expected: xds.DataplaneMetadata{
AdminPort: 1234,
DNSPort: 8000,
EmptyDNSPort: 8001,
AccessLogSocketPath: "/tmp/logs",
MetricsSocketPath: "/tmp/metrics",
SystemCaPath: "/etc/certs/cert.pem",
Expand Down
1 change: 0 additions & 1 deletion pkg/envoy/admin/testdata/full_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"dynamicMetadata": {
"version.dependencies.coredns": "1.8.3"
},
"dataplane.dns.empty.port": "15055",
"dataplane.admin.port": "6606",
"dataplane.resource": "{\"type\":\"Dataplane\",\"mesh\":\"default\",\"name\":\"backend-1\",\"creationTime\":\"0001-01-01T00:00:00Z\",\"modificationTime\":\"0001-01-01T00:00:00Z\",\"networking\":{\"address\":\"127.0.0.1\",\"inbound\":[{\"port\":10010,\"servicePort\":10011,\"tags\":{\"kuma.io/protocol\":\"tcp\",\"kuma.io/region\":\"reg1\",\"kuma.io/service\":\"backend\",\"kuma.io/sub-zone\":\"subzone1\",\"version\":\"1\"}}],\"outbound\":[{\"port\":10006,\"tags\":{\"kuma.io/service\":\"gateway\"}}],\"admin\":{\"port\":6606}}}"
},
Expand Down
1 change: 0 additions & 1 deletion pkg/envoy/admin/testdata/golden.full_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"dynamicMetadata": {
"version.dependencies.coredns": "1.8.3"
},
"dataplane.dns.empty.port": "15055",
"dataplane.admin.port": "6606",
"dataplane.resource": "{\"type\":\"Dataplane\",\"mesh\":\"default\",\"name\":\"backend-1\",\"creationTime\":\"0001-01-01T00:00:00Z\",\"modificationTime\":\"0001-01-01T00:00:00Z\",\"networking\":{\"address\":\"127.0.0.1\",\"inbound\":[{\"port\":10010,\"servicePort\":10011,\"tags\":{\"kuma.io/protocol\":\"tcp\",\"kuma.io/region\":\"reg1\",\"kuma.io/service\":\"backend\",\"kuma.io/sub-zone\":\"subzone1\",\"version\":\"1\"}}],\"outbound\":[{\"port\":10006,\"tags\":{\"kuma.io/service\":\"gateway\"}}],\"admin\":{\"port\":6606}}}"
},
Expand Down
1 change: 0 additions & 1 deletion pkg/envoy/admin/testdata/golden.no_hds.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"dynamicMetadata": {
"version.dependencies.coredns": "1.8.3"
},
"dataplane.dns.empty.port": "15055",
"dataplane.admin.port": "6606",
"dataplane.resource": "{\"type\":\"Dataplane\",\"mesh\":\"default\",\"name\":\"backend-1\",\"creationTime\":\"0001-01-01T00:00:00Z\",\"modificationTime\":\"0001-01-01T00:00:00Z\",\"networking\":{\"address\":\"127.0.0.1\",\"inbound\":[{\"port\":10010,\"servicePort\":10011,\"tags\":{\"kuma.io/protocol\":\"tcp\",\"kuma.io/region\":\"reg1\",\"kuma.io/service\":\"backend\",\"kuma.io/sub-zone\":\"subzone1\",\"version\":\"1\"}}],\"outbound\":[{\"port\":10006,\"tags\":{\"kuma.io/service\":\"gateway\"}}],\"admin\":{\"port\":6606}}}"
},
Expand Down
1 change: 0 additions & 1 deletion pkg/envoy/admin/testdata/no_hds.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"dynamicMetadata": {
"version.dependencies.coredns": "1.8.3"
},
"dataplane.dns.empty.port": "15055",
"dataplane.admin.port": "6606",
"dataplane.resource": "{\"type\":\"Dataplane\",\"mesh\":\"default\",\"name\":\"backend-1\",\"creationTime\":\"0001-01-01T00:00:00Z\",\"modificationTime\":\"0001-01-01T00:00:00Z\",\"networking\":{\"address\":\"127.0.0.1\",\"inbound\":[{\"port\":10010,\"servicePort\":10011,\"tags\":{\"kuma.io/protocol\":\"tcp\",\"kuma.io/region\":\"reg1\",\"kuma.io/service\":\"backend\",\"kuma.io/sub-zone\":\"subzone1\",\"version\":\"1\"}}],\"outbound\":[{\"port\":10006,\"tags\":{\"kuma.io/service\":\"gateway\"}}],\"admin\":{\"port\":6606}}}"
},
Expand Down
5 changes: 0 additions & 5 deletions pkg/plugins/runtime/k8s/containers/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,6 @@ func (i *DataplaneProxyFactory) sidecarEnvVars(mesh string, podAnnotations map[s
Value: strconv.FormatInt(int64(i.BuiltinDNS.Port), 10),
}

envVars["KUMA_DNS_CORE_DNS_EMPTY_PORT"] = kube_core.EnvVar{
Name: "KUMA_DNS_CORE_DNS_EMPTY_PORT",
Value: strconv.FormatInt(int64(i.BuiltinDNS.Port+1), 10),
}

envVars["KUMA_DNS_ENVOY_DNS_PORT"] = kube_core.EnvVar{
Name: "KUMA_DNS_ENVOY_DNS_PORT",
Value: strconv.FormatInt(int64(i.BuiltinDNS.Port+2), 10),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ spec:
value: /var/run/secrets/kubernetes.io/serviceaccount/token
- name: KUMA_DNS_CORE_DNS_BINARY_PATH
value: coredns
- name: KUMA_DNS_CORE_DNS_EMPTY_PORT
value: "25054"
- name: KUMA_DNS_CORE_DNS_PORT
value: "25053"
- name: KUMA_DNS_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ spec:
value: /var/run/secrets/kubernetes.io/serviceaccount/token
- name: KUMA_DNS_CORE_DNS_BINARY_PATH
value: coredns
- name: KUMA_DNS_CORE_DNS_EMPTY_PORT
value: "25054"
- name: KUMA_DNS_CORE_DNS_PORT
value: "25053"
- name: KUMA_DNS_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ spec:
value: /var/run/secrets/kubernetes.io/serviceaccount/token
- name: KUMA_DNS_CORE_DNS_BINARY_PATH
value: coredns
- name: KUMA_DNS_CORE_DNS_EMPTY_PORT
value: "25054"
- name: KUMA_DNS_CORE_DNS_PORT
value: "25053"
- name: KUMA_DNS_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ spec:
value: /var/run/secrets/kubernetes.io/serviceaccount/token
- name: KUMA_DNS_CORE_DNS_BINARY_PATH
value: coredns
- name: KUMA_DNS_CORE_DNS_EMPTY_PORT
value: "25054"
- name: KUMA_DNS_CORE_DNS_PORT
value: "25053"
- name: KUMA_DNS_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ spec:
value: /var/run/secrets/kubernetes.io/serviceaccount/token
- name: KUMA_DNS_CORE_DNS_BINARY_PATH
value: coredns
- name: KUMA_DNS_CORE_DNS_EMPTY_PORT
value: "25054"
- name: KUMA_DNS_CORE_DNS_PORT
value: "25053"
- name: KUMA_DNS_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ spec:
value: /var/run/secrets/kubernetes.io/serviceaccount/token
- name: KUMA_DNS_CORE_DNS_BINARY_PATH
value: coredns
- name: KUMA_DNS_CORE_DNS_EMPTY_PORT
value: "25054"
- name: KUMA_DNS_CORE_DNS_PORT
value: "25053"
- name: KUMA_DNS_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ spec:
value: /var/run/secrets/kubernetes.io/serviceaccount/token
- name: KUMA_DNS_CORE_DNS_BINARY_PATH
value: coredns
- name: KUMA_DNS_CORE_DNS_EMPTY_PORT
value: "25054"
- name: KUMA_DNS_CORE_DNS_PORT
value: "25053"
- name: KUMA_DNS_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ spec:
value: /var/run/secrets/kubernetes.io/serviceaccount/token
- name: KUMA_DNS_CORE_DNS_BINARY_PATH
value: coredns
- name: KUMA_DNS_CORE_DNS_EMPTY_PORT
value: "25054"
- name: KUMA_DNS_CORE_DNS_PORT
value: "25053"
- name: KUMA_DNS_ENABLED
Expand Down
1 change: 0 additions & 1 deletion pkg/xds/bootstrap/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ func (b *bootstrapGenerator) Generate(ctx context.Context, request types.Bootstr
},
DynamicMetadata: request.DynamicMetadata,
DNSPort: request.DNSPort,
EmptyDNSPort: request.EmptyDNSPort,
ProxyType: request.ProxyType,
Features: request.Features,
Resources: request.Resources,
Expand Down
4 changes: 0 additions & 4 deletions pkg/xds/bootstrap/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ var _ = Describe("bootstrapGenerator", func() {
DataplaneToken: "token",
Version: defaultVersion,
DNSPort: 53001,
EmptyDNSPort: 53002,
},
expectedConfigFile: "generator.default-config.golden.yaml",
hdsEnabled: true,
Expand Down Expand Up @@ -387,7 +386,6 @@ var _ = Describe("bootstrapGenerator", func() {
DataplaneToken: "token",
Version: defaultVersion,
DNSPort: 53001,
EmptyDNSPort: 53002,
},
expectedConfigFile: "generator.default-config.golden.yaml",
hdsEnabled: true,
Expand All @@ -411,7 +409,6 @@ var _ = Describe("bootstrapGenerator", func() {
DataplaneToken: "token",
Version: defaultVersion,
DNSPort: 53001,
EmptyDNSPort: 53002,
DataplaneTokenPath: "/path/to/file",
MetricsResources: types.MetricsResources{
CertPath: "/path/cert/pem",
Expand Down Expand Up @@ -457,7 +454,6 @@ var _ = Describe("bootstrapGenerator", func() {
DataplaneToken: "token",
Version: defaultVersion,
DNSPort: 53001,
EmptyDNSPort: 53002,
DataplaneTokenPath: "/path/to/file",
},
expectedConfigFile: "generator.gateway.golden.yaml",
Expand Down
1 change: 0 additions & 1 deletion pkg/xds/bootstrap/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ type configParameters struct {
HdsEnabled bool
DynamicMetadata map[string]string
DNSPort uint32
EmptyDNSPort uint32
ProxyType string
Features []string
IsGatewayDataplane bool
Expand Down
3 changes: 0 additions & 3 deletions pkg/xds/bootstrap/template_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,6 @@ func genConfig(parameters configParameters, proxyConfig xds.Proxy, enableReloada
if parameters.DNSPort != 0 {
res.Node.Metadata.Fields[core_xds.FieldDataplaneDNSPort] = util_proto.MustNewValueForStruct(strconv.Itoa(int(parameters.DNSPort)))
}
if parameters.EmptyDNSPort != 0 {
res.Node.Metadata.Fields[core_xds.FieldDataplaneDNSEmptyPort] = util_proto.MustNewValueForStruct(strconv.Itoa(int(parameters.EmptyDNSPort)))
}
if parameters.ProxyType != "" {
res.Node.Metadata.Fields[core_xds.FieldDataplaneProxyType] = util_proto.MustNewValueForStruct(parameters.ProxyType)
}
Expand Down
6 changes: 0 additions & 6 deletions pkg/xds/bootstrap/testdata/corefile.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,4 @@
alternate NOTIMP,FORMERR,NXDOMAIN,SERVFAIL,REFUSED . /etc/resolv.conf
prometheus localhost:{{ .PrometheusPort }}
errors
}

.:{{ .CoreDNSEmptyPort }} {
template ANY ANY . {
rcode NXDOMAIN
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ node:
accessLogSocketPath: /tmp/kuma-al-name.namespace-mesh.sock
dataplane.admin.address: 127.0.0.1
dataplane.admin.port: "1234"
dataplane.dns.empty.port: "53002"
dataplane.dns.port: "53001"
dataplane.proxyType: dataplane
features: []
Expand Down
Loading

0 comments on commit a3e04e9

Please sign in to comment.