mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-01-27 10:19:35 +00:00
160 lines
5.3 KiB
YAML
160 lines
5.3 KiB
YAML
---
|
|
systemd:
|
|
units:
|
|
- name: etcd-member.service
|
|
enable: true
|
|
dropins:
|
|
- name: 40-etcd-cluster.conf
|
|
contents: |
|
|
[Service]
|
|
Environment="ETCD_IMAGE_TAG=v3.1.0"
|
|
Environment="ETCD_NAME={{.etcd_name}}"
|
|
Environment="ETCD_ADVERTISE_CLIENT_URLS=http://{{.domain_name}}:2379"
|
|
Environment="ETCD_INITIAL_ADVERTISE_PEER_URLS=http://{{.domain_name}}:2380"
|
|
Environment="ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379"
|
|
Environment="ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380"
|
|
Environment="ETCD_INITIAL_CLUSTER={{.etcd_initial_cluster}}"
|
|
Environment="ETCD_STRICT_RECONFIG_CHECK=true"
|
|
- name: docker.service
|
|
enable: true
|
|
- name: locksmithd.service
|
|
dropins:
|
|
- name: 40-etcd-lock.conf
|
|
contents: |
|
|
[Service]
|
|
Environment="REBOOT_STRATEGY=etcd-lock"
|
|
- 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 ACI
|
|
[Service]
|
|
Environment="RKT_OPTS=--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 \
|
|
--mount volume=var-lib-cni,target=/var/lib/cni \
|
|
--volume var-log,kind=host,source=/var/log \
|
|
--mount volume=var-log,target=/var/log"
|
|
EnvironmentFile=/etc/kubernetes/kubelet.env
|
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
|
ExecStartPre=/bin/mkdir -p /srv/kubernetes/manifests
|
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/checkpoint-secrets
|
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
|
ExecStartPre=/bin/mkdir -p /var/lib/cni
|
|
ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/run/kubelet-pod.uuid
|
|
ExecStart=/usr/lib/coreos/kubelet-wrapper \
|
|
--kubeconfig=/etc/kubernetes/kubeconfig \
|
|
--require-kubeconfig \
|
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
|
--network-plugin=cni \
|
|
--lock-file=/var/run/lock/kubelet.lock \
|
|
--exit-on-lock-contention \
|
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
|
--allow-privileged \
|
|
--hostname-override={{.domain_name}} \
|
|
--node-labels=master=true \
|
|
--cluster_dns={{.k8s_dns_service_ip}} \
|
|
--cluster_domain=cluster.local
|
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/run/kubelet-pod.uuid
|
|
Restart=always
|
|
RestartSec=10
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
- name: bootkube.service
|
|
contents: |
|
|
[Unit]
|
|
Description=Bootstrap a Kubernetes control plane with a temp api-server
|
|
[Service]
|
|
Type=simple
|
|
WorkingDirectory=/opt/bootkube
|
|
ExecStart=/opt/bootkube/bootkube-start
|
|
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.5.2_coreos.2
|
|
- 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
|
|
- path: /opt/bootkube/bootkube-start
|
|
filesystem: root
|
|
mode: 0544
|
|
user:
|
|
id: 500
|
|
group:
|
|
id: 500
|
|
contents:
|
|
inline: |
|
|
#!/bin/bash
|
|
# Wrapper for bootkube start
|
|
set -e
|
|
BOOTKUBE_ACI="${BOOTKUBE_ACI:-quay.io/coreos/bootkube}"
|
|
BOOTKUBE_VERSION="${BOOTKUBE_VERSION:-v0.3.7}"
|
|
BOOTKUBE_ASSETS="${BOOTKUBE_ASSETS:-/opt/bootkube/assets}"
|
|
exec /usr/bin/rkt run \
|
|
--trust-keys-from-https \
|
|
--volume assets,kind=host,source=$BOOTKUBE_ASSETS \
|
|
--mount volume=assets,target=/assets \
|
|
$RKT_OPTS \
|
|
${BOOTKUBE_ACI}:${BOOTKUBE_VERSION} --net=host --exec=/bootkube -- start --asset-dir=/assets --etcd-server=http://127.0.0.1:2379 "$@"
|
|
|
|
{{ if index . "ssh_authorized_keys" }}
|
|
passwd:
|
|
users:
|
|
- name: core
|
|
ssh_authorized_keys:
|
|
{{ range $element := .ssh_authorized_keys }}
|
|
- {{$element}}
|
|
{{end}}
|
|
{{end}}
|