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

Create separate bare-metal container-linux-install profiles #97

Merged
merged 1 commit into from
Jan 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Notable changes between versions.
* Update kube-dns from v1.14.7 to v1.14.8
* Use separate service account for kube-dns

#### Bare-Metal

* Use per-node Container Linux install profiles ([#97](https://github.com/poseidon/typhoon/pull/97))
* Allow Container Linux channel/version to be chosen per-cluster
* Fix issue where cluster deletion could require `terraform apply` multiple times

## v1.9.1

* Kubernetes [v1.9.1](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.9.md#v191)
Expand Down
2 changes: 1 addition & 1 deletion bare-metal/container-linux/kubernetes/groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "matchbox_group" "container-linux-install" {
count = "${length(var.controller_names) + length(var.worker_names)}"

name = "${format("container-linux-install-%s", element(concat(var.controller_names, var.worker_names), count.index))}"
profile = "${var.cached_install == "true" ? matchbox_profile.cached-container-linux-install.name : matchbox_profile.container-linux-install.name}"
profile = "${var.cached_install == "true" ? element(matchbox_profile.cached-container-linux-install.*.name, count.index) : element(matchbox_profile.container-linux-install.*.name, count.index)}"

selector {
mac = "${element(concat(var.controller_macs, var.worker_macs), count.index)}"
Expand Down
20 changes: 14 additions & 6 deletions bare-metal/container-linux/kubernetes/profiles.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Container Linux Install profile (from release.core-os.net)
resource "matchbox_profile" "container-linux-install" {
name = "container-linux-install"
count = "${length(var.controller_names) + length(var.worker_names)}"
name = "${format("%s-container-linux-install-%s", var.cluster_name, element(concat(var.controller_names, var.worker_names), count.index))}"

kernel = "http://${var.container_linux_channel}.release.core-os.net/amd64-usr/${var.container_linux_version}/coreos_production_pxe.vmlinuz"

initrd = [
Expand All @@ -16,10 +18,12 @@ resource "matchbox_profile" "container-linux-install" {
"${var.kernel_args}",
]

container_linux_config = "${data.template_file.container-linux-install-config.rendered}"
container_linux_config = "${element(data.template_file.container-linux-install-configs.*.rendered, count.index)}"
}

data "template_file" "container-linux-install-config" {
data "template_file" "container-linux-install-configs" {
count = "${length(var.controller_names) + length(var.worker_names)}"

template = "${file("${path.module}/cl/container-linux-install.yaml.tmpl")}"

vars {
Expand All @@ -37,7 +41,9 @@ data "template_file" "container-linux-install-config" {
// Container Linux Install profile (from matchbox /assets cache)
// Note: Admin must have downloaded container_linux_version into matchbox assets.
resource "matchbox_profile" "cached-container-linux-install" {
name = "cached-container-linux-install"
count = "${length(var.controller_names) + length(var.worker_names)}"
name = "${format("%s-cached-container-linux-install-%s", var.cluster_name, element(concat(var.controller_names, var.worker_names), count.index))}"

kernel = "/assets/coreos/${var.container_linux_version}/coreos_production_pxe.vmlinuz"

initrd = [
Expand All @@ -53,10 +59,12 @@ resource "matchbox_profile" "cached-container-linux-install" {
"${var.kernel_args}",
]

container_linux_config = "${data.template_file.cached-container-linux-install-config.rendered}"
container_linux_config = "${element(data.template_file.cached-container-linux-install-configs.*.rendered, count.index)}"
}

data "template_file" "cached-container-linux-install-config" {
data "template_file" "cached-container-linux-install-configs" {
count = "${length(var.controller_names) + length(var.worker_names)}"

template = "${file("${path.module}/cl/container-linux-install.yaml.tmpl")}"

vars {
Expand Down