-
Notifications
You must be signed in to change notification settings - Fork 4
/
centos7_template.yml
47 lines (47 loc) · 1.65 KB
/
centos7_template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
yum -y install yum-utils
yum-config-manager --add-repo https://yum.dockerproject.org/repo/main/centos/7
yum -y update
wget http://cbs.centos.org/kojifiles/packages/docker/1.2.0/4.el7.centos/src/docker-1.2.0-4.el7.centos.src.rpm
rpm -i docker-1.2.0-4.el7.centos.src.rpm
yum install dos2unix
rpm -i docker-1.2.0-4.el7.centos.src.rpm
yum install mockbuild
yum install mock
useradd -s /sbin/nologin mockbuild
yum install docker
cat <<EOF > /etc/sysconfig/docker-storage-setup
DEVS=/dev/sdb
VG=docker-vg
EOF
docker-storage-setup
sed "s/OPTIONS=.*/OPTIONS='--selinux-enabled --insecure-registry 172.30.0.0\/16'/g" -i /etc/sysconfig/docker
systemctl enable docker
systemctl start docker
docker ps
sudo yum install -y open-vm-tools perl net-tools
sed -i '/^\(HWADDR\|UUID\)=/d' /etc/sysconfig/network-scripts/ifcfg-e*
sed -i -e 's@^ONBOOT="no@ONBOOT="yes@' /etc/sysconfig/network-scripts/ifcfg-e*
systemctl start vmtoolsd.service
systemctl enable vmtoolsd.service
mkdir -p /var/lib/etcd/etcd.etcd/
chmod 777 -R /var/lib/etcd/etcd.etcd/
cat /etc/sysctl.conf | grep ip_forward
vi /etc/sysctl.conf
echo 1 > /proc/sys/net/ipv4/ip_forward
cat <<EOF > /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
cat /proc/sys/net/ipv4/ip_forward
cat /etc/sysctl.d/k8s.conf
sysctl net.ipv4.ip_forward=1
sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
setenforce 0
swapoff -a
modprobe br_netfilter
echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables
echo '1' > /proc/sys/net/ipv4/ip_forward
sysctl -p
yum install -y device-mapper-persistent-data lvm2
systemctl disable firewalld.service
systemctl stop firewalld