2018-03-25 09:08:03 +02:00
|
|
|
#cloud-config
|
|
|
|
write_files:
|
|
|
|
- path: /etc/systemd/system/cloud-metadata.service
|
|
|
|
content: |
|
|
|
|
[Unit]
|
2018-04-14 09:37:53 +02:00
|
|
|
Description=Cloud metadata agent
|
2018-03-25 09:08:03 +02:00
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
2018-04-14 09:37:53 +02:00
|
|
|
Environment=OUTPUT=/run/metadata/cloud
|
2018-03-25 09:08:03 +02:00
|
|
|
ExecStart=/usr/bin/mkdir -p /run/metadata
|
2018-04-14 09:37:53 +02:00
|
|
|
ExecStart=/usr/bin/bash -c 'echo "HOSTNAME_OVERRIDE=$(curl\
|
2018-03-25 09:08:03 +02:00
|
|
|
--url http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address\
|
|
|
|
--retry 10)" > $${OUTPUT}'
|
2018-04-06 08:11:34 +02:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
2018-04-07 09:47:33 +02:00
|
|
|
- path: /etc/systemd/system/kubelet.service.d/10-typhoon.conf
|
2018-03-25 09:08:03 +02:00
|
|
|
content: |
|
|
|
|
[Unit]
|
|
|
|
Requires=cloud-metadata.service
|
|
|
|
After=cloud-metadata.service
|
|
|
|
Wants=rpc-statd.service
|
|
|
|
[Service]
|
|
|
|
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 /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"
|
2018-04-07 09:47:33 +02:00
|
|
|
Restart=always
|
|
|
|
RestartSec=10
|
|
|
|
- path: /etc/kubernetes/kubelet.conf
|
|
|
|
content: |
|
|
|
|
ARGS="--allow-privileged \
|
2018-03-25 09:08:03 +02:00
|
|
|
--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 \
|
|
|
|
--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 \
|
2018-04-07 09:47:33 +02:00
|
|
|
--volume-plugin-dir=/var/lib/kubelet/volumeplugins"
|
2018-03-25 09:08:03 +02:00
|
|
|
- path: /etc/systemd/system/kubelet.path
|
|
|
|
content: |
|
|
|
|
[Unit]
|
|
|
|
Description=Watch for kubeconfig
|
|
|
|
[Path]
|
|
|
|
PathExists=/etc/kubernetes/kubeconfig
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
- path: /etc/selinux/config
|
2018-04-04 09:42:45 +02:00
|
|
|
owner: root:root
|
|
|
|
permissions: '0644'
|
2018-03-25 09:08:03 +02:00
|
|
|
content: |
|
|
|
|
SELINUX=permissive
|
2018-04-04 09:42:45 +02:00
|
|
|
SELINUXTYPE=targeted
|
|
|
|
bootcmd:
|
|
|
|
- [setenforce, Permissive]
|
2018-04-14 09:37:53 +02:00
|
|
|
- [systemctl, disable, firewalld, --now]
|
2018-04-26 03:55:51 +02:00
|
|
|
# https://github.com/kubernetes/kubernetes/issues/60869
|
|
|
|
- [modprobe, ip_vs]
|
2018-03-25 09:08:03 +02:00
|
|
|
runcmd:
|
2018-04-14 09:37:53 +02:00
|
|
|
- [systemctl, daemon-reload]
|
|
|
|
- [systemctl, enable, cloud-metadata.service]
|
2018-04-26 03:15:18 +02:00
|
|
|
- "atomic install --system --name=kubelet quay.io/poseidon/kubelet:v1.10.1"
|
2018-04-14 09:37:53 +02:00
|
|
|
- [systemctl, enable, kubelet.path]
|
|
|
|
- [systemctl, start, --no-block, kubelet.path]
|
2018-03-25 09:08:03 +02:00
|
|
|
users:
|
|
|
|
- default
|
|
|
|
- name: fedora
|
|
|
|
gecos: Fedora Admin
|
|
|
|
sudo: ALL=(ALL) NOPASSWD:ALL
|
|
|
|
groups: wheel,adm,systemd-journal,docker
|
|
|
|
ssh-authorized-keys:
|
|
|
|
- "${ssh_authorized_key}"
|