Remove unmaintained pxe-worker internal module
This commit is contained in:
parent
38adb14bd2
commit
ba9daf439e
|
@ -4,6 +4,8 @@ Notable changes between versions.
|
||||||
|
|
||||||
## Latest
|
## Latest
|
||||||
|
|
||||||
|
* Remove unused, unmaintained `pxe-worker` internal module
|
||||||
|
|
||||||
#### Digital Ocean
|
#### Digital Ocean
|
||||||
|
|
||||||
* Remove optional variable `networking`. Only flannel works on Digital Ocean.
|
* Remove optional variable `networking`. Only flannel works on Digital Ocean.
|
||||||
|
|
|
@ -1,117 +0,0 @@
|
||||||
---
|
|
||||||
systemd:
|
|
||||||
units:
|
|
||||||
- name: docker.service
|
|
||||||
enable: true
|
|
||||||
- name: locksmithd.service
|
|
||||||
mask: true
|
|
||||||
- name: kubelet.path
|
|
||||||
enable: true
|
|
||||||
contents: |
|
|
||||||
[Unit]
|
|
||||||
Description=Watch for kubeconfig
|
|
||||||
[Path]
|
|
||||||
PathExists=/etc/kubernetes/kubeconfig
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
- name: wait-for-dns.service
|
|
||||||
enable: true
|
|
||||||
contents: |
|
|
||||||
[Unit]
|
|
||||||
Description=Wait for DNS entries
|
|
||||||
Wants=systemd-resolved.service
|
|
||||||
Before=kubelet.service
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
RemainAfterExit=true
|
|
||||||
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
|
|
||||||
[Install]
|
|
||||||
RequiredBy=kubelet.service
|
|
||||||
- name: kubelet.service
|
|
||||||
contents: |
|
|
||||||
[Unit]
|
|
||||||
Description=Kubelet via Hyperkube
|
|
||||||
Wants=rpc-statd.service
|
|
||||||
[Service]
|
|
||||||
EnvironmentFile=/etc/kubernetes/kubelet.env
|
|
||||||
Environment="RKT_RUN_ARGS=--uuid-file-save=/var/cache/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 \
|
|
||||||
--mount volume=var-lib-cni,target=/var/lib/cni \
|
|
||||||
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
|
||||||
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
|
||||||
--volume var-log,kind=host,source=/var/log \
|
|
||||||
--mount volume=var-log,target=/var/log \
|
|
||||||
--insecure-options=image"
|
|
||||||
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/checkpoint-secrets
|
|
||||||
ExecStartPre=/bin/mkdir -p /etc/kubernetes/inactive-manifests
|
|
||||||
ExecStartPre=/bin/mkdir -p /var/lib/cni
|
|
||||||
ExecStartPre=/bin/mkdir -p /var/lib/kubelet/volumeplugins
|
|
||||||
ExecStartPre=/usr/bin/bash -c "grep 'certificate-authority-data' /etc/kubernetes/kubeconfig | awk '{print $2}' | base64 -d > /etc/kubernetes/ca.crt"
|
|
||||||
ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/cache/kubelet-pod.uuid
|
|
||||||
ExecStart=/usr/lib/coreos/kubelet-wrapper \
|
|
||||||
--allow-privileged \
|
|
||||||
--anonymous-auth=false \
|
|
||||||
--client-ca-file=/etc/kubernetes/ca.crt \
|
|
||||||
--cluster_dns={{.k8s_dns_service_ip}} \
|
|
||||||
--cluster_domain={{.cluster_domain_suffix}} \
|
|
||||||
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
|
||||||
--exit-on-lock-contention \
|
|
||||||
--hostname-override={{.domain_name}} \
|
|
||||||
--kubeconfig=/etc/kubernetes/kubeconfig \
|
|
||||||
--lock-file=/var/run/lock/kubelet.lock \
|
|
||||||
--network-plugin=cni \
|
|
||||||
--node-labels=node-role.kubernetes.io/node \
|
|
||||||
--pod-manifest-path=/etc/kubernetes/manifests \
|
|
||||||
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
|
||||||
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
|
||||||
Restart=always
|
|
||||||
RestartSec=5
|
|
||||||
[Install]
|
|
||||||
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_IMAGE_URL=docker://gcr.io/google_containers/hyperkube
|
|
||||||
KUBELET_IMAGE_TAG=v1.9.6
|
|
||||||
- path: /etc/hostname
|
|
||||||
filesystem: root
|
|
||||||
mode: 0644
|
|
||||||
contents:
|
|
||||||
inline:
|
|
||||||
{{.domain_name}}
|
|
||||||
- path: /etc/sysctl.d/max-user-watches.conf
|
|
||||||
filesystem: root
|
|
||||||
contents:
|
|
||||||
inline: |
|
|
||||||
fs.inotify.max_user_watches=16184
|
|
||||||
passwd:
|
|
||||||
users:
|
|
||||||
- name: core
|
|
||||||
ssh_authorized_keys:
|
|
||||||
- {{.ssh_authorized_key}}
|
|
|
@ -1,19 +0,0 @@
|
||||||
resource "matchbox_group" "workers" {
|
|
||||||
count = "${length(var.worker_names)}"
|
|
||||||
name = "${format("%s-%s", var.cluster_name, element(var.worker_names, count.index))}"
|
|
||||||
profile = "${matchbox_profile.bootkube-worker-pxe.name}"
|
|
||||||
|
|
||||||
selector {
|
|
||||||
mac = "${element(var.worker_macs, count.index)}"
|
|
||||||
}
|
|
||||||
|
|
||||||
metadata {
|
|
||||||
pxe = "true"
|
|
||||||
domain_name = "${element(var.worker_domains, count.index)}"
|
|
||||||
etcd_endpoints = "${join(",", formatlist("%s:2379", var.controller_domains))}"
|
|
||||||
|
|
||||||
k8s_dns_service_ip = "${var.kube_dns_service_ip}"
|
|
||||||
cluster_domain_suffix = "${var.cluster_domain_suffix}"
|
|
||||||
ssh_authorized_key = "${var.ssh_authorized_key}"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
// Container Linux Install profile (from release.core-os.net)
|
|
||||||
resource "matchbox_profile" "bootkube-worker-pxe" {
|
|
||||||
name = "bootkube-worker-pxe"
|
|
||||||
kernel = "http://${var.container_linux_channel}.release.core-os.net/amd64-usr/${var.container_linux_version}/coreos_production_pxe.vmlinuz"
|
|
||||||
|
|
||||||
initrd = [
|
|
||||||
"http://${var.container_linux_channel}.release.core-os.net/amd64-usr/${var.container_linux_version}/coreos_production_pxe_image.cpio.gz",
|
|
||||||
]
|
|
||||||
|
|
||||||
args = [
|
|
||||||
"initrd=coreos_production_pxe_image.cpio.gz",
|
|
||||||
"coreos.config.url=${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}",
|
|
||||||
"coreos.first_boot=yes",
|
|
||||||
"console=tty0",
|
|
||||||
"console=ttyS0",
|
|
||||||
"${var.kernel_args}",
|
|
||||||
]
|
|
||||||
|
|
||||||
container_linux_config = "${file("${path.module}/cl/bootkube-worker.yaml.tmpl")}"
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
# Secure copy kubeconfig to all nodes to activate kubelet.service
|
|
||||||
resource "null_resource" "copy-kubeconfig" {
|
|
||||||
count = "${length(var.worker_names)}"
|
|
||||||
|
|
||||||
connection {
|
|
||||||
type = "ssh"
|
|
||||||
host = "${element(var.worker_domains, count.index)}"
|
|
||||||
user = "core"
|
|
||||||
timeout = "60m"
|
|
||||||
}
|
|
||||||
|
|
||||||
provisioner "file" {
|
|
||||||
content = "${var.kubeconfig}"
|
|
||||||
destination = "$HOME/kubeconfig"
|
|
||||||
}
|
|
||||||
|
|
||||||
provisioner "remote-exec" {
|
|
||||||
inline = [
|
|
||||||
"sudo mv /home/core/kubeconfig /etc/kubernetes/kubeconfig",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,72 +0,0 @@
|
||||||
variable "cluster_name" {
|
|
||||||
description = "Cluster name"
|
|
||||||
type = "string"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "matchbox_http_endpoint" {
|
|
||||||
type = "string"
|
|
||||||
description = "Matchbox HTTP read-only endpoint (e.g. http://matchbox.example.com:8080)"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "container_linux_channel" {
|
|
||||||
type = "string"
|
|
||||||
description = "Container Linux channel corresponding to the container_linux_version"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "container_linux_version" {
|
|
||||||
type = "string"
|
|
||||||
description = "Container Linux version of the kernel/initrd to PXE or the image to install"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "ssh_authorized_key" {
|
|
||||||
type = "string"
|
|
||||||
description = "SSH public key to set as an authorized key"
|
|
||||||
}
|
|
||||||
|
|
||||||
# machines
|
|
||||||
# Terraform's crude "type system" does properly support lists of maps so we do this.
|
|
||||||
|
|
||||||
variable "controller_domains" {
|
|
||||||
type = "list"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "worker_names" {
|
|
||||||
type = "list"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "worker_macs" {
|
|
||||||
type = "list"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "worker_domains" {
|
|
||||||
type = "list"
|
|
||||||
}
|
|
||||||
|
|
||||||
# bootkube
|
|
||||||
|
|
||||||
variable "kubeconfig" {
|
|
||||||
type = "string"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "kube_dns_service_ip" {
|
|
||||||
description = "Kubernetes service IP for kube-dns (must be within server_cidr)"
|
|
||||||
type = "string"
|
|
||||||
default = "10.3.0.10"
|
|
||||||
}
|
|
||||||
|
|
||||||
# optional
|
|
||||||
|
|
||||||
variable "kernel_args" {
|
|
||||||
description = "Additional kernel arguments to provide at PXE boot."
|
|
||||||
type = "list"
|
|
||||||
|
|
||||||
default = [
|
|
||||||
"root=/dev/sda1",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
|
||||||
description = "Queries for domains with the suffix will be answered by kube-dns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
|
|
||||||
type = "string"
|
|
||||||
default = "cluster.local"
|
|
||||||
}
|
|
Loading…
Reference in New Issue