KubeCon EUBooth 1151, Amsterdam. March 23-26
Terraform

Terraform Provider

Install and configure the DevZero Terraform provider.

Terraform Provider

The DevZero Terraform provider manages clusters, workload policies, and node policies via HCL. There is also a Terraform module (devzero-inc/cluster/devzero) for one-step cluster setup including operator installation.

Provider Configuration

Add the DevZero provider to your required_providers block and configure it:

terraform {
  required_providers {
    devzero = {
      source = "devzero-inc/devzero"
    }
  }
}

provider "devzero" {
  team_id = var.devzero_team_id
  token   = var.devzero_token
}

Authentication

ParameterEnvironment VariableRequiredDescription
team_idDEVZERO_TEAM_IDYesYour team or organization ID
tokenDEVZERO_TOKENYes (sensitive)Personal access token
urlDEVZERO_URLNoAPI endpoint (default: https://dakr.devzero.io)

Get your personal access token from User Settings and your team ID from Organization Settings.

Cluster Module

For a quick way to register a cluster and install DevZero operators in one step, use the devzero-inc/cluster/devzero module:

module "devzero_cluster" {
  source       = "devzero-inc/cluster/devzero"
  cluster_name = "my-cluster"
}

This module handles cluster registration and operator installation automatically.

Workflow

terraform init    # Download the provider
terraform plan    # Preview changes
terraform apply   # Apply changes

Resources

The provider manages the following resources:

  • Clusters -- register Kubernetes clusters with DevZero
  • Workload Policies -- configure workload rightsizing rules and attach them to clusters
  • Node Policies -- configure Karpenter-based node provisioning

On this page