Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

EVEREST-633 Rename restricted namespaces #285

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions cli-tests/tests/flow/all-operators.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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();
Expand All @@ -64,29 +64,29 @@ 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"}',
]);

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',
);
Expand All @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions cli-tests/tests/flow/mongodb-operator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions cli-tests/tests/flow/pg-operator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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();
Expand All @@ -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]);
Expand Down
6 changes: 3 additions & 3 deletions cli-tests/tests/flow/pxc-operator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
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"
)
Expand Down Expand Up @@ -258,7 +258,7 @@
}

if !everestExists {
o.l.Info(fmt.Sprintf("Deploying Everest to %s", SystemNamespace))

Check failure on line 261 in pkg/install/install.go

View workflow job for this annotation

GitHub Actions / Check (1.21.x, false)

fmt.Sprintf can be replaced with string addition (perfsprint)
err = o.kubeClient.InstallEverest(ctx, SystemNamespace)
if err != nil {
return err
Expand Down
Loading