3 ##############################################################################
4 # Copyright (c) 2019 Huawei Tech and others. #
6 # All rights reserved. This program and the accompanying materials #
7 # are made available under the terms of the Apache License, Version 2.0 #
8 # which accompanies this distribution, and is available at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
10 ##############################################################################
14 DOCKER_VERSION=18.09.6
20 # This script will install docker, kubeadm on both Eliot Master and Edge nodes
22 sudo sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' \
23 /etc/sysconfig/selinux
25 sudo modprobe br_netfilter
26 _conf='/etc/sysctl.d/99-akraino-eliot.conf'
27 echo 'net.bridge.bridge-nf-call-iptables = 1' |& sudo tee "${_conf}"
28 sudo sysctl -q -p "${_conf}"
30 #echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables
34 sudo yum install -y yum-utils device-mapper-persistent-data lvm2
36 sudo yum-config-manager \
37 --add-repo https://download.docker.com/linux/centos/docker-ce.repo
39 sudo yum install docker-ce-${DOCKER_VERSION} docker-ce-cli-${DOCKER_VERSION} \
42 # Kubernetes repository set
44 cat <<-EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
47 baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-${MACHINE}
51 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
52 https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
55 # Set SELinux in permissive mode (effectively disabling it)
57 sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
59 yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
60 systemctl enable --now kubelet
62 sudo yum install -y kubeadm-${KUBE_VERSION}
63 sudo systemctl start docker && sudo systemctl enable docker
65 sudo systemctl daemon-reload