Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

platforms/metal: Template config.tf versions into CL configs #361

Merged
merged 1 commit into from
Apr 25, 2017
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
8 changes: 4 additions & 4 deletions platforms/metal/cl/bootkube-controller.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ systemd:
- name: 40-etcd-cluster.conf
contents: |
[Service]
Environment="ETCD_IMAGE_TAG=v3.1.0"
Environment="ETCD_IMAGE_TAG={{.etcd_image_tag}}"
Environment="ETCD_NAME={{.etcd_name}}"
Environment="ETCD_ADVERTISE_CLIENT_URLS=http://{{.domain_name}}:2379"
Environment="ETCD_INITIAL_ADVERTISE_PEER_URLS=http://{{.domain_name}}:2380"
Expand Down Expand Up @@ -50,7 +50,7 @@ systemd:
[Unit]
Description=Kubelet via Hyperkube ACI
[Service]
Environment="RKT_OPTS=--uuid-file-save=/var/run/kubelet-pod.uuid \
Environment="RKT_RUN_ARGS=--uuid-file-save=/var/run/kubelet-pod.uuid \
--volume=resolv,kind=host,source=/etc/resolv.conf \
--mount volume=resolv,target=/etc/resolv.conf \
--volume var-lib-cni,kind=host,source=/var/lib/cni \
Expand Down Expand Up @@ -124,8 +124,8 @@ storage:
mode: 0644
contents:
inline: |
KUBELET_ACI=quay.io/coreos/hyperkube
KUBELET_VERSION=v1.6.1_coreos.0
KUBELET_IMAGE_URL={{.kubelet_image_url}}
KUBELET_IMAGE_TAG={{.kubelet_image_tag}}
- path: /etc/hostname
filesystem: root
mode: 0644
Expand Down
24 changes: 4 additions & 20 deletions platforms/metal/cl/bootkube-worker.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ systemd:
- name: 40-etcd-cluster.conf
contents: |
[Service]
Environment="ETCD_IMAGE_TAG=v3.1.0"
Environment="ETCD_IMAGE_TAG={{.etcd_image_tag}}"
ExecStart=
ExecStart=/usr/lib/coreos/etcd-wrapper gateway start \
--listen-addr=127.0.0.1:2379 \
Expand Down Expand Up @@ -47,7 +47,7 @@ systemd:
[Unit]
Description=Kubelet via Hyperkube ACI
[Service]
Environment="RKT_OPTS=--uuid-file-save=/var/run/kubelet-pod.uuid \
Environment="RKT_RUN_ARGS=--uuid-file-save=/var/run/kubelet-pod.uuid \
--volume=resolv,kind=host,source=/etc/resolv.conf \
--mount volume=resolv,target=/etc/resolv.conf \
--volume var-lib-cni,kind=host,source=/var/lib/cni \
Expand Down Expand Up @@ -84,30 +84,14 @@ systemd:
WantedBy=multi-user.target

storage:
{{ if index . "pxe" }}
disks:
- device: /dev/sda
wipe_table: true
partitions:
- label: ROOT
filesystems:
- name: root
mount:
device: "/dev/sda1"
format: "ext4"
create:
force: true
options:
- "-LROOT"
{{end}}
files:
- path: /etc/kubernetes/kubelet.env
filesystem: root
mode: 0644
contents:
inline: |
KUBELET_ACI=quay.io/coreos/hyperkube
KUBELET_VERSION=v1.6.1_coreos.0
KUBELET_IMAGE_URL={{.kubelet_image_url}}
KUBELET_IMAGE_TAG={{.kubelet_image_tag}}
- path: /etc/hostname
filesystem: root
mode: 0644
Expand Down
10 changes: 10 additions & 0 deletions platforms/metal/matchers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ resource "matchbox_group" "controller" {
etcd_initial_cluster = "${join(",", formatlist("%s=http://%s:2380", var.tectonic_metal_controller_names, var.tectonic_metal_controller_domains))}"
k8s_dns_service_ip = "${var.tectonic_kube_dns_service_ip}"
ssh_authorized_key = "${var.tectonic_ssh_authorized_key}"

# extra data
etcd_image_tag = "${var.tectonic_versions["etcd"]}"
kubelet_image_url = "${element(split(":", var.tectonic_container_images["hyperkube"]), 0)}"
kubelet_image_tag = "${element(split(":", var.tectonic_container_images["hyperkube"]), 1)}"
}
}

Expand All @@ -53,5 +58,10 @@ resource "matchbox_group" "worker" {
etcd_endpoints = "${join(",", formatlist("%s:2379", var.tectonic_metal_controller_domains))}"
k8s_dns_service_ip = "${var.tectonic_kube_dns_service_ip}"
ssh_authorized_key = "${var.tectonic_ssh_authorized_key}"

# extra data
etcd_image_tag = "${var.tectonic_versions["etcd"]}"
kubelet_image_url = "${element(split(":", var.tectonic_container_images["hyperkube"]), 0)}"
kubelet_image_tag = "${element(split(":", var.tectonic_container_images["hyperkube"]), 1)}"
}
}