> For the complete documentation index, see [llms.txt](https://docs.uibakery.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uibakery.io/on-premise/install-and-update/installing-on-premise-version/kubernetes/aws-eks-with-fargate.md).

# AWS EKS with Fargate

This guide shows how to deploy UI Bakery on AWS EKS using Fargate. It is assumed that you have an active AWS account and have copied the [repository](https://github.com/uibakery/self-hosted) containing the necessary configuration files for the deployment process.

1. Create cluster with **eksctl**:
   * Install [eksctl](https://eksctl.io/) if it's not already installed.
   * Run `eksctl create cluster -f ./templates/eksctl-fargate.yaml`. If necessary, you can modify the region and cluster name specified in the file to match your desired configurations.
   * Once the command execution is finished, you will have successfully created your AWS EKS cluster.
2. Set up the MySQL database required for UI Bakery on AWS RDS.

   * Create a new RDS instance in your AWS account. It should have MySQL 8+ engine and be accessible by the cluster. Configure the remaining database settings according to your requirements.
   * Create database and user with the following permissions: `GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, LOCK TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE`
   * Put database credentials in `./kubernetes/ui-bakery-configmap` or in secrets for

     `bakery-back` service:

   ```yaml
   UI_BAKERY_DB_HOST: bakery.xxx.us-east-1.rds.amazonaws.com
   UI_BAKERY_DB_PORT: 3306
   UI_BAKERY_DB_DATABASE: bakery
   UI_BAKERY_DB_USERNAME: bakery
   UI_BAKERY_DB_PASSWORD: bakery
   ```

   * Delete the default db configuration file `./kubernetes/ui-bakery-database.yaml`
3. Configure the Elastic Load Balancer (ELB) for your UI Bakery deployment

   * Verify that all the cluster subnets have the required tags:
     * Each subnet should have the tag `kubernetes.io/cluster/ui-bakery=shared`.
     * Private subnets should have the tag `kubernetes.io/role/internal-elb=1`.
     * Public subnets should have the tag `kubernetes.io/role/elb=1`.
   * Install [AWS Load Balancer Controller add-on](https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html)
   * Add annotations for `bakery-gateway` service in `./kubernetes/ui-bakery-gateway` file:

   ```
     annotations:
       service.beta.kubernetes.io/aws-load-balancer-type: "external"
       service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip"
       service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"
   ```
4. Deploy UI Bakery with the following command `kubectl apply -f ./kubernetes`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.uibakery.io/on-premise/install-and-update/installing-on-premise-version/kubernetes/aws-eks-with-fargate.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
