2018-03-25 09:08:03 +02:00
|
|
|
#cloud-config
|
|
|
|
write_files:
|
|
|
|
- path: /etc/etcd/etcd.conf
|
|
|
|
content: |
|
|
|
|
ETCD_NAME=${etcd_name}
|
|
|
|
ETCD_DATA_DIR=/var/lib/etcd
|
|
|
|
ETCD_ADVERTISE_CLIENT_URLS=https://${etcd_domain}:2379
|
|
|
|
ETCD_INITIAL_ADVERTISE_PEER_URLS=https://${etcd_domain}:2380
|
|
|
|
ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:2379
|
|
|
|
ETCD_LISTEN_PEER_URLS=https://0.0.0.0:2380
|
2018-04-09 00:42:45 +02:00
|
|
|
ETCD_LISTEN_METRICS_URLS=http://0.0.0.0:2381
|
2018-03-25 09:08:03 +02:00
|
|
|
ETCD_INITIAL_CLUSTER=${etcd_initial_cluster}
|
|
|
|
ETCD_STRICT_RECONFIG_CHECK=true
|
|
|
|
ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/server-ca.crt
|
|
|
|
ETCD_CERT_FILE=/etc/ssl/certs/etcd/server.crt
|
|
|
|
ETCD_KEY_FILE=/etc/ssl/certs/etcd/server.key
|
|
|
|
ETCD_CLIENT_CERT_AUTH=true
|
|
|
|
ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/peer-ca.crt
|
|
|
|
ETCD_PEER_CERT_FILE=/etc/ssl/certs/etcd/peer.crt
|
|
|
|
ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key
|
|
|
|
ETCD_PEER_CLIENT_CERT_AUTH=true
|
2019-03-14 08:55:55 +01:00
|
|
|
- path: /etc/systemd/system/cloud-metadata.service
|
|
|
|
content: |
|
|
|
|
[Unit]
|
|
|
|
Description=Cloud metadata agent
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
|
|
|
Environment=OUTPUT=/run/metadata/cloud
|
|
|
|
ExecStart=/usr/bin/mkdir -p /run/metadata
|
|
|
|
ExecStart=/usr/bin/bash -c 'echo "HOSTNAME_OVERRIDE=$(curl\
|
|
|
|
--url http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address\
|
|
|
|
--retry 10)" > $${OUTPUT}'
|
|
|
|
[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]
|
2019-03-14 08:55:55 +01:00
|
|
|
Requires=cloud-metadata.service
|
|
|
|
After=cloud-metadata.service
|
2018-03-25 09:08:03 +02:00
|
|
|
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 /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"
|
2018-04-07 09:47:33 +02:00
|
|
|
Restart=always
|
|
|
|
RestartSec=10
|
|
|
|
- path: /etc/kubernetes/kubelet.conf
|
|
|
|
content: |
|
2018-06-28 07:47:35 +02:00
|
|
|
ARGS="--anonymous-auth=false \
|
2018-05-14 08:20:42 +02:00
|
|
|
--authentication-token-webhook \
|
|
|
|
--authorization-mode=Webhook \
|
2018-03-25 09:08:03 +02:00
|
|
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
2019-01-05 22:32:03 +01:00
|
|
|
--cluster_dns=${cluster_dns_service_ip} \
|
2018-03-25 09:08:03 +02:00
|
|
|
--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/master \
|
|
|
|
--node-labels=node-role.kubernetes.io/controller="true" \
|
|
|
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
2018-05-14 03:16:10 +02:00
|
|
|
--read-only-port=0 \
|
2018-03-25 09:08:03 +02:00
|
|
|
--register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
|
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
|
2018-04-18 08:31:09 +02:00
|
|
|
- path: /var/lib/bootkube/.keep
|
2018-04-04 09:42:45 +02:00
|
|
|
- path: /etc/selinux/config
|
|
|
|
owner: root:root
|
|
|
|
permissions: '0644'
|
|
|
|
content: |
|
|
|
|
SELINUX=permissive
|
|
|
|
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:
|
|
|
|
- [systemctl, daemon-reload]
|
2019-02-09 20:54:54 +01:00
|
|
|
- "atomic install --system --name=etcd quay.io/poseidon/etcd:v3.3.12"
|
2019-03-01 07:42:04 +01:00
|
|
|
- "atomic install --system --name=kubelet quay.io/poseidon/kubelet:v1.13.4"
|
2018-11-07 08:35:11 +01:00
|
|
|
- "atomic install --system --name=bootkube quay.io/poseidon/bootkube:v0.14.0"
|
2018-04-06 08:11:34 +02:00
|
|
|
- [systemctl, start, --no-block, etcd.service]
|
2019-03-14 08:55:55 +01:00
|
|
|
- [systemctl, enable, cloud-metadata.service]
|
2018-03-25 09:08:03 +02:00
|
|
|
- [systemctl, enable, kubelet.path]
|
|
|
|
- [systemctl, start, --no-block, kubelet.path]
|
|
|
|
users:
|
|
|
|
- default
|
|
|
|
- name: fedora
|
|
|
|
gecos: Fedora Admin
|
|
|
|
sudo: ALL=(ALL) NOPASSWD:ALL
|
|
|
|
groups: wheel,adm,systemd-journal,docker
|
|
|
|
ssh-authorized-keys:
|
|
|
|
- "${ssh_authorized_key}"
|