-
Notifications
You must be signed in to change notification settings - Fork 0
/
flannal+kubernetes+docker
53 lines (40 loc) · 1.43 KB
/
flannal+kubernetes+docker
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
48
49
50
51
52
53
# Deploy flannal with kubernetes on Centos
# turn off the firewall
systemctl disable firewalld && systemctl stop firewalld
# install docker && start docker
yum install -y docker
systemctl enable docker && systemctl start docker
# install kubernetes(kubeadm, kubelet and kubectl) && start
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
# Disabling SELinux
setenforce 0
yum install -y kubelet kubeadm kubectl
systemctl enable kubelet && systemctl start kubelet
# ensure iptables
cat <<EOF > /usr/lib/sysctl.d/00-system.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system
echo 1 > /proc/sys/net/ipv4/ip_forward
# check cgroups
docker info | grep -i cgroup
cat /etc/systemd/system/kubelet.service.d/10-kubeadm.conf | grep -i cgroup
# restart to validate changes
systemctl daemon-reload
systemctl restart kubelet
# init
kubeadm init --pod-network-cidr=10.244.0.0/16
# enable master node being scheduled
export KUBECONFIG=/etc/kubernetes/admin.conf
kubectl taint nodes --all node-role.kubernetes.io/master:NoSchedule-
# flannal
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml