2017-07-25 08:16:34 +02:00
|
|
|
---
|
|
|
|
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]
|
2018-01-07 01:20:34 +01:00
|
|
|
Description=Kubelet via Hyperkube
|
2017-09-25 03:04:48 +02:00
|
|
|
Wants=rpc-statd.service
|
2017-07-25 08:16:34 +02:00
|
|
|
[Service]
|
|
|
|
EnvironmentFile=/etc/kubernetes/kubelet.env
|
2017-09-14 17:41:17 +02:00
|
|
|
Environment="RKT_RUN_ARGS=--uuid-file-save=/var/cache/kubelet-pod.uuid \
|
2017-07-25 08:16:34 +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 17:41:17 +02:00
|
|
|
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
|
|
|
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
2017-07-25 08:16:34 +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 17:41:17 +02:00
|
|
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
2017-07-25 08:16:34 +02:00
|
|
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
|
|
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
|
|
|
ExecStartPre=/bin/mkdir -p /var/lib/cni
|
2018-04-22 00:13:38 +02:00
|
|
|
ExecStartPre=/bin/mkdir -p /var/lib/calico
|
2017-11-11 23:13:54 +01:00
|
|
|
ExecStartPre=/bin/mkdir -p /var/lib/kubelet/volumeplugins
|
2017-07-25 08:16:34 +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 17:41:17 +02:00
|
|
|
ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/cache/kubelet-pod.uuid
|
2017-07-25 08:16:34 +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 17:41:17 +02:00
|
|
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
2017-09-23 20:49:12 +02:00
|
|
|
--cluster_dns=${k8s_dns_service_ip} \
|
2017-12-09 22:36:59 +01:00
|
|
|
--cluster_domain=${cluster_domain_suffix} \
|
2017-07-25 08:16:34 +02:00
|
|
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
|
|
|
--exit-on-lock-contention \
|
2017-09-23 20:49:12 +02:00
|
|
|
--hostname-override=${domain_name} \
|
2017-09-14 17:41:17 +02:00
|
|
|
--kubeconfig=/etc/kubernetes/kubeconfig \
|
|
|
|
--lock-file=/var/run/lock/kubelet.lock \
|
|
|
|
--network-plugin=cni \
|
2017-07-25 08:16:34 +02:00
|
|
|
--node-labels=node-role.kubernetes.io/node \
|
2017-11-11 23:13:54 +01:00
|
|
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
2018-05-14 03:16:10 +02:00
|
|
|
--read-only-port=0 \
|
2017-11-11 23:13:54 +01:00
|
|
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins
|
2017-09-14 17:41:17 +02:00
|
|
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
2017-07-25 08:16:34 +02:00
|
|
|
Restart=always
|
|
|
|
RestartSec=5
|
|
|
|
[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
|
2018-10-28 00:47:57 +02:00
|
|
|
KUBELET_IMAGE_TAG=v1.12.2
|
2017-07-25 08:16:34 +02:00
|
|
|
- path: /etc/hostname
|
|
|
|
filesystem: root
|
|
|
|
mode: 0644
|
|
|
|
contents:
|
|
|
|
inline:
|
2017-09-23 20:49:12 +02:00
|
|
|
${domain_name}
|
2017-07-25 08:16:34 +02:00
|
|
|
- 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:
|
2017-09-23 20:49:12 +02:00
|
|
|
- ${ssh_authorized_key}
|
2017-07-25 08:16:34 +02:00
|
|
|
|