Repository: kumahq/kuma
Pull request #1008 (2020-09-07 12:34:16)

fix(kuma-cp) use not deprecated value to disable auth on universal
### Summary

`DataplaneTokenServer.Enabled` is deprecated, we should use `AdminServer.Apis.DataplaneToken.Enabled`.

### Documentation

- [x] Included in https://github.com/kumahq/kuma-website/pull/273


lobkovilya: There is also usage in `pkg/core/bootstrap/autoconfig.go` and in some tests, do we want to get rid of all usages?
jakubdyszkiewicz: That's a good point. I thought we are bound to this value in kuma-dp, but we are not. Removed.

Patch:
diff --git a/pkg/config/app/kuma-cp/config.go b/pkg/config/app/kuma-cp/config.go
index c692dadff..258799145 100644
--- a/pkg/config/app/kuma-cp/config.go
+++ b/pkg/config/app/kuma-cp/config.go
@@ -17,7 +17,6 @@ import (
 	"github.com/kumahq/kuma/pkg/config/mads"
 	"github.com/kumahq/kuma/pkg/config/plugins/runtime"
 	"github.com/kumahq/kuma/pkg/config/sds"
-	token_server "github.com/kumahq/kuma/pkg/config/token-server"
 	"github.com/kumahq/kuma/pkg/config/xds"
 	"github.com/kumahq/kuma/pkg/config/xds/bootstrap"
 )
@@ -102,8 +101,6 @@ type Config struct {
 	XdsServer *xds.XdsServerConfig `yaml:"xdsServer,omitempty"`
 	// Envoy SDS server configuration
 	SdsServer *sds.SdsServerConfig `yaml:"sdsServer,omitempty"`
-	// Dataplane Token server configuration (DEPRECATED: use adminServer)
-	DataplaneTokenServer *token_server.DataplaneTokenServerConfig `yaml:"dataplaneTokenServer,omitempty"`
 	// Monitoring Assignment Discovery Service (MADS) server configuration
 	MonitoringAssignmentServer *mads.MonitoringAssignmentServerConfig `yaml:"monitoringAssignmentServer,omitempty"`
 	// Admin server configuration
@@ -132,7 +129,6 @@ func (c *Config) Sanitize() {
 	c.BootstrapServer.Sanitize()
 	c.XdsServer.Sanitize()
 	c.SdsServer.Sanitize()
-	c.DataplaneTokenServer.Sanitize()
 	c.MonitoringAssignmentServer.Sanitize()
 	c.AdminServer.Sanitize()
 	c.ApiServer.Sanitize()
@@ -151,7 +147,6 @@ func DefaultConfig() Config {
 		Store:                      store.DefaultStoreConfig(),
 		XdsServer:                  xds.DefaultXdsServerConfig(),
 		SdsServer:                  sds.DefaultSdsServerConfig(),
-		DataplaneTokenServer:       token_server.DefaultDataplaneTokenServerConfig(),
 		MonitoringAssignmentServer: mads.DefaultMonitoringAssignmentServerConfig(),
 		AdminServer:                admin_server.DefaultAdminServerConfig(),
 		ApiServer:                  api_server.DefaultApiServerConfig(),
@@ -205,9 +200,6 @@ func (c *Config) Validate() error {
 		if err := c.SdsServer.Validate(); err != nil {
 			return errors.Wrap(err, "SDS Server validation failed")
 		}
-		if err := c.DataplaneTokenServer.Validate(); err != nil {
-			return errors.Wrap(err, "Dataplane Token Server validation failed")
-		}
 		if err := c.MonitoringAssignmentServer.Validate(); err != nil {
 			return errors.Wrap(err, "Monitoring Assignment Server validation failed")
 		}
@@ -233,9 +225,6 @@ func (c *Config) Validate() error {
 		if err := c.SdsServer.Validate(); err != nil {
 			return errors.Wrap(err, "SDS Server validation failed")
 		}
-		if err := c.DataplaneTokenServer.Validate(); err != nil {
-			return errors.Wrap(err, "Dataplane Token Server validation failed")
-		}
 		if err := c.MonitoringAssignmentServer.Validate(); err != nil {
 			return errors.Wrap(err, "Monitoring Assignment Server validation failed")
 		}
diff --git a/pkg/config/app/kuma-cp/kuma-cp.defaults.yaml b/pkg/config/app/kuma-cp/kuma-cp.defaults.yaml
index 5dd47f668..7952aa51d 100644
--- a/pkg/config/app/kuma-cp/kuma-cp.defaults.yaml
+++ b/pkg/config/app/kuma-cp/kuma-cp.defaults.yaml
@@ -77,29 +77,6 @@ sdsServer:
   # Interval for re-genarting configuration for Dataplanes connected to the Control Plane
   dataplaneConfigurationRefreshInterval: 1s # ENV: KUMA_SDS_SERVER_DATAPLANE_CONFIGURATION_REFRESH_INTERVAL
 
-# Dataplane Token server configuration (DEPRECATED: use adminServer)
-dataplaneTokenServer:
-  # If true then Dataplane Token Server and token verification is enabled
-  enabled: true
-  # Local configuration of server that is available only on localhost
-  local:
-    # Port on which the server will be exposed
-    port: 5679 # ENV: KUMA_DATAPLANE_TOKEN_SERVER_LOCAL_PORT
-  # Public configuration of server that is available on public interface
-  public:
-    # If true then Dataplane Token Server is exposed on public interface
-    enabled: false
-    # Port on which the server will be exposed. If not specified (0) then port from local configuration will be used
-    port: 0 # ENV: KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_PORT
-    # Public interface on which the server will be exposed
-    interface: # ENV: KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_INTERFACE
-    # Path to TLS certificate file
-    tlsCertFile: # ENV: KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_TLS_CERT_FILE
-    # Path to TLS key file
-    tlsKeyFile: # ENV: KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_TLS_KEY_FILE
-    # Directory of authorized client certificates
-    clientCertsDir: # ENV: KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_CLIENT_CERTS_DIR"`
-
 #  Monitoring Assignment Discovery Service (MADS) server configuration
 monitoringAssignmentServer:
   # Port of a gRPC server that serves Monitoring Assignment Discovery Service (MADS).
diff --git a/pkg/config/token-server/config.go b/pkg/config/token-server/config.go
deleted file mode 100644
index 177343ff7..000000000
--- a/pkg/config/token-server/config.go
+++ /dev/null
@@ -1,119 +0,0 @@
-package token_server
-
-import (
-	"github.com/pkg/errors"
-
-	"github.com/kumahq/kuma/pkg/config"
-)
-
-func DefaultDataplaneTokenServerConfig() *DataplaneTokenServerConfig {
-	return &DataplaneTokenServerConfig{
-		Enabled: true,
-		Local:   DefaultLocalDataplaneTokenServerConfig(),
-		Public:  DefaultPublicDataplaneTokenServerConfig(),
-	}
-}
-
-var _ config.Config = &DataplaneTokenServerConfig{}
-
-// Dataplane Token Server configuration
-type DataplaneTokenServerConfig struct {
-	// If true then Dataplane Token Server and token verification is enabled
-	Enabled bool `yaml:"enabled" envconfig:"kuma_dataplane_token_server_enabled"`
-	// Local configuration of server that is available only on localhost
-	Local *LocalDataplaneTokenServerConfig `yaml:"local"`
-	// Public configuration of server that is available on public interface
-	Public *PublicDataplaneTokenServerConfig `yaml:"public"`
-}
-
-func (i *DataplaneTokenServerConfig) Sanitize() {
-	i.Public.Sanitize()
-	i.Local.Sanitize()
-}
-
-func (i *DataplaneTokenServerConfig) Validate() error {
-	if err := i.Local.Validate(); err != nil {
-		return errors.Wrap(err, "Local validation failed")
-	}
-	if err := i.Public.Validate(); err != nil {
-		return errors.Wrap(err, "Public validation failed")
-	}
-	if !i.Enabled && i.Public.Enabled {
-		return errors.New("Public.Enabled cannot be true when server is disabled.")
-	}
-	return nil
-}
-
-// Dataplane Token Server configuration of server that is available only on localhost
-type LocalDataplaneTokenServerConfig struct {
-	// Port on which the server will be exposed
-	Port uint32 `yaml:"port" envconfig:"kuma_dataplane_token_server_local_port"`
-}
-
-var _ config.Config = &LocalDataplaneTokenServerConfig{}
-
-func (l *LocalDataplaneTokenServerConfig) Sanitize() {
-}
-
-func (l *LocalDataplaneTokenServerConfig) Validate() error {
-	if l.Port > 65535 {
-		return errors.New("Port must be in the range [0, 65535]")
-	}
-	return nil
-}
-
-func DefaultLocalDataplaneTokenServerConfig() *LocalDataplaneTokenServerConfig {
-	return &LocalDataplaneTokenServerConfig{
-		Port: 5679,
-	}
-}
-
-// Dataplane Token Server configuration of server that is available on public interface
-type PublicDataplaneTokenServerConfig struct {
-	// If true then Dataplane Token Server is exposed on public interface
-	Enabled bool `yaml:"enabled" envconfig:"kuma_dataplane_token_server_public_enabled"`
-	// Interface on which the server will be exposed
-	Interface string `yaml:"interface" envconfig:"kuma_dataplane_token_server_public_interface"`
-	// Port on which the server will be exposed. If not specified (0) then port from local configuration will be used
-	Port uint32 `yaml:"port" envconfig:"kuma_dataplane_token_server_public_port"`
-	// Path to TLS certificate file
-	TlsCertFile string `yaml:"tlsCertFile" envconfig:"kuma_dataplane_token_server_public_tls_cert_file"`
-	// Path to TLS key file
-	TlsKeyFile string `yaml:"tlsKeyFile" envconfig:"kuma_dataplane_token_server_public_tls_key_file"`
-	// Directory of authorized client certificates
-	ClientCertsDir string `yaml:"clientCertsDir" envconfig:"kuma_dataplane_token_server_public_client_certs_dir"`
-}
-
-var _ config.Config = &PublicDataplaneTokenServerConfig{}
-
-func DefaultPublicDataplaneTokenServerConfig() *PublicDataplaneTokenServerConfig {
-	return &PublicDataplaneTokenServerConfig{
-		Enabled:        false,
-		Interface:      "",
-		Port:           0,
-		TlsCertFile:    "",
-		TlsKeyFile:     "",
-		ClientCertsDir: "",
-	}
-}
-
-func (p *PublicDataplaneTokenServerConfig) Sanitize() {
-}
-
-func (p *PublicDataplaneTokenServerConfig) Validate() error {
-	if p.Port > 65535 {
-		return errors.New("Port must be in the range [0, 65535]")
-	}
-	if p.Enabled {
-		if p.TlsCertFile == "" {
-			return errors.New("TlsCertFile cannot be empty if server is enabled")
-		}
-		if p.TlsKeyFile == "" {
-			return errors.New("TlsKeyFile cannot be empty if server is enabled")
-		}
-		if p.Interface == "" {
-			return errors.New("Interface cannot be empty if server is enabled")
-		}
-	}
-	return nil
-}
diff --git a/pkg/core/bootstrap/autoconfig.go b/pkg/core/bootstrap/autoconfig.go
index 54a923517..9aa6eedd4 100644
--- a/pkg/core/bootstrap/autoconfig.go
+++ b/pkg/core/bootstrap/autoconfig.go
@@ -5,15 +5,12 @@ import (
 	"io/ioutil"
 	"net/url"
 	"os"
-	"reflect"
 	"strings"
 
-	admin_server "github.com/kumahq/kuma/pkg/config/admin-server"
-	"github.com/kumahq/kuma/pkg/config/api-server/catalog"
-	token_server "github.com/kumahq/kuma/pkg/config/token-server"
-
 	"github.com/pkg/errors"
 
+	"github.com/kumahq/kuma/pkg/config/api-server/catalog"
+
 	kuma_cp "github.com/kumahq/kuma/pkg/config/app/kuma-cp"
 	config_core "github.com/kumahq/kuma/pkg/config/core"
 	"github.com/kumahq/kuma/pkg/core"
@@ -130,29 +127,6 @@ func autoconfigureKds(cfg *kuma_cp.Config) error {
 }
 
 func autoconfigureAdminServer(cfg *kuma_cp.Config) {
-	// use old dataplane token server config values for admin server
-	if !reflect.DeepEqual(cfg.DataplaneTokenServer, token_server.DefaultDataplaneTokenServerConfig()) {
-		autoconfigureLog.Info("Deprecated DataplaneTokenServer config is used. It will be removed in the next major version of Kuma - use AdminServer config instead.")
-		cfg.AdminServer = &admin_server.AdminServerConfig{
-			Apis: &admin_server.AdminServerApisConfig{
-				DataplaneToken: &admin_server.DataplaneTokenApiConfig{
-					Enabled: cfg.DataplaneTokenServer.Enabled,
-				},
-			},
-			Local: &admin_server.LocalAdminServerConfig{
-				Port: cfg.DataplaneTokenServer.Local.Port,
-			},
-			Public: &admin_server.PublicAdminServerConfig{
-				Enabled:        cfg.DataplaneTokenServer.Public.Enabled,
-				Interface:      cfg.DataplaneTokenServer.Public.Interface,
-				Port:           cfg.DataplaneTokenServer.Public.Port,
-				TlsCertFile:    cfg.DataplaneTokenServer.Public.TlsCertFile,
-				TlsKeyFile:     cfg.DataplaneTokenServer.Public.TlsKeyFile,
-				ClientCertsDir: cfg.DataplaneTokenServer.Public.ClientCertsDir,
-			},
-		}
-	}
-
 	if cfg.AdminServer.Public.Enabled && cfg.AdminServer.Public.Port == 0 {
 		cfg.AdminServer.Public.Port = cfg.AdminServer.Local.Port
 	}
diff --git a/pkg/sds/server/components.go b/pkg/sds/server/components.go
index 28726f346..a8c9c8900 100644
--- a/pkg/sds/server/components.go
+++ b/pkg/sds/server/components.go
@@ -40,7 +40,7 @@ func NewKubeAuthenticator(rt core_runtime.Runtime) (sds_auth.Authenticator, erro
 
 func NewUniversalAuthenticator(rt core_runtime.Runtime) (sds_auth.Authenticator, error) {
 	dpResolver := DefaultDataplaneResolver(rt.ResourceManager())
-	if !rt.Config().DataplaneTokenServer.Enabled {
+	if !rt.Config().AdminServer.Apis.DataplaneToken.Enabled {
 		return universal_sds_auth.NewNoopAuthenticator(dpResolver), nil
 	}
 	issuer, err := builtin.NewDataplaneTokenIssuer(rt)


Test patch:
diff --git a/pkg/api-server/config_ws_test.go b/pkg/api-server/config_ws_test.go
index 9a02408ac..08c5f700c 100644
--- a/pkg/api-server/config_ws_test.go
+++ b/pkg/api-server/config_ws_test.go
@@ -77,20 +77,6 @@ var _ = Describe("Config WS", func() {
             },
             "port": 5682
           },
-          "dataplaneTokenServer": {
-            "enabled": true,
-            "local": {
-              "port": 5679
-            },
-            "public": {
-              "clientCertsDir": "",
-              "enabled": false,
-              "interface": "",
-              "port": 0,
-              "tlsCertFile": "",
-              "tlsKeyFile": ""
-            }
-          },
           "adminServer": {
             "local": {
               "port": 5679
diff --git a/pkg/config/loader_test.go b/pkg/config/loader_test.go
index f443cf780..f5e58cd90 100644
--- a/pkg/config/loader_test.go
+++ b/pkg/config/loader_test.go
@@ -94,15 +94,6 @@ var _ = Describe("Config loader", func() {
 			Expect(cfg.ApiServer.ReadOnly).To(Equal(true))
 			Expect(cfg.ApiServer.CorsAllowedDomains).To(Equal([]string{"https://kuma", "https://someapi"}))
 
-			Expect(cfg.DataplaneTokenServer.Enabled).To(BeTrue())
-			Expect(cfg.DataplaneTokenServer.Local.Port).To(Equal(uint32(1111)))
-			Expect(cfg.DataplaneTokenServer.Public.Enabled).To(BeTrue())
-			Expect(cfg.DataplaneTokenServer.Public.Port).To(Equal(uint32(2222)))
-			Expect(cfg.DataplaneTokenServer.Public.Interface).To(Equal("192.168.0.1"))
-			Expect(cfg.DataplaneTokenServer.Public.TlsKeyFile).To(Equal("/tmp/key"))
-			Expect(cfg.DataplaneTokenServer.Public.TlsCertFile).To(Equal("/tmp/cert"))
-			Expect(cfg.DataplaneTokenServer.Public.ClientCertsDir).To(Equal("/tmp/certs"))
-
 			Expect(cfg.MonitoringAssignmentServer.GrpcPort).To(Equal(uint32(3333)))
 			Expect(cfg.MonitoringAssignmentServer.AssignmentRefreshInterval).To(Equal(12 * time.Second))
 
@@ -175,17 +166,6 @@ apiServer:
   corsAllowedDomains:
     - https://kuma
     - https://someapi
-dataplaneTokenServer:
-  enabled: true
-  local:
-    port: 1111
-  public:
-    enabled: true
-    interface: 192.168.0.1
-    port: 2222
-    tlsCertFile: /tmp/cert
-    tlsKeyFile: /tmp/key
-    clientCertsDir: /tmp/certs
 monitoringAssignmentServer:
   grpcPort: 3333
   assignmentRefreshInterval: 12s
@@ -260,14 +240,6 @@ defaults:
 				"KUMA_STORE_CACHE_EXPIRATION_TIME":                              "3s",
 				"KUMA_API_SERVER_READ_ONLY":                                     "true",
 				"KUMA_API_SERVER_PORT":                                          "9090",
-				"KUMA_DATAPLANE_TOKEN_SERVER_ENABLED":                           "true",
-				"KUMA_DATAPLANE_TOKEN_SERVER_LOCAL_PORT":                        "1111",
-				"KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_ENABLED":                    "true",
-				"KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_INTERFACE":                  "192.168.0.1",
-				"KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_PORT":                       "2222",
-				"KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_TLS_KEY_FILE":               "/tmp/key",
-				"KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_TLS_CERT_FILE":              "/tmp/cert",
-				"KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_CLIENT_CERTS_DIR":           "/tmp/certs",
 				"KUMA_MONITORING_ASSIGNMENT_SERVER_GRPC_PORT":                   "3333",
 				"KUMA_MONITORING_ASSIGNMENT_SERVER_ASSIGNMENT_REFRESH_INTERVAL": "12s",
 				"KUMA_ADMIN_SERVER_APIS_DATAPLANE_TOKEN_ENABLED":                "true",
diff --git a/pkg/core/bootstrap/autoconfig_test.go b/pkg/core/bootstrap/autoconfig_test.go
index ad9bfd885..c70ab1e37 100644
--- a/pkg/core/bootstrap/autoconfig_test.go
+++ b/pkg/core/bootstrap/autoconfig_test.go
@@ -30,14 +30,14 @@ var _ = Describe("Auto configuration", func() {
 			// and
 			Expect(*cfg.ApiServer.Catalog).To(Equal(given.expectedCatalogConfig))
 		},
-		Entry("with public settings for dataplane token server", testCase{
+		Entry("with public settings for admin server", testCase{
 			cpConfig: func() kuma_cp.Config {
 				cfg := kuma_cp.DefaultConfig()
 				cfg.General.AdvertisedHostname = "kuma.internal"
-				cfg.DataplaneTokenServer.Local.Port = 1111
-				cfg.DataplaneTokenServer.Public.Enabled = true
-				cfg.DataplaneTokenServer.Public.Interface = "192.168.0.1"
-				cfg.DataplaneTokenServer.Public.Port = 2222
+				cfg.AdminServer.Local.Port = 1111
+				cfg.AdminServer.Public.Enabled = true
+				cfg.AdminServer.Public.Interface = "192.168.0.1"
+				cfg.AdminServer.Public.Port = 2222
 				cfg.BootstrapServer.Port = 3333
 				cfg.ApiServer.Port = 1234
 				return cfg
@@ -66,9 +66,9 @@ var _ = Describe("Auto configuration", func() {
 			cpConfig: func() kuma_cp.Config {
 				cfg := kuma_cp.DefaultConfig()
 				cfg.General.AdvertisedHostname = "kuma.internal"
-				cfg.DataplaneTokenServer.Local.Port = 1111
-				cfg.DataplaneTokenServer.Public.Enabled = true
-				cfg.DataplaneTokenServer.Public.Interface = "192.168.0.1"
+				cfg.AdminServer.Local.Port = 1111
+				cfg.AdminServer.Public.Enabled = true
+				cfg.AdminServer.Public.Interface = "192.168.0.1"
 				cfg.BootstrapServer.Port = 3333
 				return cfg
 			},
@@ -92,11 +92,11 @@ var _ = Describe("Auto configuration", func() {
 				},
 			},
 		}),
-		Entry("without public settings for dataplane token server", testCase{
+		Entry("without public settings for admin server", testCase{
 			cpConfig: func() kuma_cp.Config {
 				cfg := kuma_cp.DefaultConfig()
 				cfg.General.AdvertisedHostname = "kuma.internal"
-				cfg.DataplaneTokenServer.Local.Port = 1111
+				cfg.AdminServer.Local.Port = 1111
 				cfg.BootstrapServer.Port = 3333
 				return cfg
 			},
@@ -123,7 +123,7 @@ var _ = Describe("Auto configuration", func() {
 		Entry("without dataplane token server", testCase{
 			cpConfig: func() kuma_cp.Config {
 				cfg := kuma_cp.DefaultConfig()
-				cfg.DataplaneTokenServer.Enabled = false
+				cfg.AdminServer.Apis.DataplaneToken.Enabled = false
 				return cfg
 			},
 			expectedCatalogConfig: catalog.CatalogConfig{
@@ -150,10 +150,10 @@ var _ = Describe("Auto configuration", func() {
 			cpConfig: func() kuma_cp.Config {
 				cfg := kuma_cp.DefaultConfig()
 				cfg.General.AdvertisedHostname = "kuma.internal"
-				cfg.DataplaneTokenServer.Local.Port = 1111
-				cfg.DataplaneTokenServer.Public.Enabled = true
-				cfg.DataplaneTokenServer.Public.Interface = "192.168.0.1"
-				cfg.DataplaneTokenServer.Public.Port = 2222
+				cfg.AdminServer.Local.Port = 1111
+				cfg.AdminServer.Public.Enabled = true
+				cfg.AdminServer.Public.Interface = "192.168.0.1"
+				cfg.AdminServer.Public.Port = 2222
 				cfg.BootstrapServer.Port = 3333
 				cfg.ApiServer.Catalog.Bootstrap.Url = "https://bootstrap.kuma.com:1234"
 				cfg.ApiServer.Catalog.MonitoringAssignment.Url = "grpcs://mads.kuma.com:1234"
@@ -215,48 +215,6 @@ var _ = Describe("Auto configuration", func() {
 		Expect(cfg.BootstrapServer.Params.XdsPort).To(Equal(uint32(1234)))
 	})
 
-	It("should autoconfigure admin server from old dataplane token server config", func() {
-		// given
-		cfg := kuma_cp.DefaultConfig()
-		cfg.DataplaneTokenServer.Local.Port = 1111
-		cfg.DataplaneTokenServer.Public.Enabled = true
-		cfg.DataplaneTokenServer.Public.Interface = "192.168.0.1"
-		cfg.DataplaneTokenServer.Public.Port = 2222
-
-		// when
-		err := autoconfigure(&cfg)
-
-		// then
-		Expect(err).ToNot(HaveOccurred())
-
-		// and
-		Expect(cfg.AdminServer.Public.Interface).To(Equal("192.168.0.1"))
-		Expect(cfg.AdminServer.Public.Enabled).To(BeTrue())
-		Expect(cfg.AdminServer.Public.Port).To(Equal(uint32(2222)))
-		Expect(cfg.AdminServer.Local.Port).To(Equal(uint32(1111)))
-	})
-
-	It("should not rewrite values of admin server when old dataplane token server config was not changed", func() {
-		// given
-		cfg := kuma_cp.DefaultConfig()
-		cfg.AdminServer.Local.Port = 1111
-		cfg.AdminServer.Public.Enabled = true
-		cfg.AdminServer.Public.Interface = "192.168.0.1"
-		cfg.AdminServer.Public.Port = 2222
-
-		// when
-		err := autoconfigure(&cfg)
-
-		// then
-		Expect(err).ToNot(HaveOccurred())
-
-		// and
-		Expect(cfg.AdminServer.Public.Interface).To(Equal("192.168.0.1"))
-		Expect(cfg.AdminServer.Public.Enabled).To(BeTrue())
-		Expect(cfg.AdminServer.Public.Port).To(Equal(uint32(2222)))
-		Expect(cfg.AdminServer.Local.Port).To(Equal(uint32(1111)))
-	})
-
 	It("should autoconfigure MonitoringAssignment server", func() {
 		// given
 		cfg := kuma_cp.DefaultConfig()
diff --git a/tools/e2e/examples/docker-compose/docker-compose.yaml b/tools/e2e/examples/docker-compose/docker-compose.yaml
index 0c732bf63..c303e5c0d 100644
--- a/tools/e2e/examples/docker-compose/docker-compose.yaml
+++ b/tools/e2e/examples/docker-compose/docker-compose.yaml
@@ -17,12 +17,12 @@ services:
     environment:
     # DNS name of the Kuma xDS server
     - KUMA_GENERAL_ADVERTISED_HOSTNAME=kuma-control-plane
-    - KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_ENABLED=true
-    - KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_INTERFACE=0.0.0.0
-    - KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_PORT=5684 # otherwise there would be conflict with local port
-    - KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_TLS_CERT_FILE=/certs/server/cert.pem
-    - KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_TLS_KEY_FILE=/certs/server/key.pem
-    - KUMA_DATAPLANE_TOKEN_SERVER_PUBLIC_CLIENT_CERTS_DIR=/certs/client
+    - KUMA_ADMIN_SERVER_PUBLIC_ENABLED=true
+    - KUMA_ADMIN_SERVER_PUBLIC_INTERFACE=0.0.0.0
+    - KUMA_ADMIN_SERVER_PUBLIC_PORT=5684 # otherwise there would be conflict with local port
+    - KUMA_ADMIN_SERVER_PUBLIC_TLS_CERT_FILE=/certs/server/cert.pem
+    - KUMA_ADMIN_SERVER_PUBLIC_TLS_KEY_FILE=/certs/server/key.pem
+    - KUMA_ADMIN_SERVER_PUBLIC_CLIENT_CERTS_DIR=/certs/client
     expose:
     - "5678"
     - "5679"