AIO and MUNO mode upgrade for EG 1.5.0 version
[eliot.git] / scripts / k8sworker.sh
1 #!/bin/bash -ex
2 ##############################################################################
3 # Copyright (c) 2019 Huawei Tech and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 KUBE_VERSION=1.16.0-00
12 K8S_CNI_VERSION=0.7.5-00
13
14 # Install Kubernetes with Kubeadm
15 # The script will be executed in Eliot Edge Node
16
17 sudo swapoff -a
18 sudo apt update
19 sudo apt install -y apt-transport-https curl
20 curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
21
22 cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
23 deb https://apt.kubernetes.io/ kubernetes-xenial main
24 EOF
25
26 sudo apt update
27 sudo apt install -y \
28   kubeadm=${KUBE_VERSION} kubelet=${KUBE_VERSION} kubernetes-cni=${K8S_CNI_VERSION}
29
30 #sudo apt-mark hold kubelet kubeadm