A module to add a cluster to your devzero account
Requires devzero-inc/devzero and hashicorp/helm
terraform {
required_providers {
devzero = {
source = "devzero-inc/devzero"
version = ">= 0.3.0"
}
}
}
provider "devzero" {
team_id = "YOUR_TEAM_ID"
token = "YOUR_SERVICE_ACCOUNT_TOKEN"
}
module "devzero-cluster" {
source = "devzero-inc/cluster/devzero"
version = "~> 0.2"
cluster_name = "example-cluster"
}Drive the provider with a service account's token (dzs-). The provider accepts a person's token, but with it destroying a devzero_team is that person's leave of the team: a last member's leave deletes the team, unless DevZero refuses it, as it does once a cluster in the team has reported.
A partner starts a team for its customer and registers the customer's cluster in it. The provider runs as the partner's team. member_emails must name a person who is Admin of the partner's team: the service account joins the new team as Developer, and a start with no person as Admin is refused.
terraform {
required_providers {
devzero = {
source = "devzero-inc/devzero"
version = ">= 0.3.0"
}
}
}
provider "devzero" {
team_id = "PARTNER_TEAM_ID"
token = "YOUR_SERVICE_ACCOUNT_TOKEN"
}
resource "devzero_team" "acme" {
name = "Acme"
member_emails = ["[email protected]"]
admin_invite_emails = ["[email protected]"]
}
module "acme-cluster" {
source = "devzero-inc/cluster/devzero"
version = "~> 0.2"
cluster_name = "acme-prod"
team_id = devzero_team.acme.id
}team_id is fixed once the cluster is registered. Moving a devzero_team into a module, or renaming it, needs a moved block; see the provider's devzero_team docs.
| Name | Version |
|---|---|
| terraform | >= 1.1.0 |
| devzero | >= 0.3.0 |
| helm | >= 3.0.2 |
| kubernetes | >= 2.0 |
| Name | Version |
|---|---|
| devzero | >= 0.3.0 |
| helm | 3.1.1 |
| kubernetes | >= 2.0 |
No modules.
| Name | Type |
|---|---|
| devzero_cluster.cluster | resource |
| helm_release.devzero_operator | resource |
| helm_release.zxporter | resource |
| kubernetes_namespace_v1.this | resource |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| cloud_provider | The cloud provider of the cluster. Supported values: aws, azure, gcp, "". Empty string will be treated as no cloud credentials are required. | string |
"" |
no |
| cluster_name | The name of the cluster | string |
n/a | yes |
| containerd_config_path | The path to the containerd config | string |
null |
no |
| containerd_socket_path | The path to the containerd socket | string |
null |
no |
| create_namespace | Whether this module creates the namespace. Set false when the caller manages it. | bool |
true |
no |
| enable_live_migration_agent | Whether to enable the live migration agent | bool |
false |
no |
| enable_operator | Whether to install the devzero-operator component | bool |
true |
no |
| enable_scheduler | Whether to enable the scheduler | bool |
true |
no |
| enable_zxporter | Whether to install the zxporter component | bool |
true |
no |
| endpoint | The endpoint of the control plane | string |
"https://dakr.devzero.io" |
no |
| namespace | Namespace for zxporter and devzero-operator. | string |
"devzero-system" |
no |
| operator_chart_version | The Helm chart version for devzero-operator | string |
"0.1.49" |
no |
| operator_extra_values | Additional Helm values for the devzero-operator chart (as name->value). | list(object({ |
[] |
no |
| provision_prometheus | Whether to provision prometheus | bool |
true |
no |
| runtime | The runtime of the cluster. Supported values: containerd, rke2, k3s. | string |
"containerd" |
no |
| team_id | ID of the DevZero team the cluster is registered in, such as a devzero_team's id. Unset, the cluster registers in the provider's team_id. It is fixed once the cluster is registered: a change is refused at plan, so the module never moves or re-creates a cluster. | string |
null |
no |
| zxporter_chart_version | The Helm chart version for zxporter | string |
"0.0.59" |
no |
| zxporter_extra_values | Additional Helm values for the zxporter chart (as name->value). | list(object({ |
[] |
no |
| Name | Description |
|---|---|
| cluster_id | n/a |
| cluster_token | n/a |