Using templates from talos terraform provider
This commit is contained in:
parent
2880c2f882
commit
5386a3d647
1 changed files with 29 additions and 1 deletions
28
main.tf
28
main.tf
|
|
@ -63,7 +63,19 @@ data "talos_machine_configuration" "controlplane" {
|
||||||
cluster_endpoint = "https://10.5.0.2:6443"
|
cluster_endpoint = "https://10.5.0.2:6443"
|
||||||
machine_type = "controlplane"
|
machine_type = "controlplane"
|
||||||
machine_secrets = talos_machine_secrets.this.machine_secrets
|
machine_secrets = talos_machine_secrets.this.machine_secrets
|
||||||
|
talos_version = "v1.11.2"
|
||||||
|
}
|
||||||
|
|
||||||
|
data "talos_client_configuration" "this" {
|
||||||
|
cluster_name = "example-cluster"
|
||||||
|
client_configuration = talos_machine_secrets.this.client_configuration
|
||||||
|
nodes = ["10.5.0.2"]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "talos_machine_configuration_apply" "this" {
|
||||||
|
client_configuration = talos_machine_secrets.this.client_configuration
|
||||||
|
machine_configuration_input = data.talos_machine_configuration.this.machine_configuration
|
||||||
|
node = "10.5.0.2"
|
||||||
config_patches = [
|
config_patches = [
|
||||||
yamlencode({
|
yamlencode({
|
||||||
machine = {
|
machine = {
|
||||||
|
|
@ -75,6 +87,22 @@ data "talos_machine_configuration" "controlplane" {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "talos_machine_bootstrap" "this" {
|
||||||
|
depends_on = [
|
||||||
|
talos_machine_configuration_apply.this
|
||||||
|
]
|
||||||
|
node = "10.5.0.2"
|
||||||
|
client_configuration = talos_machine_secrets.this.client_configuration
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "talos_cluster_kubeconfig" "this" {
|
||||||
|
depends_on = [
|
||||||
|
talos_machine_bootstrap.this
|
||||||
|
]
|
||||||
|
client_configuration = talos_machine_secrets.this.client_configuration
|
||||||
|
node = "10.5.0.2"
|
||||||
|
}
|
||||||
|
|
||||||
# Download Talos kernel and initramfs
|
# Download Talos kernel and initramfs
|
||||||
resource "null_resource" "download_talos_files" {
|
resource "null_resource" "download_talos_files" {
|
||||||
triggers = {
|
triggers = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue