Deploy Charmed Kubeflow using Terraform

This guide describes how to deploy Charmed Kubeflow (CKF) using Terraform.
You can do so by using any CNCF certified Kubernetes (K8s) cluster and deploying Kubeflow using the Terraform, Kubernetes and Juju Command Line Interfaces (CLIs).

Requirements

Bootstrap Juju

CKF is deployed to Kubernetes with Juju. Before deployment, Juju must be bootstrapped to the K8s cluster. See Get started with Juju for more details.

Check Supported versions for version compatibility between CKF, Juju and K8s.

Deploy Kubeflow

Deploy CKF as follows:

  1. Clone the repository and change directory to the Kubeflow module:

This command checks out the default branch, which should be track/1.9. If that’s not the case, make sure to git checkout to that branch.

git clone https://github.com/canonical/charmed-kubeflow-solutions
cd charmed-kubeflow-solutions/modules/kubeflow
  1. Initialise Terraform. The following command downloads all the required Terraform modules and installs the Terraform Juju provider:
terraform init
  1. Define username and password:
DEX_USERNAME="your-username"
DEX_PASSWORD="your-password"
  1. Deploy CKF using Terraform as follows:
terraform apply \
	-var cos_configuration=true \
	-var dex_static_username=$DEX_USERNAME \
	-var dex_static_password=$DEX_PASSWORD \
	-var kfp_db_revision=203 \
	-var katib_db_revision=203

The command above:

See Charmed Kubeflow Terraform solution for more details.

  1. Once the deployment is completed, you should see the Terraform solution module’s outputs:
Outputs:

grafana_agent_k8s        = {
    app_name = "grafana-agent-k8s-kubeflow"
    provides = {
        grafana_dashboards_provider = "grafana-dashboards-provider"
      }
    requires = {
        logging_consumer  = "logging-consumer"
        send_remote_write = "send-remote-write"
      }
  }
kserve_controller        = {
    app_name = "kserve-controller"
    provides = {
        metrics_endpoint = "metrics-endpoint"
      }
    requires = {
        ingress_gateway  = "ingress-gateway"
        local_gateway    = "local-gateway"
        logging          = "logging"
        object_storage   = "object-storage"
        secrets          = "secrets"
        service_accounts = "service-accounts"
      }
  }
model                    = "kubeflow"
tls_certificate_requirer = {
    app_name = "istio-pilot"
    requires = "certificates"
  }


See Charmed Kubeflow Terraform solution outputs for more details.

  1. Verify all charms are in `active` status by monitoring the Juju model:
juju status --watch 1s

This may take up to some minutes, depending on the cluster’s node specifications.

Access CKF dashboard

You can access the CKF dashboard through an IP using a web browser. This IP is related to a service of type LoadBalancer, applied by the istio-gateway charm.

Depending on the used K8s substrate and its initial configuration, you may need to create a load balancer that redirects traffic to that IP.

Here’s how to do it for the most common Kubernetes substrates:

Once you obtain the public IP, use the credentials previously set in the terraform apply command to log in.