2 # Copyright (c) 2018 Cisco and/or its affiliates.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
17 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
20 source ${SCRIPT_DIR}/config/defaults
21 source ${SCRIPT_DIR}/shell/dpdk_utils.sh
22 source ${SCRIPT_DIR}/shell/k8s_utils.sh
27 if echo $line | grep -F = &>/dev/null
29 varname=$(echo "$line" | cut -d '=' -f 1)
30 cfg[$varname]=$(echo "$line" | cut -d '=' -f 2-)
32 done < ${script_dir}/../config/config
34 trap "k8s_utils.destroy" ERR
38 # Revert any changes made to this host by 'kubeadm init'
40 # Sets up the Kubernetes master
44 # Revert any changes made to this host by 'kubeadm init'
46 # Load kernel modules uio/uio_pci_generic
47 dpdk_utils.load_modules
48 # Sets up the Kubernetes master
49 k8s_utils.prepare "--pod-network-cidr=192.168.0.0/16"
51 k8s_utils.calico_deploy ${cfg[K8S_CALICO]}
52 # Dump Kubernetes objects ...
56 # Set affinity for all non VPP docker containers to CPU 0
57 k8s_utils.affinity_non_vpp
60 # Revert any changes made to this host by 'kubeadm init'
64 echo "usage: $0 function"
68 echo " affinity_non_vpp"
74 echo Kubernetes setup finished