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

Introduce controllers and workers list of detail objects for bare-metal #566

Merged
merged 1 commit into from
Oct 7, 2019

Conversation

dghubble
Copy link
Member

@dghubble dghubble commented Oct 7, 2019

  • Define bare-metal controllers and workers as a complex type list(object{name=string, mac=string, domain=string}) to allow clusters with many machines to be defined more cleanly
    • Remove controller_names, controller_macs, and controller_domains list variables
    • Remove worker_names, worker_macs, worker_domains list variables

Using the tutorial docs example, a cluster previously defined as:

module "bare-metal-mercury" {
  source = "git::https://github.com/poseidon/typhoon//bare-metal/container-linux/kubernetes?ref=v1.16.1"
  ...

  # machines
  controller_names   = ["node1"]
  controller_macs    = ["52:54:00:a1:9c:ae"]
  controller_domains = ["node1.example.com"]
  worker_names = [
    "node2",
    "node3",
  ]
  worker_macs = [
    "52:54:00:b2:2f:86",
    "52:54:00:c3:61:77",
  ]
  worker_domains = [
    "node2.example.com",
    "node3.example.com",
  ]
}

should now be defined:

module "bare-metal-mercury" {
  source = "git::https://github.com/poseidon/typhoon//bare-metal/fedora-coreos/kubernetes?ref=v1.16.2"

  # machines
  controllers = [{
    name   = "node1"
    mac    = "52:54:00:a1:9c:ae"
    domain = "node1.example.com"
  }]
  workers = [
    {
      name   = "node2",
      mac    = "52:54:00:b2:2f:86"
      domain = "node2.example.com"
    },
    {
      name   = "node3",
      mac    = "52:54:00:c3:61:77"
      domain = "node3.example.com"
    }
  ]
}

As before, all machine names must be unique. Optional features like clc_snippets may map from a machine name to a value (e.g. list of snippets contents in this case).

* Define bare-metal `controllers` and `workers` as a complex type
list(object{name=string, mac=string, domain=string}) to allow
clusters with many machines to be defined more cleanly
* Remove `controller_names` list variable
* Remove `controller_macs` list variable
* Remove `controller_domains` list variable
* Remove `worker_names` list variable
* Remove `worker_macs` list variable
* Remove `worker_domains` list variable
@dghubble dghubble force-pushed the bare-metal-machine-typing branch from 9fb0103 to 5b9dab6 Compare October 7, 2019 03:23
@dghubble dghubble changed the title Introduce list of detail objects for bare-metal machines Introduce controllers and workers list of detail objects for bare-metal Oct 7, 2019
@dghubble dghubble merged commit 5b9dab6 into master Oct 7, 2019
@dghubble dghubble deleted the bare-metal-machine-typing branch October 7, 2019 03:58
@Sfinx
Copy link

Sfinx commented Oct 17, 2019

Seems like new source URL is not working, "terraform init" produces error :

Initializing modules...
Downloading git::https://github.com/poseidon/typhoon?ref=v1.16.2 for bare-metal-mercury...

Error: Failed to download module

Could not download module "bare-metal-mercury" (bare-metal-k8s.tf:1) source
code from "git::https://github.com/poseidon/typhoon?ref=v1.16.2": error
downloading 'https://github.com/poseidon/typhoon?ref=v1.16.2': /usr/bin/git
exited with 1: error: pathspec 'v1.16.2' did not match any file(s) known to
git.

@dghubble
Copy link
Member Author

dghubble commented Oct 17, 2019

Change the ref or wait until v1.16.2 is officially released. Generally, go by the releases page or docs, rather than the docs in master since those can be in-progress.

v1.16.2 is now released.

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

Successfully merging this pull request may close these issues.

2 participants