Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting version to v1.7.6 on machine config and secrets does not install talos 1.7.6 #196

Open
dansrogers opened this issue Sep 4, 2024 · 1 comment

Comments

@dansrogers
Copy link

Hi,

Setting talos_version on machine config and secrets doesn't cause talos 1.7.6 to be installed.

Relevant terraform configuration

erraform {
  required_providers {
    # todo figure out how to  install 1.7.6 instead of 1.7.0 or 1.8.0-alpha.2
    talos = {
      source = "siderolabs/talos"
      version = "0.6.0-alpha.2"
    }
  }
}

provider "talos" {
  # Configuration options
}

resource "talos_machine_secrets" "this" {
  talos_version   = "v${var.talos_version}"
}

data "talos_machine_configuration" "controlplane" {
  talos_version    = "v${var.talos_version}"
  cluster_name     = var.cluster_name
  cluster_endpoint = var.cluster_endpoint
  machine_type     = "controlplane"
  machine_secrets  = talos_machine_secrets.this.machine_secrets
  config_patches   = [
    file("${path.root}/talos/machine-config-patch.yaml"),
    file("${path.root}/talos/control-plane-patch.yaml")
  ]
}

data "talos_machine_configuration" "worker" {
  talos_version    = "v${var.talos_version}"
  cluster_name     = var.cluster_name
  cluster_endpoint = var.cluster_endpoint
  machine_type     = "worker"
  machine_secrets  = talos_machine_secrets.this.machine_secrets
  config_patches   = [
    file("${path.root}/talos/machine-config-patch.yaml"),
  ]
}

data "talos_client_configuration" "this" {
  cluster_name         = var.cluster_name
  client_configuration = talos_machine_secrets.this.client_configuration
  endpoints            = [module.controlplane.ip_address]
}

resource "talos_machine_configuration_apply" "controlplane" {
  client_configuration        = talos_machine_secrets.this.client_configuration
  machine_configuration_input = data.talos_machine_configuration.controlplane.machine_configuration
  node                        = module.controlplane.ip_address
}

resource "talos_machine_configuration_apply" "worker" {
  client_configuration        = talos_machine_secrets.this.client_configuration
  machine_configuration_input = data.talos_machine_configuration.worker.machine_configuration
  node                        = module.worker.ip_address
}

resource "talos_machine_bootstrap" "this" {
  depends_on = [talos_machine_configuration_apply.controlplane]

  client_configuration = talos_machine_secrets.this.client_configuration
  node                 = module.controlplane.ip_address
}

resource "talos_cluster_kubeconfig" "this" {
  depends_on           = [talos_machine_bootstrap.this]
  client_configuration = talos_machine_secrets.this.client_configuration
  node                 = module.controlplane.ip_address
}

Tested on 0.5.0 and 0.6.0-alpha.2. The former installs 1.7.0 and the latter always installs 1.8.0-alpha.2

@smira
Copy link
Member

smira commented Sep 4, 2024

talos_version is not a version of Talos to be installed, it's a machine configuration contract - you specify there the Talos version cluster was created with. It only controls machine config generation, so that you can generate machine configs compatible with older versions of Talos.

The actual Talos version being installed depends on your boot assets, it's either the disk image itself, or e.g. the version of the installer in the machine.install machine configuration field when booting off an ISO/PXE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants