Skip to content

KubernetesCluster

A KubernetesCluster represents a managed Kubernetes cluster for container orchestration. On AWS this is EKS, on GCP GKE, and on DigitalOcean DOKS. Hetzner does not offer managed Kubernetes (though kubeadm can be used on Hetzner Cloud Servers).

Property Type Required Description
name string yes Unique resource name
id string no Explicit ID (auto-generated UUID if omitted)
provider string no Provider label for multi-provider configs
tags Record<string, string> no Arbitrary key-value metadata
version string no Kubernetes version (default 'latest')
nodeInstanceType string yes Instance type for worker nodes (provider-specific)
minNodes number yes Minimum node count
maxNodes number yes Maximum node count for autoscaler
network Vpc | string yes Vpc for cluster networking
region string no Region override
privateCluster boolean no Restrict API server to private network
nodeDiskSize number no Node disk size in GB
autoUpgrade boolean no Enable automatic version upgrades
maintenanceWindow string no Preferred maintenance window
import { Vpc, KubernetesCluster } from '@kykucloud/types'
const myVpc = new Vpc({ name: 'my-vpc', cidr: '10.0.0.0/16', region: 'eu-central' })
const cluster = new KubernetesCluster({
name: 'prod-cluster',
version: '1.28',
nodeInstanceType: 't3.medium',
minNodes: 3,
maxNodes: 10,
network: myVpc,
privateCluster: true,
autoUpgrade: false,
nodeDiskSize: 100,
})
Provider Supported Backend
AWS EKS (Elastic Kubernetes Service)
GCP GKE (Google Kubernetes Engine)
Hetzner Not available (use CustomResource or manual setup)
DigitalOcean DOKS (DigitalOcean Kubernetes)
  • AWS EKS creates a control plane and a managed node group. Requires IAM roles for the cluster and node group. Cluster endpoint can be public, private, or both. EKS cluster creation is slow (10–15 minutes).
  • GCP GKE supports both standard and autopilot modes. Private clusters restrict the API server endpoint. GKE supports regional clusters (multi-zone) and zonal clusters.
  • DigitalOcean DOKS creates a Kubernetes cluster with a node pool. The nodeInstanceType maps to DO Droplet sizes. Node pools can be scaled independently.
  • kubeconfig is available as a resource output after cluster creation. Use cluster.outputs.kubeconfig to connect.
  • Network: The cluster is placed in the specified VPC. On AWS, subnets tagged for EKS are required. On GKE, a VPC-native cluster uses secondary IP ranges.