#!/bin/bash # Copyright (c) 2017 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. STACKUBE_ROOT=$(dirname "${BASH_SOURCE}") # Default release of Kubernetes is latest stable KUBE_RELEASE=${KUBE_RELEASE:-"stable-1.8"} # Get stable version from release URL version=`curl -sSL dl.k8s.io/release/${KUBE_RELEASE}.txt` # Change v1.8.2 to 1.8.2 export KUBE_VERSION=${version#"v"} function install_docker { if is_ubuntu; then sudo apt-get update sudo apt-get install -y docker.io elif is_fedora; then sudo yum install -y docker else exit_distro_not_supported fi sudo systemctl start docker } function install_hyper { if is_ubuntu; then sudo apt-get update && sudo apt-get install -y qemu libvirt-bin elif is_fedora; then sudo yum install -y libvirt fi sudo systemctl restart libvirtd if command -v /usr/bin/hyperd > /dev/null 2>&1; then echo "hyperd already installed on this host, using it instead" else curl -sSL https://hypercontainer.io/install | sudo bash fi sudo sh -c 'cat>/etc/hyper/config < /dev/null 2>&1; then sudo rm -f /usr/bin/frakti fi sudo curl -sSL https://github.com/kubernetes/frakti/releases/download/${FRAKTI_VERSION}/frakti -o /usr/bin/frakti sudo chmod +x /usr/bin/frakti cgroup_driver=$(sudo docker info | awk '/Cgroup Driver/{print $3}') sudo sh -c "cat > /lib/systemd/system/frakti.service < /etc/yum.repos.d/kubernetes.repo < /etc/apt/sources.list.d/kubernetes.list <stackube-configmap.yaml <