From 2d5be4c647f0d276cd35bc09209ac9483d0aae9f Mon Sep 17 00:00:00 2001 From: Diogo Recharte Date: Thu, 8 Feb 2024 09:58:03 +0000 Subject: [PATCH] EVEREST-633 rename restricted namespaces --- cli-tests/tests/flow/all-operators.spec.ts | 18 +++++++++--------- cli-tests/tests/flow/mongodb-operator.spec.ts | 6 +++--- cli-tests/tests/flow/pg-operator.spec.ts | 12 ++++++------ cli-tests/tests/flow/pxc-operator.spec.ts | 6 +++--- install.sh | 4 ++-- pkg/install/install.go | 4 ++-- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/cli-tests/tests/flow/all-operators.spec.ts b/cli-tests/tests/flow/all-operators.spec.ts index 43753b0f..54ef12d4 100644 --- a/cli-tests/tests/flow/all-operators.spec.ts +++ b/cli-tests/tests/flow/all-operators.spec.ts @@ -27,13 +27,13 @@ test.describe('Everest CLI install', async () => { test('install all operators', async ({ page, cli, request }) => { const verifyClusterResources = async () => { await test.step('verify installed operators in k8s', async () => { - const perconaEverestPodsOut = await cli.exec('kubectl get pods --namespace=percona-everest'); + const perconaEverestPodsOut = await cli.exec('kubectl get pods --namespace=everest-system'); await perconaEverestPodsOut.outContainsNormalizedMany([ 'everest-operator-controller-manager', ]); - const out = await cli.exec('kubectl get pods --namespace=percona-everest-all'); + const out = await cli.exec('kubectl get pods --namespace=everest-all'); await out.outContainsNormalizedMany([ 'percona-xtradb-cluster-operator', @@ -46,7 +46,7 @@ test.describe('Everest CLI install', async () => { await test.step('run everest install command', async () => { const out = await cli.everestExecSkipWizard( - `install --namespace=percona-everest-all`, + `install --namespace=everest-all`, ); await out.assertSuccess(); @@ -64,16 +64,16 @@ test.describe('Everest CLI install', async () => { await test.step('disable telemetry', async () => { // check that the telemetry IS NOT disabled by default - let out = await cli.exec('kubectl get deployments/percona-xtradb-cluster-operator --namespace=percona-everest-all -o yaml'); + let out = await cli.exec('kubectl get deployments/percona-xtradb-cluster-operator --namespace=everest-all -o yaml'); await out.outContains( 'name: DISABLE_TELEMETRY\n value: "false"', ); - out = await cli.exec(`kubectl patch service everest --patch '{"spec": {"type": "LoadBalancer"}}' --namespace=percona-everest`) + out = await cli.exec(`kubectl patch service everest --patch '{"spec": {"type": "LoadBalancer"}}' --namespace=everest-system`) await out.assertSuccess(); - out = await cli.everestExecSkipWizardWithEnv('upgrade --namespace=percona-everest-all', 'DISABLE_TELEMETRY=true'); + out = await cli.everestExecSkipWizardWithEnv('upgrade --namespace=everest-all', 'DISABLE_TELEMETRY=true'); await out.assertSuccess(); await out.outErrContainsNormalizedMany([ 'Subscriptions have been patched\t{"component": "upgrade"}', @@ -81,12 +81,12 @@ test.describe('Everest CLI install', async () => { await page.waitForTimeout(10_000); // check that the telemetry IS disabled - out = await cli.exec('kubectl get deployments/percona-xtradb-cluster-operator --namespace=percona-everest-all -o yaml'); + out = await cli.exec('kubectl get deployments/percona-xtradb-cluster-operator --namespace=everest-all -o yaml'); await out.outContains( 'name: DISABLE_TELEMETRY\n value: "true"', ); // check that the spec.type is not overrided - out = await cli.exec('kubectl get service/everest --namespace=percona-everest -o yaml'); + out = await cli.exec('kubectl get service/everest --namespace=everest-system -o yaml'); await out.outContains( 'type: LoadBalancer', ); @@ -99,7 +99,7 @@ test.describe('Everest CLI install', async () => { await out.assertSuccess(); // check that the deployment does not exist - out = await cli.exec('kubectl get deploy percona-everest -n percona-everest'); + out = await cli.exec('kubectl get deploy percona-everest -n everest-system'); await out.outErrContainsNormalizedMany([ 'Error from server (NotFound): deployments.apps "percona-everest" not found', diff --git a/cli-tests/tests/flow/mongodb-operator.spec.ts b/cli-tests/tests/flow/mongodb-operator.spec.ts index 01a55009..d217bc97 100644 --- a/cli-tests/tests/flow/mongodb-operator.spec.ts +++ b/cli-tests/tests/flow/mongodb-operator.spec.ts @@ -27,13 +27,13 @@ test.describe('Everest CLI install', async () => { test('install only mongodb-operator', async ({ page, cli, request }) => { const verifyClusterResources = async () => { await test.step('verify installed operators in k8s', async () => { - const perconaEverestPodsOut = await cli.exec('kubectl get pods --namespace=percona-everest'); + const perconaEverestPodsOut = await cli.exec('kubectl get pods --namespace=everest-system'); await perconaEverestPodsOut.outContainsNormalizedMany([ 'everest-operator-controller-manager', ]); - const out = await cli.exec('kubectl get pods --namespace=percona-everest-operators'); + const out = await cli.exec('kubectl get pods --namespace=everest-operators'); await out.outContainsNormalizedMany([ 'percona-server-mongodb-operator', @@ -49,7 +49,7 @@ test.describe('Everest CLI install', async () => { await test.step('run everest install command', async () => { const out = await cli.everestExecSkipWizard( - `install --operator.mongodb=true --operator.postgresql=false --operator.xtradb-cluster=false --namespace=percona-everest-operators`, + `install --operator.mongodb=true --operator.postgresql=false --operator.xtradb-cluster=false --namespace=everest-operators`, ); await out.assertSuccess(); diff --git a/cli-tests/tests/flow/pg-operator.spec.ts b/cli-tests/tests/flow/pg-operator.spec.ts index 72c13ca5..6f7188b2 100644 --- a/cli-tests/tests/flow/pg-operator.spec.ts +++ b/cli-tests/tests/flow/pg-operator.spec.ts @@ -27,13 +27,13 @@ test.describe('Everest CLI install', async () => { test('install only postgresql-operator', async ({ page, cli, request }) => { const verifyClusterResources = async () => { await test.step('verify installed operators in k8s', async () => { - const perconaEverestPodsOut = await cli.exec('kubectl get pods --namespace=percona-everest'); + const perconaEverestPodsOut = await cli.exec('kubectl get pods --namespace=everest-system'); await perconaEverestPodsOut.outContainsNormalizedMany([ 'everest-operator-controller-manager', ]); - const out = await cli.exec('kubectl get pods --namespace=percona-everest-operators'); + const out = await cli.exec('kubectl get pods --namespace=everest-operators'); await out.outContainsNormalizedMany([ 'percona-postgresql-operator', @@ -48,7 +48,7 @@ test.describe('Everest CLI install', async () => { await test.step('run everest install command', async () => { const out = await cli.everestExecSkipWizard( - `install --operator.mongodb=false --operator.postgresql=true --operator.xtradb-cluster=false --namespace=percona-everest-operators`, + `install --operator.mongodb=false --operator.postgresql=true --operator.xtradb-cluster=false --namespace=everest-operators`, ); await out.assertSuccess(); @@ -64,13 +64,13 @@ test.describe('Everest CLI install', async () => { await test.step('re-run everest install command', async () => { await page.waitForTimeout(60_000); - const operator = await cli.exec(`kubectl -n percona-everest get po | grep everest|awk {'print $1'}`); + const operator = await cli.exec(`kubectl -n everest-system get po | grep everest|awk {'print $1'}`); await operator.assertSuccess(); const out = await cli.everestExecSkipWizard( - `install --operator.mongodb=false --operator.postgresql=true --operator.xtradb-cluster=true --namespace=percona-everest-operators`, + `install --operator.mongodb=false --operator.postgresql=true --operator.xtradb-cluster=true --namespace=everest-operators`, ); - const restartedOperator = await cli.exec(`kubectl -n percona-everest get po | grep everest|awk {'print $1'}`); + const restartedOperator = await cli.exec(`kubectl -n everest-system get po | grep everest|awk {'print $1'}`); await restartedOperator.assertSuccess(); expect(operator.getStdOutLines()[0]).not.toEqual(restartedOperator.getStdOutLines()[0]); diff --git a/cli-tests/tests/flow/pxc-operator.spec.ts b/cli-tests/tests/flow/pxc-operator.spec.ts index 580502bf..c8e2ea24 100644 --- a/cli-tests/tests/flow/pxc-operator.spec.ts +++ b/cli-tests/tests/flow/pxc-operator.spec.ts @@ -27,13 +27,13 @@ test.describe('Everest CLI install', async () => { test('install only xtradb-cluster-operator', async ({ page, cli, request }) => { const verifyClusterResources = async () => { await test.step('verify installed operators in k8s', async () => { - const perconaEverestPodsOut = await cli.exec('kubectl get pods --namespace=percona-everest'); + const perconaEverestPodsOut = await cli.exec('kubectl get pods --namespace=everest-system'); await perconaEverestPodsOut.outContainsNormalizedMany([ 'everest-operator-controller-manager', ]); - const out = await cli.exec('kubectl get pods --namespace=percona-everest-operators'); + const out = await cli.exec('kubectl get pods --namespace=everest-operators'); await out.outContainsNormalizedMany([ 'percona-xtradb-cluster-operator', @@ -49,7 +49,7 @@ test.describe('Everest CLI install', async () => { await test.step('run everest install command', async () => { const out = await cli.everestExecSkipWizard( - `install --operator.mongodb=false --operator.postgresql=false --operator.xtradb-cluster=true --namespace=percona-everest-operators`, + `install --operator.mongodb=false --operator.postgresql=false --operator.xtradb-cluster=true --namespace=everest-operators`, ); await out.assertSuccess(); diff --git a/install.sh b/install.sh index 8d91ebd8..9e5b24c8 100755 --- a/install.sh +++ b/install.sh @@ -35,8 +35,8 @@ fi echo "Provisioning Everest with monitoring disabled" echo "If you want to enable monitoring please refer to the everest installation documentation." echo "" -./everestctl install --operator.mongodb=true --operator.postgresql=true --operator.xtradb-cluster=true --skip-wizard +./everestctl install --namespace everest --operator.mongodb=true --operator.postgresql=true --operator.xtradb-cluster=true --skip-wizard echo "Your provisioned Everest instance will be available at http://127.0.0.1:8080" echo "Exposing Everest using kubectl port-forwarding. You can expose it manually" -kubectl port-forward -n percona-everest deployment/percona-everest 8080:8080 +kubectl port-forward -n everest-system deployment/percona-everest 8080:8080 diff --git a/pkg/install/install.go b/pkg/install/install.go index b467ade5..d6ac1b2f 100644 --- a/pkg/install/install.go +++ b/pkg/install/install.go @@ -77,9 +77,9 @@ const ( dbsOperatorGroup = "everest-databases" // SystemNamespace is the namespace where everest is installed. - SystemNamespace = "percona-everest" + SystemNamespace = "everest-system" // monitoringNamespace is the namespace where the monitoring stack is installed. - monitoringNamespace = "percona-everest-monitoring" + monitoringNamespace = "everest-monitoring" // EverestMonitoringNamespaceEnvVar is the name of the environment variable that holds the monitoring namespace. EverestMonitoringNamespaceEnvVar = "MONITORING_NAMESPACE" )