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
|
2018-04-04 09:42:45 +02:00
|
|
|
- path: /etc/systemd/system/cloud-metadata.service
|
|
|
|
content: |
|
|
|
|
[Unit]
|
2018-04-14 09:37:53 +02:00
|
|
|
Description=Cloud metadata agent
|
2018-04-04 09:42:45 +02:00
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
2018-04-14 09:37:53 +02:00
|
|
|
Environment=OUTPUT=/run/metadata/cloud
|
2018-04-04 09:42:45 +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-04-04 09:42:45 +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 /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 \
|
|
|
|
--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/master \
|
|
|
|
--node-labels=node-role.kubernetes.io/controller="true" \
|
|
|
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
|
|
|
--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]
|
2018-07-29 20:27:37 +02:00
|
|
|
- "atomic install --system --name=etcd quay.io/poseidon/etcd:v3.3.9"
|
2018-09-14 03:48:07 +02:00
|
|
|
- "atomic install --system --name=kubelet quay.io/poseidon/kubelet:v1.11.3"
|
2018-07-29 20:20:17 +02:00
|
|
|
- "atomic install --system --name=bootkube quay.io/poseidon/bootkube:v0.13.0"
|
2018-04-06 08:11:34 +02:00
|
|
|
- [systemctl, start, --no-block, etcd.service]
|
2018-03-25 09:08:03 +02:00
|
|
|
- [systemctl, enable, cloud-metadata.service]
|
|
|
|
- [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}"
|