Skip to main content

Managed Kubernetes (NKE)

Deploy managed Kubernetes clusters on NetActuate using the NKE (NetActuate Kubernetes Engine) resources in the Terraform provider v2.

Repository

git clone https://github.com/netactuate/netactuate-terraform-nke
cd netactuate-terraform-nke

Version Discovery

Use the netactuate_nke_versions data source to list available Kubernetes versions:

data "netactuate_nke_versions" "available" {}

output "available_versions" {
value = data.netactuate_nke_versions.available.versions
}

Cluster Creation

resource "netactuate_nke_cluster" "main" {
name = "production"
location = "SJC"
version = "1.29"
plan = "VR2x2x25"
contract_id = 12345
minimum_nodes = 2
maximum_nodes = 5
}

Key attributes:

  • name -- Cluster name
  • location -- Deployment location
  • version -- Kubernetes version (use the data source to find available versions)
  • plan -- Worker node plan size
  • contract_id -- Contract ID (required)
  • minimum_nodes / maximum_nodes -- Auto-scaling range for worker nodes

Kubeconfig Retrieval

Retrieve the kubeconfig for your cluster using the data source:

data "netactuate_nke_kubeconfig" "main" {
cluster_id = netactuate_nke_cluster.main.id
}

output "kubeconfig" {
value = data.netactuate_nke_kubeconfig.main.kubeconfig
sensitive = true
}

Write the kubeconfig to a file and verify access:

terraform output -raw kubeconfig > kubeconfig.yaml
export KUBECONFIG=./kubeconfig.yaml
kubectl get nodes

Scaling Workers

To scale the cluster, update the minimum_nodes and maximum_nodes values and apply:

resource "netactuate_nke_cluster" "main" {
name = "production"
location = "SJC"
version = "1.29"
plan = "VR2x2x25"
contract_id = 12345
minimum_nodes = 3
maximum_nodes = 10
}
terraform apply

You can verify the worker nodes with the data source:

data "netactuate_nke_worker_nodes" "main" {
cluster_id = netactuate_nke_cluster.main.id
}

output "workers" {
value = data.netactuate_nke_worker_nodes.main.worker_nodes
}

Dashboard Addon

Enable the Kubernetes dashboard as a cluster addon:

resource "netactuate_nke_cluster" "main" {
name = "production"
location = "SJC"
version = "1.29"
plan = "VR2x2x25"
contract_id = 12345
minimum_nodes = 2
maximum_nodes = 5
kubernetes_dashboard = true
}

Need Help?

If you need assistance with NKE clusters, visit our support page.