Advanced Orchestrated container deployment (Helm)
Deploy CARTO Self-hosted using Kubernetes and Helm
This guide provides step-by-step instructions for deploying CARTO Self-Hosted on a Kubernetes cluster.
1. Prerequisites
Before you begin, ensure you have the following tools and assets ready.
To deploy CARTO Self-Hosted on Kubernetes, you need:
A CARTO Self-Hosted installation package containing your environment configuration and a license key. The package has two YAML files:
carto-secrets.yamlandcarto-values.yamlIf you don't have it yet, you can ask for it at [email protected].A domain you own, to which you can add a DNS record.
A Kubernetes cluster. To create a cluster, see documentation on Google Cloud Platform, AWS, and Azure. This cluster must fit our hardware and software requirements for Kubernetes.
A working installation of kubectl. To install kubectl, see documentation on Google Cloud Platform, AWS, and Azure.
Kubectl installed on your CLI.
A working installation of Helm v3 on version 3.6.0 or later.
Troubleshoot.sh installed to run the preflight checks (view step 4.)
1.2 Required Tools
A working installation of kubectl. To install kubectl, see documentation on Google Cloud Platform, AWS, and Azure.
Kubectl installed on your CLI.
A working installation of Helm v3 on version 3.6.0 or later.
Troubleshoot.sh installed to run the preflight checks (view step 4.)
1.3 Required ssets
CARTO Installation Package: You should have received a package from CARTO support containing two key files:
carto-values.yaml: Contains the base configuration.carto-secrets.yaml: Contains your license and private credentials.If you don't have it yet, you can ask for it at [email protected].
Kubernetes Cluster: A running cluster that meets CARTO's hardware and software requirements.
To create a cluster, see documentation on Google Cloud Platform, AWS, and Azure. This cluster must fit our hardware and software requirements for Kubernetes.
External PostgreSQL Database: A running PostgreSQL instance accessible from your cluster.
Cloud Storage Buckets: Pre-configured storage buckets on a supported provider (GCS, S3, or Azure Blob). You must visit the guide: Configure your own buckets (Helm)
DNS name and Certificate: You'll need a domain you own, to which you can add a DNS record.
2. Add your minimal customization
2.1 Understanding and reparing customizations.yaml
customizations.yamlThroughout this guide, you will be asked to configure various settings for your specific environment. All these settings will be placed in a single file that you create called customizations.yaml.
2.1.1 Overview
The CARTO Helm chart uses a layered configuration approach:
carto-values.yaml: Contains the default application settings (provided by CARTO). Do not edit this file.carto-secrets.yaml: Contains your license and private credentials (provided by CARTO). Do not edit this file.customizations.yaml: Contains your overrides and environment-specific settings. This is the only file you will modify.
When you run the installation, Helm merges these files, with the values in your customizations.yaml taking precedence.
2.1.2 Getting started: create empty customizations.yaml
customizations.yamlBefore you begin, create an empty file in your working directory named customizations.yaml. We recommend to have this along side the Customer Packages files (carto-values.yaml & carto-secrets.yaml)
As you follow this guide and complete each prerequisite (e.g., defining your domain, configuring your database, setting up storage buckets), you will add the corresponding configuration snippets to this single customizations.yaml file.
2.1.3 Customizations.yaml example:
Customizations.yaml example:After completing the "Domain" and "External Database" steps, your customizations.yaml file will look like this:
2.2 Domain
Add to the customizations.yaml file the domain name you want to use
3. External database
3.1 Overview
At this point, we are setting up the configuration of the external database. You need to provide:
An existing logical database
A user with full permissions over the logical database
The password for the user so that we can connect to the database
Create the secret with the PostgreSQL user password:
Edit
customizations.yaml:user: The carto user that you created.
user-password: The password for the user that you created.
database: The database that you've created.
3.2 Optional: Database connection SSL
In some scenarios, an SSL connection to the external database is required. In that case, you should add to customizations.yaml:
Mutual TLS connections between the external database and the APIs are not supported, so client certificates can't be configured on your external database
Azure PostgreSQL Flexible Server:
Make sure you add ownership over the carto database and all privileges over the schema.
Extensions must be allowlisted before creation. Run
az postgres flexible-server parameter set --name azure.extensions --value "pgcrypto"then create the extension as the admin user. See Azure docs.
4. Configure your storage buckets
CARTO Self-hosted platform needs access to some storage buckets to save some resources needed by the platform. These buckets are in charge of storing assets such as imported datasets, map snapshots and custom markers.
You can create and use your own storage buckets in any of the following supported storage providers:
And in order to configure them, there is a detailed guide "Configure your Own Buckets (Helm)" available that you should follow to complete the Self-Hosted configuration process.
5. Add Helm repository
At this point you should have your customization.yaml file populated with:
Your metadata database connection information.
Your buckets connection attributes
To add the CARTO Helm repo:
Type this command to add the helm repository
If you already have the repo, update it:
Search for the repo to confirm you can access the carto chart.
Create a file customizations.yaml with the domain name you want to use
user: The carto user that you created.
user-password: The password for the user that you created.
database: The database that you've created.
In some scenarios, an SSL connection to the external database is required. In that case, you should add to customizations.yaml:
6. Execute the preflight checks
Before installing CARTO Self-Hosted, you can use preflight checks to validate your configuration. Keep iterating until all checks pass—this ensures that your environment is fully prepared for installation.
As mentioned in the Requisites, you need to install the Trobleshoot.sh tools in order to run the Preflight checks. To install this tool using bash, you have to run the following commands:
Install the preflight and support-bundle plugins:
Check version
Use the following command to run the preflight checks:
The previous command performs validation checks to ensure that your customizations.yaml file is correctly configured for installing the CARTO platform and that you're infrastructure is ready to host a CARTO Self-Hosted installation.
Once the checks are complete, you will see the following output in your terminal:
If you encounter any issues during the preflight checks, verify the following:
PostgreSQL Configuration: Ensure your PostgreSQL credentials are correctly set up and that the database is accessible from your cluster.
External Proxy: If using an external proxy, confirm that it is correctly configured for connecting to external domains.
Egress Requirements: Check that your environment meets the necessary egress requirements for CARTO Self-Hosted.
Storage Configuration: Verify that your storage buckets are correctly set up and that the provided credentials are valid.
By addressing these areas, you can resolve common setup issues and proceed with a smooth installation.
7. Install CARTO
Use the following command to install CARTO in your Kubernetes cluster.
After installing CARTO, verify you have the required pods running by running the following command (It can take up to 5 minutes to have everything running):
8. Optional: Port-forward to localhost
After configuring CARTO App ingress you can manually test you can reach the platform by using forwarding to localhost.
Once all the services are running, verify the installation by port forwarding to localhost. Execute the following:
Add to your /etc/hosts the domain you will use:
echo "127.0.0.1 my.domain.com" >> /etc/hosts
9. Configure an HTTPS endpoint
The entry point to the CARTO Self-Hosted is through the router service. By default, it is configured in ClusterIP mode, and it's only accessible in your machine with kubectl port-forward).
The first step here is to make the router accessible using a LoadBalancer. This provides an externally-accessible IP address that we will later configure our DNS.
Add to customizations.yaml based on the cloud you are using:
After that, upgrade the cluster:
Get the EXTERNAL-IP of your CARTO Self-Hosted deployment with this command:
At this point, you need to configure a DNS record that points my.domain.com to the EXTERNAL-IP (34.136.204.51).
Use your own TLS certificate
By default, the package generates a self-signed certificate with a validity of 365 days.
If you want to add your own certificate you need to create a secret:
Edit customizations.yaml:
Apply the changes:
10. Post-installation checks
In order to verify CARTO Self Hosted was correctly installed, and it's functional, we recommend performing the following checks:
Sign in to your Self Hosted, create a user and a new organization.
Go to the
Connectionspage, in the left-hand menu, create a new connection to one of the available providers.Go to the
Data Explorerpage, click on theUploadbutton right next to theConnectionspanel. Import a dataset from a local file.Go back to the
Mapspage, and create a new map.In this new map, add a new layer from a table using the connection created in step 3.
Create a new layer from a SQL Query to the same table. You can use a simple query like:
Create a new layer from the dataset imported in step 4.
Make the map public, copy the sharing URL and open it in a new incognito window.
Go back to the
Mapspage, and verify your map appears there, and the map thumbnail represents the latest changes you made to the map.
Congrats! Once you've configured your custom buckets, you should have a production-ready deployment of CARTO Self-Hosted at https://my.domain.com
Analytics Toolbox in CARTO Self-Hosted
To fully leverage CARTO's capabilities you need to gain access to the Analytics Toolbox functions. This step is crucial to fully leverage CARTO's capabilities. Please refer to the documentation of your data warehouse provider for detailed instructions:
Troubleshooting
The following standard commands of kubectl could be used to debug possible issues that might arise:
kubectl logs and kubectl describe
Database
The container workspace-migrations (included at the pod carto-workspace-api-*) will be responsible for creating a new user carto_worskpace_admin and a database carto_workspace.
To debug possible errors with the connection of the external database you might need to check the logs of this container:
For further assistance check our Support page.
Last updated
Was this helpful?
