tb infra¶
Helps you deploy Tinybird on a cloud service provider of your choice and manage custom regions. See Self-managed Tinybird Cloud.
To list, add, update, or remove infrastructure regions, you can also go to Settings, Managed regions in the Tinybird Cloud UI.
Subcommands¶
The following subcommands are available:
Subcommand | Description |
---|---|
init | Initializes the infrastructure and deploys Tinybird Local in a custom region. By default, the command is interactive and prompts you for the necessary information. |
add | Adds a new self-managed infrastructure region using an existing infrastructure URL. |
update | Updates the URL of an existing self-managed infrastructure region. |
rm NAME | Removes an existing infrastructure region. |
ls | Lists available infrastructure regions. |
tb infra init¶
Initializes the selected cloud infrastructure provider to host Tinybird Local.
Running the tb infra init
command requires the following components:
The following tools are required to deploy Tinybird Local on AWS:
- Terraform CLI to create the Kubernetes cluster.
- Kubectl CLI to manage your Kubernetes installation.
- AWS CLI with credentials configured.
Before initiating deployment, you need to set up the following in AWS:
- A zone and domain name in Route53 zone. Write down the hosted zone name and the zone ID for your domain.
- An EKS cluster with AWS Load Balancer Controller installed and external-dns configured. Configure both components with sufficient permissions to manage resources. Set the default storage class in the EKS cluster to
gp3-encrypted
with high IOPS and throughput.
The command requires the following information:
When prompted, enter the following information from the first step:
- AWS region. For example,
us-east-1
. - DNS zone name and record name.
- Kubernetes namespace. For example,
default
. - EKS storage class. For example,
gp3-encrypted
.
Review the changes before applying them. If you want to generate the files without applying them, use the --skip-apply
flag.
After the deployment is complete, tb infra
shows the URL to access your Tinybird Local instance. See tb infra for more information and settings.
The following options are available:
Option | Description |
---|---|
--name TEXT | Name for identifying the self-managed infrastructure region in Tinybird. |
--cloud-provider TEXT | Infrastructure provider. Possible values are: aws , gcp , azure . |
--cloud-region TEXT | AWS region, when using aws as the provider. |
--dns-zone-name TEXT | DNS zone name. |
--kubernetes-namespace TEXT | Kubernetes namespace for the deployment. |
--dns-record TEXT | DNS record name to create, without domain. For example, tinybird . |
--kubernetes-storage-class TEXT | Storage class for the Kubernetes StatefulSet. |
--skip-apply | Create all the configuration files without applying them. |
--auto-apply | Apply all the configuration automatically, without prompting for confirmation. |
The command always generates the following files inside the infra/<provider>
directory, where <provider>
is the infrastructure provider:
- config.json: Contains the configuration for the provider.
- k8s.yaml: Contains the Kubernetes configuration.
- main.tf: Contains the Terraform configuration.
tb infra add¶
Adds a new self-managed infrastructure region using an existing infrastructure URL. The command prompts you for the necessary information.
For example:
tb infra add Running against Tinybird Cloud: Workspace example_workspace Enter name: example Enter host: https://tinybird.example.com » Adding infrastructure 'example' in Tinybird... ✓ Infrastructure 'example' added » Required environment variables: TB_INFRA_TOKEN=example_token TB_INFRA_WORKSPACE=example_workspace TB_INFRA_ORGANIZATION=example_organization TB_INFRA_USER=user@example.com
The following options are available:
Option | Description |
---|---|
--name TEXT | Name for identifying the self-managed infrastructure in Tinybird. |
--host TEXT | Host for the infrastructure. |
tb infra update¶
Updates an existing infrastructure region.
For example:
tb infra update example --host https://tinybird-2.example.com Running against Tinybird Cloud: Workspace example_workspace » Updating infrastructure 'test' in Tinybird...
The following options are available:
Option | Description |
---|---|
--name TEXT | Name for identifying the self-managed infrastructure in Tinybird. |
--host TEXT | Host for the infrastructure. |
tb infra rm¶
Removes an existing infrastructure region.
For example:
tb infra rm example Running against Tinybird Cloud: Workspace example_workspace » Deleting infrastructure 'example' from Tinybird... ✓ Infrastructure 'example' deleted
tb infra ls¶
Lists all the infrastructure regions.
For example:
tb infra ls Running against Tinybird Cloud: Workspace example_workspace ** Infras: -------------------------------------------------------------------------- | name | host | -------------------------------------------------------------------------- | example | https://tinybird.example.com | | example2 | https://tinybird2.example.com | --------------------------------------------------------------------------