Last active
November 11, 2021 15:37
-
-
Save ccollicutt/cf2c8410a30c343115a393c043aefe4d to your computer and use it in GitHub Desktop.
Install ONAP on Single Node Kubernetes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Create packet node | |
# | |
export MAX_PRICE=0.40 | |
export FACILITY=ewr1 | |
export PLAN=c1.xlarge.x86 | |
packet baremetal create-device --facility $FACILITY --spot-instance \ | |
--spot-price-max $MAX_PRICE --plan $PLAN \ | |
--hostname k8s -s --tags controller --os-type ubuntu_16_04 | |
# | |
# Wait for baremetal instance to be deployed | |
# | |
# tzdata is missing in packet.net??? | |
# /etc/localtime broken, ONAP docker containers fail as they are all trying to mount it in a volume... | |
export DEBIAN_FRONTEND=noninteractive | |
apt install -y tzdata | |
# | |
# Docker | |
# | |
apt install apt-transport-https -y | |
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list | |
deb http://apt.kubernetes.io/ kubernetes-xenial main | |
EOF | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
apt update | |
mkfs.ext4 /dev/nvme0n1 | |
apt-get install --no-install-recommends \ | |
apt-transport-https \ | |
curl \ | |
software-properties-common -y | |
apt-get install -y --no-install-recommends \ | |
linux-image-extra-$(uname -r) \ | |
linux-image-extra-virtual -y | |
curl -fsSL 'https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e' | sudo apt-key add - | |
add-apt-repository \ | |
"deb https://packages.docker.com/1.13/apt/repo/ \ | |
ubuntu-$(lsb_release -cs) \ | |
main" | |
apt-get update | |
apt-get -y install docker-engine | |
systemctl stop docker | |
cp -au /var/lib/docker /var/lib/docker.bk | |
rm -rf /var/lib/docker/* | |
mount /dev/nvme0n1 /var/lib/docker | |
cp -au /var/lib/docker.bk/* /var/lib/docker/ | |
systemctl start docker | |
# | |
# Kubernetes | |
# | |
apt-get install -y \ | |
kubeadm=1.11.1-00 kubelet=1.11.1-00 kubectl=1.11.1-00 | |
wget https://goo.gl/eWLkzb -O calico.yaml | |
swapoff -a | |
kubeadm init --pod-network-cidr 192.168.0.0/16 | |
#kubeadm init --pod-network-cidr 192.168.0.0/16 --skip-preflight-checks | |
#outputs | |
mkdir -p $HOME/.kube | |
cp -i /etc/kubernetes/admin.conf $HOME/.kube/config | |
kubectl taint nodes --all node-role.kubernetes.io/master- | |
alias k=kubectl | |
alias ks="kubectl get all --all-namespaces" | |
k apply -f calico.yaml | |
# | |
# ONAP | |
# | |
# setup helm | |
wget http://storage.googleapis.com/kubernetes-helm/helm-v2.8.2-linux-amd64.tar.gz | |
tar -zxvf helm-v2.8.2-linux-amd64.tar.gz | |
mv linux-amd64/helm /usr/local/bin/helm | |
# not sure if this is needed...https://stackoverflow.com/questions/46672523/helm-list-cannot-list-configmaps-in-the-namespace-kube-system | |
kubectl create serviceaccount --namespace kube-system tiller | |
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller | |
helm init --service-account tiller | |
helm repo remove stable | |
# get oom | |
git clone -b beijing http://gerrit.onap.org/r/oom | |
cd oom/kubernetes | |
# install charts | |
helm serve & | |
helm repo add local http://127.0.0.1:8879 | |
# install all charts locally | |
make all | |
# deploy onap | |
helm install local/onap -n dev | |
# NOTE: Everytihng works but deploying ONAP :) *sigh* | |
# NOTE: onap creates ~210 pods at this time...this is why this fails, plus likely other reasons too :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment