Some parts of this page are now out of date. Use together with more recent page: Release J - Run in Kubernetes
This article describes the steps to run NONRTRIC in Minikube using a VM created using Vagrant.
...
The installation script is basically the same as the steps described on this page: Deploy NONRTRIC in Minikube but with a few additions.
Prerequisite
Virtualbox. (Can be downloaded from this page Download Virtualbox)
...
Put the following Vagrantfile in that directory.
Vagrantfile |
---|
Vagrant.configure("2") do |config| config.vm.box = "generic/ubuntu1804" config.vm.provision "file", source: "install.sh", destination: "install.sh" config.vm.network "forwarded_port", guest_ip: "127.0.0.1", guest: 8001, host: 9080 end |
This file will create an Ubuntu VM, copy the install script to the VM and setup port forwarding to the kubernetes proxy in the VM.
To be able to run the R-App manager Mock outside the cluster, you need to mount the target directory so that the
helm command can see it like the R-App manager sees it.
Add this line, but replace the first argument with your actual path.
config.vm.synced_folder "/home/qpatbuh/src/nonrtric-prototyping/rapp-manager/target", "/home/vagrant/target"
In addition, if no nonrtric shall be deploy, comment out a few lines in middle of the install.sh below - see the part where the "it/dep" repo is cloned.
Put the following file in the same directory as the Vagrantfile. Make sure that indentation is preserved during copy.
Lgit.io | bash
#Create the service account cat > tiller-serviceaccount.yaml << EOF apiVersion: v1 kind: ServiceAccount metadata: name: tiller namespace: kube-system --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: name: tiller-clusterrolebinding subjects: - kind: ServiceAccount name: tiller namespace: kube-system roleRef: kind: ClusterRole name: cluster-admin apiGroup: "" EOF
kubectl create -f tiller-serviceaccount.yaml
#Fetch and deploy the metrics server kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.7/components.yaml kubectl get deployment metrics-server -n kube-system
#Fetch and deploy the kubernetes dashboard kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.2/aio/deploy/recommended.yaml kubectl delete clusterrolebinding kubernetes-dashboard kubectl create clusterrolebinding kubernetes-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard --user=clusterUser
#Run helm helm init --service-account tiller --upgrade
#Clone dep repo and deploy nonrtric components
|
git ################################################ ## Decomment the following lines ## to install nonrtric (can also be done later) ################################################ #git clone "https://gerrit.o-ran-sc.org/r/it/dep"
|
cd#cd dep/bin #./deploy-nonrtric -f ../nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
|
cd#cd ../..
#Create an account for login to the dashboard cat > eks-admin-service-account.yaml << EOF apiVersion: v1 kind: ServiceAccount metadata: name: eks-admin namespace: kube-system --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: eks-admin roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: eks-admin namespace: kube-system EOF
#Apply the account kubectl apply -f eks-admin-service-account.yaml
#Create serviceaccount and clusterrolebinding and patch the tiller-deployment to user service account. kubectl create serviceaccount --namespace kube-system tiller kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
#Print the 'secret' token. Needed for login from the browser on the host kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep eks-admin | awk '{print $1}')
#Start the proxy so the dashboard can be accessed from the host machine kubectl proxy
|
Set execution mode on the file.
...