mirror of
https://github.com/kelseyhightower/kubernetes-the-hard-way.git
synced 2025-08-08 20:02:42 +03:00
kubernetes-the-hard-way-on-vagrant
This commit is contained in:
2
vagrant/ubuntu/allow-bridge-nf-traffic.sh
Normal file
2
vagrant/ubuntu/allow-bridge-nf-traffic.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
sysctl net.bridge.bridge-nf-call-iptables=1
|
14
vagrant/ubuntu/install-docker.sh
Normal file
14
vagrant/ubuntu/install-docker.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
apt-get update \
|
||||
&& apt-get install -y \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
software-properties-common \
|
||||
&& curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
|
||||
&& add-apt-repository \
|
||||
"deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
|
||||
$(lsb_release -cs) \
|
||||
stable" \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 18.06 | head -1 | awk '{print $3}')
|
5
vagrant/ubuntu/update-dns.sh
Normal file
5
vagrant/ubuntu/update-dns.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
sed -i -e 's/#DNS=/DNS=8.8.8.8/' /etc/systemd/resolved.conf
|
||||
|
||||
service systemd-resolved restart
|
14
vagrant/ubuntu/vagrant/install-guest-additions.sh
Normal file
14
vagrant/ubuntu/vagrant/install-guest-additions.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
GUEST_ADDITION_VERSION=5.2.4
|
||||
GUEST_ADDITION_ISO=VBoxGuestAdditions_${GUEST_ADDITION_VERSION}.iso
|
||||
GUEST_ADDITION_MOUNT=/media/VBoxGuestAdditions
|
||||
|
||||
apt-get install linux-headers-$(uname -r) build-essential dkms
|
||||
|
||||
wget http://download.virtualbox.org/virtualbox/${GUEST_ADDITION_VERSION}/${GUEST_ADDITION_ISO}
|
||||
mkdir -p ${GUEST_ADDITION_MOUNT}
|
||||
mount -o loop,ro ${GUEST_ADDITION_ISO} ${GUEST_ADDITION_MOUNT}
|
||||
sh ${GUEST_ADDITION_MOUNT}/VBoxLinuxAdditions.run
|
||||
rm ${GUEST_ADDITION_ISO}
|
||||
umount ${GUEST_ADDITION_MOUNT}
|
||||
rmdir ${GUEST_ADDITION_MOUNT}
|
17
vagrant/ubuntu/vagrant/setup-hosts.sh
Normal file
17
vagrant/ubuntu/vagrant/setup-hosts.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
IFNAME=$1
|
||||
ADDRESS="$(ip -4 addr show $IFNAME | grep "inet" | head -1 |awk '{print $2}' | cut -d/ -f1)"
|
||||
sed -e "s/^.*${HOSTNAME}.*/${ADDRESS} ${HOSTNAME} ${HOSTNAME}.local/" -i /etc/hosts
|
||||
|
||||
# remove ubuntu-bionic entry
|
||||
sed -e '/^.*ubuntu-bionic.*/d' -i /etc/hosts
|
||||
|
||||
# Update /etc/hosts about other hosts
|
||||
cat >> /etc/hosts <<EOF
|
||||
192.168.5.11 master-1
|
||||
192.168.5.12 master-2
|
||||
192.168.5.21 worker-1
|
||||
192.168.5.22 worker-2
|
||||
192.168.5.30 lb
|
||||
EOF
|
Reference in New Issue
Block a user