Skip to content

Commit

Permalink
Merge pull request #185 from percona/new_commands_db_namespaces
Browse files Browse the repository at this point in the history
New command for provisioning DB namespaces
  • Loading branch information
rasika-chivate authored Jan 7, 2025
2 parents 60a71ef + 348ffc7 commit 2929e6f
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 35 deletions.
86 changes: 86 additions & 0 deletions docs/administer/manage_namespaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Namespaces management

The management of namespaces plays a vital role in efficiently organizing and allocating resources within Percona Everest.

## Add new namespaces

You can run the following command for provisioning a new DB namespace:

```sh
everestctl namespaces add [NAMESPACE]
```

The command supports the following flags:

`--operator.mongodb=<bool>`

`--operator.postgresql=<bool>`

`--operator.xtradb-cluster=<bool>`

`--take-ownership` - Allows Percona Everest to manage an existing Kubernetes namespace by adding the necessary labels. Without this flag, Percona Everest will attempt to create the namespace and throw an error if it already exists. Use this flag to take over an existing namespace.

??? example "Example"
```sh
everestctl namespaces add development --operator.postgresql=false
✓ Installing namespace 'development'
```
In the above command, we did not specify the MongoDB and MySQL operators. Therefore, by default, Percona Everest assumes these operators are true and will add them.

```sh
everestctl namespaces add production

? Which operators do you want to install? MongoDB
✓ Installing namespace 'production'
```

!!! note
The `everestctl install` command allows you create database namespaces during the initial installation. However, it cannot be rerun to add more database namespaces. To create additional database namespaces after installation, use the namespaces add command.

- To provision a DB namespace after installation, use the command `everestctl namespaces add`.

- You may choose to skip the DB namespace installation in the `everestctl install` command.

## Update namespaces

!!! info "Important"
Removing operators with `update` is currently not supported.

You can run the following command to add more operators to an existing DB namespace.


```sh
everestctl namespaces update [NAMESPACE]
```

??? example "Example"
```sh
everestctl namespaces update development

? Which operators do you want to install? MongoDB
✓ Updating namespace 'development'
```


## Delete namespaces

You can run the following command for deleting namespaces:

```sh
everestctl namespaces remove [NAMESPACE]
```

- This command deletes only the specified namespace, as long as it is managed by Percona Everest.

- Setting `--keep-namespace` deletes all resources within the namespace (e.g., operators, DatabaseClusters, BackupStorages) while preserving the namespace itself. Use this option to clean up the namespace without removing it.


??? example "Example"
```sh
everestctl namespaces remove development

✓ Deleting database clusters in namespace 'development'
✓ Deleting backup storages in namespace 'development'
✓ Deleting monitoring instances in namespace 'development'
✓ Deleting namespace 'development'
```
2 changes: 1 addition & 1 deletion docs/administer/rbac.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Role Based Access Control
# Role-based access control (RBAC)

!!! warning "Disclaimer"
RBAC is currently in **Technical Preview**. Early adopters are advised to use this feature only for testing purposes and not in production environments.
Expand Down
Binary file modified docs/images/everest_multinamespaces.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 3 additions & 5 deletions docs/use/monitor_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To use monitoring in Percona Everest, you should have a PMM instance up and runn

For information on installing PMM, see the [documentation](https://docs.percona.com/percona-monitoring-and-management/setting-up/index.html).

## Add monitoring
## Add monitoring endpoint

To add monitoring in Percona Everest from the UI:
{.power-number}
Expand All @@ -44,8 +44,7 @@ To add monitoring in Percona Everest from the UI:
6. Click **Add**.



## Edit monitoring
## Edit monitoring endpoint

To edit a monitoring endpoint from the Percona Everest UI:
{.power-number}
Expand All @@ -65,7 +64,7 @@ To edit a monitoring endpoint from the Percona Everest UI:
4. Click **Add**.


## Delete monitoring
## Delete monitoring endpoint

To delete a monitoring endpoint from the Percona Everest UI:
{.power-number}
Expand All @@ -88,7 +87,6 @@ To delete a monitoring endpoint from the Percona Everest UI:







48 changes: 21 additions & 27 deletions docs/use/multi-namespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
In Kubernetes, the concept of namespaces enables you to create isolated groups of resources within a single cluster. These namespaces provide a way to organize and manage resources without interfering with other resources within the same cluster.


!!! warning "Important"
!!! info "Important"
Resource names must be unique within a specific namespace but not across different namespaces.


Expand All @@ -15,7 +15,7 @@ For example, you can deploy different environments like production, development,

## Default namespaces in Percona Everest

!!! warning "Important"
!!! info "Important"
The following namespaces are restricted and cannot be used for deploying databases.

Percona Everest will create the following namespaces by default. You can see these default namespaces while Percona Everest is being installed.
Expand All @@ -30,41 +30,35 @@ To set up the namespaces that Percona Everest will manage and where you can depl

The following holds true for multiple namespaces:

- You can configure multiple namespaces in Percona Everest.
- You can [configure multiple namespaces](../administer/manage_namespaces.md#add-new-namespaces) in Percona Everest using the `everestctl namespaces add [NAMESPACE]` command.

- You can install different operators in various namespaces by running the install command multiple times.
- You can [install different operators](../administer/manage_namespaces.md#update-namespaces) in various namespaces using the `everestctl namespaces update [NAMESPACE]` command.

See the following example for more details:

??? info "Example: Installing various operators in different namespaces"

To install various operators in different namespaces, such as MySQL and MongoDB operator in namespaces dev and testing, and PostgreSQL operator in namespaces production and staging, run the following commands:
{.power-number}

1. `everestctl install`
??? example "Example: Configuring multiple namesapces and installing various operators within those namespaces"
To install various operators in different namespaces, such as MongoDB and MySQL operator in namespace production, and PostgreSQL operator in namespace development, run the following commands:
{.power-number}

1. `everestctl namespaces add development`
??? example "Expected output"
??? example "Expected output"
```sh
? Which operators do you want to install? PostgreSQL
✓ Installing namespace 'development'
```

```sh
? Namespaces managed by Everest [comma separated] dev,testing
? What operators do you want to install? MySQL, MongoDB
```
2. `everestctl namespaces add production`.

2. Rerun the `everestctl install` command to install the PostgreSQL operator in the production and staging namespaces.
??? example "Expected output"
```sh
? Which operators do you want to install? MySQL, MongoDB
✓ Installing namespace 'production'
```


??? example "Expected output"
Go to Percona Everest UI and navigate to <i class="uil uil-cog"></i> **Settings > Namespaces**. A list of all the namespaces that you have created will appear here.

```sh
? Namespaces managed by Everest [comma separated] production,staging
? What operators do you want to install? PostgreSQL
```


Go to Percona Everest UI and navigate to <i class="uil uil-cog"></i> **Settings > Namespaces**. A list of all the namespaces that you have created will appear here.

![!image](../images/everest_multinamespaces.png)
![!image](../images/everest_multinamespaces.png)

## Deploy the database in your namespace

Expand Down
5 changes: 3 additions & 2 deletions mkdocs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ nav:
- Administer:
- User management: administer/manage_users.md
- Single sign-on (SSO): administer/Idp_integration.md
- Access Control:
- RBAC: administer/rbac.md
- Role-based access control: administer/rbac.md
- Namespaces management: administer/manage_namespaces.md

- Use:
- Database view: use/database_view.md
- Provision a database: use/db_provision.md
Expand Down

0 comments on commit 2929e6f

Please sign in to comment.