percona / percona-everest-cli

Apache License 2.0
6 stars 5 forks source link

EVEREST-633 Multi environment support #211

Closed gen1us2k closed 11 months ago

gen1us2k commented 1 year ago

CHANGE DESCRIPTION

Problem: EVEREST-633

Enables multi-namespace support for the CLI

Solution details Multi-namespaces might be a challenge because of the difference between deploying operators. Everest deploys everest-operator with multi-namespace support and handles RBAC issues automatically while it deploys all other operators in the namespaced mode.

Another challenge is that during the provisioning the CLI creates OperatorGroup for the namespace to create service accounts with the proper permissions. Having an operator group with multiple values in targetNamespaces automatically makes every operator that is deployed to the namespace cluster-wide.

We had a discussion about the installation-namespace and additional-namespaces or managed-namespaces in the past and it looks like the hardcoding of percona-everest namespace for the everest-operator and everest-backend is the best way to provide a good UX for end users. Also, having --namespace flag and changing it from string to string array adds multi namespace support and keeps backward compatibility.

Since there's no way to get namespaces for the service account using standard tools the CLI creates a configmap with the configuration and once it's updated, the CLI restarts everest-operator and everest-backend when a new operator is added.

It misses monitoring changes but they will be added after merging backend changes to the main because it requires running a VM agent per namespace

CHECKLIST

Jira

Tests

codecov-commenter commented 11 months ago

Codecov Report

Attention: 476 lines in your changes are missing coverage. Please review.

Comparison is base (6e81abe) 5.26% compared to head (93bd8b2) 5.38%.

Files Patch % Lines
pkg/install/install.go 0.00% 172 Missing :warning:
...kg/kubernetes/client/mock_kube_client_connector.go 0.00% 149 Missing :warning:
pkg/kubernetes/kubernetes.go 19.01% 131 Missing and 1 partial :warning:
pkg/kubernetes/client/client.go 0.00% 23 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #211 +/- ## ======================================== + Coverage 5.26% 5.38% +0.11% ======================================== Files 13 13 Lines 2866 3177 +311 ======================================== + Hits 151 171 +20 - Misses 2688 2979 +291 Partials 27 27 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

gen1us2k commented 11 months ago

@michal-kralik I added them yesterday https://github.com/percona/percona-everest-cli/blob/3b6d7213f7ecb884e0855dce84d253ae70b6d59b/cli-tests/tests/flow/multi-namespace-mongo-operator.spec.ts#L72-L86