Skip to content

Commit

Permalink
Update docs and CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Actions committed Oct 4, 2023
1 parent 6b380ba commit e7d7508
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

## [v1.0.38](https://github.com/civo/terraform-provider-civo/releases/tag/v1.0.38) (4 October 2023)

### Merged
- [#189](https://github.com/civo/terraform-provider-civo/pull/189) - Feature/cluster pool update

### Commits
- [6b380ba](https://github.com/civo/terraform-provider-civo/commit/6b380ba79c3e0f75914ef775a05e4401b8b1181c) - Remove comments from the node pool file that were not used

## [v1.0.37](https://github.com/civo/terraform-provider-civo/releases/tag/v1.0.37) (1 October 2023)

### Merged
Expand Down
82 changes: 78 additions & 4 deletions docs/resources/kubernetes_node_pool.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "civo_kubernetes_node_pool Resource - terraform-provider-civo"
subcategory: ""
description: |-
Expand Down Expand Up @@ -58,18 +57,28 @@ resource "civo_kubernetes_node_pool" "back-end" {
### Optional

- `label` (String) Node pool label, if you don't provide one, we will generate one for you
- `labels` (Map of String)
- `node_count` (Number) the number of instances to create (optional, the default at the time of writing is 3)
- `num_target_nodes` (Number, Deprecated) the number of instances to create (optional, the default at the time of writing is 3)
- `public_ip_node_pool` (Boolean) Node pool belongs to the public ip node pool
- `size` (String) the size of each node (optional, the default is currently g4s.kube.medium)
- `target_nodes_size` (String, Deprecated) the size of each node (optional, the default is currently g4s.kube.medium)
- `taint` (Block Set) (see [below for nested schema](#nestedblock--taint))
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of this resource.
- `instance_names` (List of String) Instance names in the nodepool

<a id="nestedblock--taint"></a>
### Nested Schema for `taint`

Required:

- `effect` (String)
- `key` (String)
- `value` (String)


<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Expand All @@ -84,6 +93,71 @@ Optional:
Import is supported using the following syntax:

```shell
# using cluster_id:node_pool_id
terraform import civo_kubernetes_node_pool.my-pool 1b8b2100-0e9f-4e8f-ad78-9eb578c2a0af:502c1130-cb9b-4a88-b6d2-307bd96d946a
```
## Taint and Labels

The Kubernetes node pool resource supports taints and labels. These can be specified as a map of key/value pairs. For example:

```terraform
# Query xsmall instance size
data "civo_size" "xsmall" {
filter {
key = "type"
values = ["kubernetes"]
}
sort {
key = "ram"
direction = "asc"
}
}
# Create a cluster
resource "civo_kubernetes_cluster" "my-cluster" {
name = "my-cluster"
applications = "Portainer,Linkerd:Linkerd & Jaeger"
firewall_id = civo_firewall.my-firewall.id
node_pool {
size = element(data.civo_size.xsmall.sizes, 0).name
node_count = 3
}
}
# Add a node pool
resource "civo_kubernetes_node_pool" "back-end" {
cluster_id = civo_kubernetes_cluster.my-cluster.id
label = "back-end" // Optional
node_count = 1 // Optional
size = element(data.civo_size.xsmall.sizes, 0).name // Optional
region = "LON1"
labels = {
service = "backend"
priority = "high"
}
taint {
key = "workloadKind"
value = "database"
effect = "NoSchedule"
}
taint {
key = "workloadKind"
value = "frontend"
effect = "NoSchedule"
}
}
```

### Taints

Taints are used to repel pods from nodes. They can be used to repel pods from nodes with certain hardware, or to repel pods from nodes that are running certain services. For example, you may want to repel pods from nodes that are running a database, or from nodes that are running a monitoring agent.
Taints have to currently be removed from nodes using the kubectl command in addition to being removed from a Terraform configuration. For example:

```shell
kubectl taint nodes node-1 key=value:NoSchedule-
```
This will be automated in a future release of the provider. Removing a taint from Terraform will prevent the node from being tainted again if node pools with the taints are altered or scaled.

0 comments on commit e7d7508

Please sign in to comment.