1
0
mirror of https://github.com/jcwimer/multi-cloud-kubernetes synced 2026-03-25 01:44:43 +00:00

Switch to flannel, ignore k8s interfaces for zerotier, hard code dns for both k8s and docker due to systemd resolvd, and disable ipv6

This commit is contained in:
2020-10-17 22:21:29 -04:00
parent 0a6a7d03c7
commit 428b9f9507
9 changed files with 209 additions and 21 deletions

View File

@@ -1,13 +1,43 @@
#!/bin/bash
apt-get update
apt-get install python-dev python-pip curl sudo -y
apt-get install python-dev python-pip curl sudo open-iscsi -y
# Disable ipv6
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
cat <<EOF > /etc/sysctl.d/ipv6.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
EOF
# enable tun module
modprobe tun
cat <<EOF > /etc/modules-load.d/tun.conf
tun
EOF
service networking restart
# force zerotier to ignore kubernetes interfaces when it's looking for a gateway
mkdir -p /var/lib/zerotier-one
cat <<EOF > /var/lib/zerotier-one/local.conf
{
"settings": {
"interfacePrefixBlacklist": [ "flannel", "veth", "cni", "docker" ],
"allowTcpFallbackRelay": false
}
}
EOF
curl -s https://install.zerotier.com | bash
zerotier-cli join ${zerotier_network}
if ! which docker > /dev/null; then
curl -s -L https://raw.githubusercontent.com/rancher/install-docker/master/19.03.9.sh | bash
fi
curl -s https://install.zerotier.com | bash
zerotier-cli join ${zerotier_network}
user=debian
if ! cat /etc/passwd | grep debian; then
# Add the user (--gecos "" ensures that this runs non-interactively)
@@ -32,5 +62,11 @@ if ! cat /etc/passwd | grep debian; then
fi
usermod -a -G docker $user
# for RKE
# iptables -I INPUT -j ACCEPT
mkdir -p /etc/docker
cat <<EOF > /etc/docker/daemon.json
{
"dns": ["1.1.1.1", "8.8.4.4"]
}
EOF
service docker restart