GCP
Provisioning Control Plane Infrastructure on GCP
There are steps in this guide where Truefoundry team will have to be involved. Please reach out to support@truefoundry.com to get the credentials
Setting up Truefoundry control plane on your own cloud involves creating the infrastructure to support the platform and then installing the platform itself.
Setting up Infrastructure
Requirements
These are the infrastructure components required to set up a production grade Truefoundry control plane.
If you have the below requirements already set up then skip directly to the Installation section
Requirements | Description | Reason for Requirement |
---|---|---|
Kubernetes Cluster | Any Kubernetes cluster will work here - we can also choose the compute-plane cluster itself to install Truefoundry helm chart. | The Truefoundry helm chart will be installed here. |
CloudSQL Postgres | Postgres >= 13 | The database is used by Truefoundry control plane to store all its metadata. |
GCS bucket | Any GCS bucket reachable from control-plane. | This is used by control-plane to store the intermediate code while building the docker image. |
Egress Access for TruefoundryAuth | Egress access to https://auth.truefoundry.com | This is needed to validate the users logging into Truefoundry so that licensing can be maintained. |
Egress access For Docker Registry | 1. public.ecr.aws 2. quay.io 3. ghcr.io 4. docker.io/truefoundrycloud 5. docker.io/natsio 6. nvcr.io 7. registry.k8s.io | This is to download docker images for Truefoundry, ArgoCD, NATS, ArgoRollouts, ArgoWorkflows, Istio. |
DNS with TLS/SSL | One endpoint to point to the control plane service (something like platform.example.com where example.com is your domain. There should also be a certificate with the domain so that the domains can be accessed over TLS.The control-plane url should be reachable from the compute-plane so that compute-plane cluster can connect to the control-plane | The developers will need to access the Truefoundry UI at domain that is provided here. |
User/ServiceAccount to provision the infrastructure | - Cloud SQL Admin- Security Admin - Service Account Admin - Service Account Token Creator - Service Account User - Storage Admin | These are the permissions required by the IAM user in GCP to create the entire control plane components. |
Permissions Required
We will be using OCLI (Onboarding CLI) to create the infrastructure. We will be using a locally setup gcloud CLI. Please make sure the user or service account authenticated with GCP has the following permissions -
- Cloud SQL Admin -
roles/cloudsql.admin
- Security Admin -
roles/iam.securityAdmin
- Service Account Admin -
roles/iam.serviceAccountAdmin
- Service Account Token Creator -
roles/iam.serviceAccountTokenCreator
- Service Account User -
roles/iam.serviceAccountUser
- Storage Admin -
roles/storage.admin
GCP Infra Architecture
Run Infra Provisioning using OCLI
Prerequisites
-
Install git if not already present.
-
Setup gcloud CLI
- Install gcloud cli == 474.x.x
- Install gke-gcloud-auth-plugin
- Authenticate with a user that has the above mentioned roles -
gcloud auth application-default login
- Set the project to be used for infra creation -
gcloud config set project truefoundry-devtest
Installing OCLI
-
Download the binary using the below command.
-
Make the binary executable and move it to
$PATH
-
Confirm by running the command
Configuring Input Config file
-
To create a new cluster, you would require your GCP
Project ID
andRegion
-
Run the following command to fill in the inputs interactively
-
For networking, there are two possible configurations:
- New VPC (Recommended) - This creates a new VPC for your new cluster.
- Existing VPC - You can enter your existing VPC and subnet IDs.
-
Once all the inputs are filled, a config file with the name
tfy-config.yaml
would be generated in your current directory -
Modify the file to enable control plane installation by setting
gcp.tfy_control_plane.enabled: true
. Below is the sample for the same:
Create the cluster
Run the following command to create the GKE cluster and IAM roles needed to provide access to various infrastructure components as per the inputs configured above.
This command may take around 30-45 minutes to complete.
In the last step the database credentials will be printed. Make sure to note them down.
Installation
Installation steps
-
Make sure that
kubectl
context is set to the newly created cluster. -
Install argoCD -
-
Add the truefoundry helm repo
-
We will create a
values.yaml
for the helm chart installation -- Download the values.yaml from helm chart repo -
- Fill in the
tenant_name
,cluster_name
,truefoundry_image_pull_config_json
andtfy_api_key
in the downloaded file. You can get these from the Truefoundry team - Also fill in the
database
section with database creds. If you created the infrastructure using OCLI, you can get the credentials by runningocli output
- Download the values.yaml from helm chart repo -
-
Apply the helm chart with the values.yaml
Test the installation
- Port forward the frontend application to access the Truefoundry dashboard -
- Access the truefoundry dashboard from a browser by opening
http://localhost:5000
. You can login with the username and password provided by the Truefoundry team. - Now you are ready to connect a cluster to the Truefoundry platform and get deploying. Go here for the directions. You can also onboard the same cluster as the control plane