# Kubernetes

## Requirements

Ensure your Kubernetes cluster meets the minimum requirements of 4 CPUs and 8 GiB of memory for this tutorial.&#x20;

You either have to run a [standalone database instance](/on-premise/install-and-update/recommendations/running-a-standalone-database-instance.md) or make sure standard `PersistentVolumeClaim` exists in your cluster.

## Installation steps

#### Step 1: Obtain UI Bakery Kubernetes Configs

UI Bakery configs are available in <https://github.com/uibakery/self-hosted> repository in `kubernetes` folder.&#x20;

You can download the repository with the following command:&#x20;

```
git clone https://github.com/uibakery/self-hosted.git
```

#### Step 2: Fill the required environment variables

By default, all variables are defined in `ui-bakery-configmap.yaml`. To run UI Bakery you need to provide the following variables:

* `UI_BAKERY_APP_SERVER_NAME` - your {server ip address}:3030, for example `http://123.123.123.123:3030;`&#x20;
* `UI_BAKERY_LICENSE_KEY` - get it from the UI Bakery team;

#### Step 3: Apply configuration on the cluster

Run `kubectl apply -f .` in the `kubernetes` folder. Please note that the application will be exposed on a public IP address on port 3030.

## Configuring UI Bakery

Once you've completed the installation steps, the UI Bakery app will be deployed on your cluster. You can sign up to test the installation. To prepare UI Bakery for production, further configuration is required.&#x20;

#### Setup standalone databases

UI Bakery comes with MySQL and Postgres databases defined in `ui-bakery-database.yaml` and `ui-bakery-internal-database.yaml`. It's recommended to migrate these databases to a managed solution or ensure they are secure and backed up. If you don't use the [Bakery Database](/extras/ui-bakery-postgres.md) feature, you can delete `ui-bakery-internal-database.yaml.`

#### Configure secrets

We recommend storing sensitive environment variables' values in Secrets instead of ConfigMap.

Use [the following guide to generate the secrets](/on-premise/install-and-update/recommendations/generate-custom-secrets.md) for the following variables:

```
UI_BAKERY_JWT_SECRET
UI_BAKERY_JWT_REFRESH_SECRET
UI_BAKERY_JWT_SERVICE_ACCOUNT_SECRET
UI_BAKERY_CREDENTIALS_SECRET
UI_BAKERY_MFA_SECRET
```

#### Configure domain name and HTTPS

After setting up Ingress, update `UI_BAKERY_APP_SERVER_NAME` environment variable to `https://yourdomain.com`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uibakery.io/on-premise/install-and-update/installing-on-premise-version/kubernetes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
