2017-07-29 20:35:53 +02:00
|
|
|
---
|
|
|
|
systemd:
|
|
|
|
units:
|
2017-10-04 09:07:48 +02:00
|
|
|
- name: etcd-member.service
|
|
|
|
enable: true
|
|
|
|
dropins:
|
|
|
|
- name: 40-etcd-cluster.conf
|
|
|
|
contents: |
|
|
|
|
[Service]
|
2019-05-04 20:42:51 +02:00
|
|
|
Environment="ETCD_IMAGE_TAG=v3.3.13"
|
2017-10-04 09:07:48 +02:00
|
|
|
Environment="ETCD_NAME=${etcd_name}"
|
|
|
|
Environment="ETCD_ADVERTISE_CLIENT_URLS=https://${etcd_domain}:2379"
|
|
|
|
Environment="ETCD_INITIAL_ADVERTISE_PEER_URLS=https://${etcd_domain}:2380"
|
|
|
|
Environment="ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:2379"
|
|
|
|
Environment="ETCD_LISTEN_PEER_URLS=https://0.0.0.0:2380"
|
2018-03-29 06:45:24 +02:00
|
|
|
Environment="ETCD_LISTEN_METRICS_URLS=http://0.0.0.0:2381"
|
2017-10-04 09:07:48 +02:00
|
|
|
Environment="ETCD_INITIAL_CLUSTER=${etcd_initial_cluster}"
|
|
|
|
Environment="ETCD_STRICT_RECONFIG_CHECK=true"
|
|
|
|
Environment="ETCD_SSL_DIR=/etc/ssl/etcd"
|
|
|
|
Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/server-ca.crt"
|
|
|
|
Environment="ETCD_CERT_FILE=/etc/ssl/certs/etcd/server.crt"
|
|
|
|
Environment="ETCD_KEY_FILE=/etc/ssl/certs/etcd/server.key"
|
|
|
|
Environment="ETCD_CLIENT_CERT_AUTH=true"
|
|
|
|
Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/peer-ca.crt"
|
|
|
|
Environment="ETCD_PEER_CERT_FILE=/etc/ssl/certs/etcd/peer.crt"
|
|
|
|
Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key"
|
|
|
|
Environment="ETCD_PEER_CLIENT_CERT_AUTH=true"
|
2017-07-29 20:35:53 +02:00
|
|
|
- name: docker.service
|
|
|
|
enable: true
|
|
|
|
- name: locksmithd.service
|
|
|
|
mask: true
|
2017-09-14 05:08:28 +02:00
|
|
|
- name: kubelet.path
|
|
|
|
enable: true
|
|
|
|
contents: |
|
|
|
|
[Unit]
|
|
|
|
Description=Watch for kubeconfig
|
|
|
|
[Path]
|
|
|
|
PathExists=/etc/kubernetes/kubeconfig
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
2017-07-29 20:35:53 +02:00
|
|
|
- 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
|
2017-12-04 09:04:31 +01:00
|
|
|
RequiredBy=etcd-member.service
|
2017-07-29 20:35:53 +02:00
|
|
|
- name: kubelet.service
|
|
|
|
contents: |
|
|
|
|
[Unit]
|
2018-01-07 01:20:34 +01:00
|
|
|
Description=Kubelet via Hyperkube
|
2019-03-14 08:55:55 +01:00
|
|
|
Requires=coreos-metadata.service
|
|
|
|
After=coreos-metadata.service
|
2017-09-25 03:04:48 +02:00
|
|
|
Wants=rpc-statd.service
|
2017-07-29 20:35:53 +02:00
|
|
|
[Service]
|
|
|
|
EnvironmentFile=/etc/kubernetes/kubelet.env
|
2019-03-14 08:55:55 +01:00
|
|
|
EnvironmentFile=/run/metadata/coreos
|
2017-09-14 05:49:23 +02:00
|
|
|
Environment="RKT_RUN_ARGS=--uuid-file-save=/var/cache/kubelet-pod.uuid \
|
2017-07-29 20:35:53 +02:00
|
|
|
--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 \
|
2018-04-22 00:13:38 +02:00
|
|
|
--volume var-lib-calico,kind=host,source=/var/lib/calico \
|
|
|
|
--mount volume=var-lib-calico,target=/var/lib/calico \
|
2017-09-14 05:49:23 +02:00
|
|
|
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
|
|
|
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
2017-07-29 20:35:53 +02:00
|
|
|
--volume var-log,kind=host,source=/var/log \
|
2017-10-25 06:34:29 +02:00
|
|
|
--mount volume=var-log,target=/var/log \
|
|
|
|
--insecure-options=image"
|
2017-09-14 05:49:23 +02:00
|
|
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
2017-07-29 20:35:53 +02:00
|
|
|
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
|
2018-04-22 00:13:38 +02:00
|
|
|
ExecStartPre=/bin/mkdir -p /var/lib/calico
|
2018-02-23 07:00:51 +01:00
|
|
|
ExecStartPre=/bin/mkdir -p /var/lib/kubelet/volumeplugins
|
2017-07-29 20:35:53 +02:00
|
|
|
ExecStartPre=/usr/bin/bash -c "grep 'certificate-authority-data' /etc/kubernetes/kubeconfig | awk '{print $2}' | base64 -d > /etc/kubernetes/ca.crt"
|
2017-09-14 05:49:23 +02:00
|
|
|
ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/cache/kubelet-pod.uuid
|
2017-07-29 20:35:53 +02:00
|
|
|
ExecStart=/usr/lib/coreos/kubelet-wrapper \
|
|
|
|
--anonymous-auth=false \
|
2018-05-14 08:20:42 +02:00
|
|
|
--authentication-token-webhook \
|
|
|
|
--authorization-mode=Webhook \
|
2017-09-14 05:49:23 +02:00
|
|
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
2019-01-05 22:32:03 +01:00
|
|
|
--cluster_dns=${cluster_dns_service_ip} \
|
2017-12-09 22:36:59 +01:00
|
|
|
--cluster_domain=${cluster_domain_suffix} \
|
2017-07-29 20:35:53 +02:00
|
|
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
|
|
|
--exit-on-lock-contention \
|
2019-03-14 08:55:55 +01:00
|
|
|
--hostname-override=$${COREOS_DIGITALOCEAN_IPV4_PRIVATE_0} \
|
2017-09-14 05:49:23 +02:00
|
|
|
--kubeconfig=/etc/kubernetes/kubeconfig \
|
|
|
|
--lock-file=/var/run/lock/kubelet.lock \
|
|
|
|
--network-plugin=cni \
|
2017-07-29 20:35:53 +02:00
|
|
|
--node-labels=node-role.kubernetes.io/master \
|
2018-03-11 08:56:01 +01:00
|
|
|
--node-labels=node-role.kubernetes.io/controller="true" \
|
2017-09-14 05:49:23 +02:00
|
|
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
2018-05-14 03:16:10 +02:00
|
|
|
--read-only-port=0 \
|
2018-02-23 07:00:51 +01:00
|
|
|
--register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
|
|
|
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
2017-09-14 05:49:23 +02:00
|
|
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
2017-07-29 20:35:53 +02:00
|
|
|
Restart=always
|
|
|
|
RestartSec=10
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
- name: bootkube.service
|
|
|
|
contents: |
|
|
|
|
[Unit]
|
|
|
|
Description=Bootstrap a Kubernetes cluster
|
|
|
|
ConditionPathExists=!/opt/bootkube/init_bootkube.done
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
|
|
|
RemainAfterExit=true
|
|
|
|
WorkingDirectory=/opt/bootkube
|
|
|
|
ExecStart=/opt/bootkube/bootkube-start
|
|
|
|
ExecStartPost=/bin/touch /opt/bootkube/init_bootkube.done
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
storage:
|
|
|
|
files:
|
|
|
|
- path: /etc/kubernetes/kubelet.env
|
|
|
|
filesystem: root
|
|
|
|
mode: 0644
|
|
|
|
contents:
|
|
|
|
inline: |
|
2018-04-08 21:16:29 +02:00
|
|
|
KUBELET_IMAGE_URL=docker://k8s.gcr.io/hyperkube
|
2019-05-31 10:08:32 +02:00
|
|
|
KUBELET_IMAGE_TAG=v1.14.3
|
2017-07-29 20:35:53 +02:00
|
|
|
- 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
|
|
|
|
# Move experimental manifests
|
2017-12-07 13:28:51 +01:00
|
|
|
[ -n "$(ls /opt/bootkube/assets/manifests-*/* 2>/dev/null)" ] && mv /opt/bootkube/assets/manifests-*/* /opt/bootkube/assets/manifests && rm -rf /opt/bootkube/assets/manifests-*
|
2017-07-29 20:35:53 +02:00
|
|
|
exec /usr/bin/rkt run \
|
|
|
|
--trust-keys-from-https \
|
2018-11-07 08:35:11 +01:00
|
|
|
--volume assets,kind=host,source=/opt/bootkube/assets \
|
2017-07-29 20:35:53 +02:00
|
|
|
--mount volume=assets,target=/assets \
|
|
|
|
--volume bootstrap,kind=host,source=/etc/kubernetes \
|
|
|
|
--mount volume=bootstrap,target=/etc/kubernetes \
|
|
|
|
$${RKT_OPTS} \
|
2018-11-07 08:35:11 +01:00
|
|
|
quay.io/coreos/bootkube:v0.14.0 \
|
2017-07-29 20:35:53 +02:00
|
|
|
--net=host \
|
|
|
|
--dns=host \
|
|
|
|
--exec=/bootkube -- start --asset-dir=/assets "$@"
|