Skip to content

Commit 4ecfd4f

Browse files
committed
feat: add new resources
Adds new resources: - `talos_client_configuration` - `talos_machine_configuration_apply` - `talos_machine_bootstrap` - `talos_cluster_kubeconfig` Add new data sources: - `talos_cluster_kubeconfig` Signed-off-by: Noel Georgi <[email protected]>
1 parent dce61bb commit 4ecfd4f

32 files changed

+1092
-175
lines changed

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.PHONY: generate
2+
generate:
3+
go generate
4+
5+
.PHONY: testacc
6+
testacc:
7+
TF_ACC=1 go test -v github.com/siderolabs/terraform-provider-talos/talos -timeout 30s
8+
9+
check-dirty: generate ## Verifies that source tree is not dirty
10+
@if test -n "`git status --porcelain`"; then echo "Source tree is dirty"; git status; exit 1 ; fi
11+
12+
build:
13+
go build -o terraform-provider-talos
14+
15+
install: build
16+
mkdir -p ~/.terraform.d/plugins/registry.local/siderolabs/talos/0.1.0/linux_amd64
17+
cp terraform-provider-talos ~/.terraform.d/plugins/registry.local/siderolabs/talos/0.1.0/linux_amd64/terraform-provider-talos
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "talos_cluster_kubeconfig Data Source - terraform-provider-talos"
4+
subcategory: ""
5+
description: |-
6+
Retrieve Kubeconfig for a Talos cluster
7+
---
8+
9+
# talos_cluster_kubeconfig (Data Source)
10+
11+
Retrieve Kubeconfig for a Talos cluster
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `talos_config` (String) talos client configuration for authentication
21+
22+
### Optional
23+
24+
- `endpoints` (List of String) endpoints to use
25+
- `nodes` (List of String) nodes to use
26+
27+
### Read-Only
28+
29+
- `id` (String) The ID of this resource.
30+
- `kube_config` (String, Sensitive) The retrieved Kubeconfig
31+
32+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "talos_client_configuration Resource - terraform-provider-talos"
4+
subcategory: ""
5+
description: |-
6+
Generate client configuration for a Talos cluster
7+
---
8+
9+
# talos_client_configuration (Resource)
10+
11+
Generate client configuration for a Talos cluster
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `cluster_name` (String) The name of the cluster in the generated config
21+
- `machine_secrets` (String) The machine secrets for the cluster
22+
23+
### Optional
24+
25+
- `endpoints` (List of String) endpoints to set in the generated config
26+
- `nodes` (List of String) nodes to set in the generated config
27+
28+
### Read-Only
29+
30+
- `id` (String) The ID of this resource.
31+
- `talos_config` (String, Sensitive) The generated talos config
32+
33+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "talos_cluster_kubeconfig Resource - terraform-provider-talos"
4+
subcategory: ""
5+
description: |-
6+
Retrieve Kubeconfig for a Talos cluster
7+
---
8+
9+
# talos_cluster_kubeconfig (Resource)
10+
11+
Retrieve Kubeconfig for a Talos cluster
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `talos_config` (String) talos client configuration for authentication
21+
22+
### Optional
23+
24+
- `endpoints` (List of String) endpoints to use
25+
- `nodes` (List of String) nodes to use
26+
27+
### Read-Only
28+
29+
- `id` (String) The ID of this resource.
30+
- `kube_config` (String, Sensitive) The retrieved Kubeconfig
31+
32+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "talos_machine_bootstrap Resource - terraform-provider-talos"
4+
subcategory: ""
5+
description: |-
6+
Applies machine configuration to a Talos node.
7+
---
8+
9+
# talos_machine_bootstrap (Resource)
10+
11+
Applies machine configuration to a Talos node.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `node` (String) nodes to bootstrap
21+
- `talos_config` (String) talos client configuration for authentication
22+
23+
### Optional
24+
25+
- `endpoints` (List of String) machine endpoint
26+
27+
### Read-Only
28+
29+
- `id` (String) The ID of this resource.
30+
31+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "talos_machine_configuration_apply Resource - terraform-provider-talos"
4+
subcategory: ""
5+
description: |-
6+
Applies machine configuration to a Talos node.
7+
---
8+
9+
# talos_machine_configuration_apply (Resource)
10+
11+
Applies machine configuration to a Talos node.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `machine_configuration` (String) machine configuration
21+
- `talos_config` (String) talos client configuration for authentication
22+
23+
### Optional
24+
25+
- `config_patches` (List of String) config patches to apply to the generated config
26+
- `endpoints` (List of String) machine endpoint
27+
- `mode` (String) The mode to apply the configuration in.
28+
- `nodes` (List of String) nodes to apply the config
29+
30+
### Read-Only
31+
32+
- `id` (String) The ID of this resource.
33+
34+

docs/resources/machine_configuration_controlplane.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Generate machine configuration for a Talos control plane node.
2323

2424
### Optional
2525

26-
- `config_patch` (String) config patches to apply to the generated config
26+
- `config_patches` (List of String) config patches to apply to the generated config
2727
- `config_version` (String) the desired machine config version to generate
2828
- `docs_enabled` (Boolean) whether to render all machine configs adding the documentation for each field
2929
- `examples_enabled` (Boolean) whether to render all machine configs with the commented examples

docs/resources/machine_configuration_worker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Generate machine configuration for a Talos worker node.
2323

2424
### Optional
2525

26-
- `config_patch` (String) config patches to apply to the generated config
26+
- `config_patches` (List of String) config patches to apply to the generated config
2727
- `config_version` (String) the desired machine config version to generate
2828
- `docs_enabled` (Boolean) whether to render all machine configs adding the documentation for each field
2929
- `examples_enabled` (Boolean) whether to render all machine configs with the commented examples

examples/basic/files/patch.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"op": "add",
4+
"path": "/cluster/allowSchedulingOnControlPlanes",
5+
"value": true
6+
}
7+
]

examples/basic/files/worker.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
machine:
2+
install:
3+
disk: /dev/nvmen01

0 commit comments

Comments
 (0)