|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +page_title: "CloudStack: cloudstack_kubernetes_cluster" |
| 4 | +sidebar_current: "docs-cloudstack-resource-kubernetes_cluster" |
| 5 | +description: |- |
| 6 | + Creates a Kubernetes Cluster |
| 7 | +--- |
| 8 | + |
| 9 | +# CloudStack: cloudstack_kubernetes_cluster |
| 10 | + |
| 11 | +A `cloudstack_kubernetes_cluster` resource manages a Kubernetes cluster within CloudStack. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```hcl |
| 16 | +resource "cloudstack_kubernetes_cluster" "example" { |
| 17 | + name = "example-cluster" |
| 18 | + zone = "zone-id" |
| 19 | + kubernetes_version = "1.18.6" |
| 20 | + service_offering = "small" |
| 21 | + size = 1 |
| 22 | + autoscaling_enabled = true |
| 23 | + min_size = 1 |
| 24 | + max_size = 5 |
| 25 | + control_nodes_size = 1 |
| 26 | + description = "An example Kubernetes cluster" |
| 27 | + keypair = "my-ssh-key" |
| 28 | + network_id = "net-id" |
| 29 | + state = "Running" |
| 30 | + project = "my-project" |
| 31 | +} |
| 32 | +``` |
| 33 | + |
| 34 | + |
| 35 | +## Argument Reference |
| 36 | + |
| 37 | +The following arguments are supported: |
| 38 | + |
| 39 | +* `name` - (Required) The name of the Kubernetes cluster. |
| 40 | +* `zone` - (Required) The zone where the Kubernetes cluster will be deployed. |
| 41 | +* `kubernetes_version` - (Required) The Kubernetes version for the cluster. |
| 42 | +* `service_offering` - (Required) The service offering for the nodes in the cluster. |
| 43 | +* `size` - (Optional) The initial size of the Kubernetes cluster. Defaults to `1`. |
| 44 | +* `autoscaling_enabled` - (Optional) Whether autoscaling is enabled for the cluster. |
| 45 | +* `min_size` - (Optional) The minimum size of the Kubernetes cluster when autoscaling is enabled. |
| 46 | +* `max_size` - (Optional) The maximum size of the Kubernetes cluster when autoscaling is enabled. |
| 47 | +* `control_nodes_size` - (Optional) The size of the control nodes in the cluster. |
| 48 | +* `description` - (Optional) A description for the Kubernetes cluster. |
| 49 | +* `keypair` - (Optional) The SSH key pair to use for the nodes in the cluster. |
| 50 | +* `network_id` - (Optional) The network ID to connect the Kubernetes cluster to. |
| 51 | +* `ip_address` - (Computed) The IP address of the Kubernetes cluster. |
| 52 | +* `state` - (Optional) The state of the Kubernetes cluster. Defaults to `"Running"`. |
| 53 | +* `project` - (Optional) The project to assign the Kubernetes cluster to. |
| 54 | + |
| 55 | +## Attributes Reference |
| 56 | + |
| 57 | +The following attributes are exported: |
| 58 | + |
| 59 | +* `id` - The ID of the Kubernetes cluster. |
| 60 | +* `name` - The name of the Kubernetes cluster. |
| 61 | +* `description` - The description of the Kubernetes cluster. |
| 62 | +* `control_nodes_size` - The size of the control nodes in the cluster. |
| 63 | +* `size` - The size of the Kubernetes cluster. |
| 64 | +* `autoscaling_enabled` - Whether autoscaling is enabled for the cluster. |
| 65 | +* `min_size` - The minimum size of the Kubernetes cluster when autoscaling is enabled. |
| 66 | +* `max_size` - The maximum size of the Kubernetes cluster when autoscaling is enabled. |
| 67 | +* `keypair` - The SSH key pair used for the nodes in the cluster. |
| 68 | +* `network_id` - The network ID connected to the Kubernetes cluster. |
| 69 | +* `ip_address` - The IP address of the Kubernetes cluster. |
| 70 | +* `state` - The state of the Kubernetes cluster. |
| 71 | +* `project` - The project assigned to the Kubernetes cluster. |
| 72 | + |
| 73 | +## Import |
| 74 | + |
| 75 | +Kubernetes clusters can be imported; use `<KUBERNETESCLUSTERID>` as the import ID. For example: |
| 76 | + |
| 77 | +```shell |
| 78 | +$ terraform import cloudstack_kubernetes_cluster.example <KUBERNETESCLUSTERID> |
| 79 | +``` |
0 commit comments