2 # Copyright (c) 2021 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/k8s_utils.sh
23 trap "k8s_utils.destroy" ERR
27 # Revert any changes made to this host by 'kubeadm init'
29 # Sets up the Kubernetes master
33 # Revert any changes made to this host by 'kubeadm init'
35 # Load kernel modules uio/uio_pci_generic
37 sudo modprobe uio_pci_generic
38 sudo modprobe vfio_pci
39 # Sets up the Kubernetes master
40 k8s_utils.prepare "--pod-network-cidr=192.168.0.0/16"
42 k8s_utils.calico_deploy ${cfg[K8S_CALICO]}
43 # Dump Kubernetes objects ...
47 # Set affinity for all non VPP docker containers to CPU 0
48 k8s_utils.affinity_non_vpp
51 # Revert any changes made to this host by 'kubeadm init'
55 echo "usage: $0 function"
59 echo " affinity_non_vpp"
65 echo Kubernetes setup finished