mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 21:50:05 +00:00
switch kubelets to connect to etcd on cloud network
Previously we were connecting across the public interfaces. This will connect across eth2 and send communication over a private network.
This commit is contained in:
@@ -6,6 +6,7 @@ write_files:
|
|||||||
roles:
|
roles:
|
||||||
- kubernetes-master
|
- kubernetes-master
|
||||||
cloud: rackspace
|
cloud: rackspace
|
||||||
|
etcd_servers: KUBE_MASTER
|
||||||
path: /etc/salt/minion.d/grains.conf
|
path: /etc/salt/minion.d/grains.conf
|
||||||
- content: |
|
- content: |
|
||||||
auto_accept: True
|
auto_accept: True
|
||||||
|
@@ -16,12 +16,10 @@
|
|||||||
|
|
||||||
# Prepopulate the name of the Master
|
# Prepopulate the name of the Master
|
||||||
mkdir -p /etc/salt/minion.d
|
mkdir -p /etc/salt/minion.d
|
||||||
echo "master: $MASTER_NAME" > /etc/salt/minion.d/master.conf
|
echo master: $MASTER_NAME > /etc/salt/minion.d/master.conf
|
||||||
|
|
||||||
# Turn on debugging for salt-minion
|
# Turn on debugging for salt-minion
|
||||||
# echo "DAEMON_ARGS=\"\$DAEMON_ARGS --log-file-level=debug\"" > /etc/default/salt-minion
|
# echo "DAEMON_ARGS=\"\$DAEMON_ARGS --log-file-level=debug\"" > /etc/default/salt-minion
|
||||||
|
MINION_IP=$(ip -f inet a sh dev eth2 | awk -F '[ \t/]+' '/inet/ { print $3 }' )
|
||||||
MINION_IP=$(ip -f inet a sh dev eth2 | grep -i inet | awk '{print $2}' | cut -d / -f 1)
|
|
||||||
# Our minions will have a pool role to distinguish them from the master.
|
# Our minions will have a pool role to distinguish them from the master.
|
||||||
cat <<EOF >/etc/salt/minion.d/grains.conf
|
cat <<EOF >/etc/salt/minion.d/grains.conf
|
||||||
grains:
|
grains:
|
||||||
@@ -29,22 +27,22 @@ grains:
|
|||||||
- kubernetes-pool
|
- kubernetes-pool
|
||||||
cbr-cidr: $MINION_IP_RANGE
|
cbr-cidr: $MINION_IP_RANGE
|
||||||
minion_ip: $MINION_IP
|
minion_ip: $MINION_IP
|
||||||
|
etcd_servers: $MASTER_NAME
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
#Move all of this to salt
|
#Move all of this to salt
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install bridge-utils -y
|
apt-get install bridge-utils -y
|
||||||
brctl addbr cbr0
|
brctl addbr cbr0
|
||||||
ip link set dev cbr0 up
|
ip l set dev cbr0 up
|
||||||
#for loop to add routes of other minions
|
#for loop to add routes of other minions
|
||||||
for (( i=1; i<=${NUM_MINIONS[@]}; i++)); do
|
for i in `seq 1 $NUM_MINIONS`
|
||||||
ip r a 10.240.$i.0/24 dev cbr0
|
do ip r a 10.240.$i.0/24 dev cbr0
|
||||||
done
|
done
|
||||||
ip link add vxlan42 type vxlan id 42 group 239.0.0.42 dev eth2
|
ip l a vxlan42 type vxlan id 42 group 239.0.0.42 dev eth2
|
||||||
brctl addif cbr0 vxlan42
|
brctl addif cbr0 vxlan42
|
||||||
# Install Salt
|
# Install Salt
|
||||||
#
|
#
|
||||||
# We specify -X to avoid a race condition that can cause minion failure to
|
# We specify -X to avoid a race condition that can cause minion failure to
|
||||||
# install. See https://github.com/saltstack/salt-bootstrap/issues/270
|
# install. See https://github.com/saltstack/salt-bootstrap/issues/270
|
||||||
curl -L http://bootstrap.saltstack.com | sh -s -- -X
|
curl -L http://bootstrap.saltstack.com | sh -s -- -X
|
||||||
ip link set vxlan42 up
|
ip l set vxlan42 up
|
Reference in New Issue
Block a user