Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds velaux sql database docs #1280

Merged
merged 3 commits into from
Sep 16, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ kubectl scale deploy -n vela-system kubevela-cluster-gateway --replicas=3

VelaUX is an addon, it composed by 3 major parts: nginx for frontend, APIServer as backend, and its database.

We strongly recommend to use high availability mongodb cluster as the database driver. The frontend and backend are both stateless services, just configure multiple replicas for them. As a result, the high availability installation command just like below:
We strongly recommend to use high availability mongodb, mysql(beta) or postgresql(beta) cluster as the database driver. The frontend and backend are both stateless services, just configure multiple replicas for them. As a result, the high availability installation command just like below:

```
vela addon enable velaux dbType=mongodb dbURL=mongodb://<MONGODB_USER>:<MONGODB_PASSWORD>@<MONGODB_URL> replicas=3
```
You can refer [Setup with the database](../../reference/addons/velaux.md#setup-with-the-database) for more info.
108 changes: 106 additions & 2 deletions docs/reference/addons/velaux.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: VelaUX
---

import Tabs from '@theme/Tabs';
chivalryq marked this conversation as resolved.
Show resolved Hide resolved
import TabItem from '@theme/TabItem';

VelaUX provides the UI console of KubeVela.

![alt](../../resources/velaux-view.jpg)
Expand Down Expand Up @@ -126,9 +129,12 @@ Please make sure the certificate matches the domain.
vela addon enable velaux domain=example.doamin.com gatewayDriver=traefik secretName=velaux-cert
```

## Setup with MongoDB database
## Setup with the database

VelaUX supports Kubernetes, MongoDB, MySQL and PostgreSQL as the database. the default is Kubernetes. We strongly advise using the databases other than Kubernetes to power your production environment.

VelaUX supports Kubernetes and MongoDB as the database. the default is Kubernetes. We strongly advise using the MongoDB database to power your production environment.
<Tabs className="unique-tabs" groupId="os">
<TabItem label="MongoDB" value="mongodb">

```shell script
vela addon enable velaux dbType=mongodb dbURL=mongodb://<MONGODB_USER>:<MONGODB_PASSWORD>@<MONGODB_URL>
Expand Down Expand Up @@ -173,6 +179,104 @@ spec:
```

After deployed, let's get the root password from the secret `vela-system/velaux-db-mongodb`.
</TabItem>

<TabItem label="MySQL" value="mysql">

```shell script
vela addon enable velaux dbType=mysql dbURL=mysql://<MYSQL_USER>:<MYSQL_PASSWORD>@<MYSQL_HOST>:<MYSQL_PORT>/<MYSQL_DB_NAME>
```
> It's necessary to create the specified database in advance. You can find the relevant connection string parameters [here](https://github.com/go-sql-driver/mysql#parameters)

You can also deploy the MySQL with this application configuration:

> Your cluster must have a default storage class.

```yaml
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: velaux-db
namespace: vela-system
spec:
components:
- name: velaux-db
properties:
chart: mysql
repoType: helm
url: https://charts.bitnami.com/bitnami
values:
persistence:
size: 20Gi
version: 12.1.12
type: helm
policies:
- name: vela-system
properties:
clusters:
- local
namespace: vela-system
type: topology
workflow:
steps:
- name: vela-system
properties:
policies:
- vela-system
type: deploy
```

After deployed, let's get the root password from the secret `vela-system/velaux-db-mysql`.
</TabItem>

<TabItem label="PostgreSQL" value="postgresql">

```shell script
vela addon enable velaux dbType=postgresql dbURL=postgres://<POSTGRESQL_USER>:<POSTGRESQL_PASSWORD>@<POSTGRESQL_HOST>:<POSTGRESQL_PORT>/<POSTGRESQL_DB_NAME>
```
> It's necessary to create the specified database in advance.

You can also deploy the PostgreSQL with this application configuration:

> Your cluster must have a default storage class.

```yaml
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: velaux-db
namespace: vela-system
spec:
components:
- name: velaux-db
properties:
chart: postgresql
repoType: helm
url: https://charts.bitnami.com/bitnami
values:
persistence:
size: 20Gi
version: 12.1.12
type: helm
policies:
- name: vela-system
properties:
clusters:
- local
namespace: vela-system
type: topology
workflow:
steps:
- name: vela-system
properties:
policies:
- vela-system
type: deploy
```

After deployed, let's get the root password from the secret `vela-system/velaux-db-postgresql`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to get the password? Give a shell command?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NeerajGartia21 How is this going?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not able to fetch the secret in my local env. Can you please give it a try?

</TabItem>
</Tabs>

## Specify the addon image

Expand Down
Loading