mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-21 14:38:46 +00:00
Whereas CoreOS is still shipped with etcd 0.4.9, kubernetes has moved to etcd 2.0.4. This version mismatch makes kubernetes unable to use etcd. Kubernetes’ logs are full of “502: (unhandled http status [Temporary Redirect] with body []) [0]” This change makes libvirt-coreos cluster explicitly use etcd v2.0.9 instead of the one shipped within CoreOS. This change aims at being reverted once CoreOS will migrate to etcd 2. This migration is tracked at: https://github.com/coreos/bugs/issues/317
134 lines
3.0 KiB
YAML
134 lines
3.0 KiB
YAML
#cloud-config
|
|
|
|
hostname: ${name}
|
|
|
|
ssh_authorized_keys:
|
|
${ssh_keys}
|
|
|
|
write_files:
|
|
- path: /etc/systemd/journald.conf
|
|
permissions: 0644
|
|
content: |
|
|
[Journal]
|
|
SystemMaxUse=50M
|
|
RuntimeMaxUse=50M
|
|
|
|
coreos:
|
|
etcd:
|
|
name: ${name}
|
|
addr: ${public_ip}:4001
|
|
# bind-addr: 0.0.0.0
|
|
peer-addr: ${public_ip}:7001
|
|
# peers: {etcd_peers}
|
|
discovery: ${discovery}
|
|
units:
|
|
- name: etcd.service
|
|
drop-ins:
|
|
- name: opt-etcd2.conf
|
|
content: |
|
|
[Unit]
|
|
After=opt-etcd.mount
|
|
Requires=opt-etcd.mount
|
|
|
|
[Service]
|
|
ExecStart=
|
|
ExecStart=/opt/etcd/bin/etcd
|
|
- name: static.network
|
|
command: start
|
|
content: |
|
|
[Match]
|
|
# Name=eth0
|
|
MACAddress=52:54:00:00:00:${i}
|
|
|
|
[Network]
|
|
Address=${public_ip}/24
|
|
DNS=192.168.10.254
|
|
Gateway=192.168.10.254
|
|
- name: cbr0.netdev
|
|
command: start
|
|
content: |
|
|
[NetDev]
|
|
Kind=bridge
|
|
Name=cbr0
|
|
- name: cbr0.network
|
|
command: start
|
|
content: |
|
|
[Match]
|
|
Name=cbr0
|
|
|
|
[Network]
|
|
Address=${MINION_CONTAINER_SUBNETS[$i]}
|
|
|
|
[Route]
|
|
Destination=${CONTAINER_SUBNET}
|
|
- name: cbr0-interface.network
|
|
command: start
|
|
content: |
|
|
[Match]
|
|
# Name=eth1
|
|
MACAddress=52:54:00:00:01:${i}
|
|
|
|
[Network]
|
|
Bridge=cbr0
|
|
- name: nat.service
|
|
command: start
|
|
content: |
|
|
[Unit]
|
|
Description=NAT non container traffic
|
|
|
|
[Service]
|
|
ExecStart=/usr/sbin/iptables -w -t nat -A POSTROUTING -o eth0 -j MASQUERADE ! -d ${CONTAINER_SUBNET}
|
|
RemainAfterExit=yes
|
|
Type=oneshot
|
|
- name: etcd.service
|
|
command: start
|
|
- name: docker.service
|
|
command: start
|
|
drop-ins:
|
|
- name: 50-opts.conf
|
|
content: |
|
|
[Service]
|
|
Environment=DOCKER_OPTS='--bridge=cbr0 --iptables=false'
|
|
- name: docker-tcp.socket
|
|
command: start
|
|
enable: yes
|
|
content: |
|
|
[Unit]
|
|
Description=Docker Socket for the API
|
|
|
|
[Socket]
|
|
ListenStream=2375
|
|
BindIPv6Only=both
|
|
Service=docker.service
|
|
|
|
[Install]
|
|
WantedBy=sockets.target
|
|
- name: opt-kubernetes.mount
|
|
command: start
|
|
content: |
|
|
[Unit]
|
|
ConditionVirtualization=|vm
|
|
|
|
[Mount]
|
|
What=kubernetes
|
|
Where=/opt/kubernetes
|
|
Options=ro,trans=virtio,version=9p2000.L
|
|
Type=9p
|
|
- name: opt-etcd.mount
|
|
command: start
|
|
content: |
|
|
[Unit]
|
|
ConditionVirtualization=|vm
|
|
|
|
[Mount]
|
|
What=etcd
|
|
Where=/opt/etcd
|
|
Options=ro,trans=virtio,version=9p2000.L
|
|
Type=9p
|
|
update:
|
|
group: ${COREOS_CHANNEL:-alpha}
|
|
reboot-strategy: off
|
|
|
|
$( [[ ${type} =~ "master" ]] && render-template "$ROOT/user_data_master.yml" )
|
|
$( [[ ${type} =~ "minion" ]] && render-template "$ROOT/user_data_minion.yml" )
|