Skip to content
Snippets Groups Projects
vm-install-osm.sh 1.57 KiB
Newer Older
#!/bin/bash
echo $0 started at $(date)

sudo snap install microk8s --classic --channel=1.26/stable
sudo snap install jq

sudo mkdir -p /var/snap/microk8s/current/args/certs.d/docker.io
cat << EOF | sudo tee /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml
server = "http://172.21.1.1:5000"

[host."http://172.21.1.1:5000"]
capabilities = ["pull", "resolve"]
skip_verify = true
plain-http = true
EOF

sudo systemctl restart snap.microk8s.daemon-containerd.service
sudo microk8s.enable storage

sudo snap alias microk8s.kubectl kubectl

wget https://osm-download.etsi.org/ftp/osm-13.0-thirteen/install_osm.sh
chmod +x ./install_osm.sh
./install_osm.sh --charmed -R testing-daily -t testing-daily -r testing -y 2>&1 | tee charmed_install_log.txt

# Set our environment to talk to the new OSM
grep '^export OSM' ~/charmed_install_log.txt >> ~/.bashrc

while [ 1 ] ; do
    osm version
    if [ $? -eq 0 ]; then break ; fi
done


# Expose our services
sudo sed -i "s/127.0.0.1 /127.0.0.1 nbi.osm ui.osm grafana.osm prometheus.osm /" /etc/hosts

juju config -m osm grafana site_url=https://grafana.osm
juju config -m osm prometheus site_url=https://prometheus.osm
juju config -m osm nbi external-hostname=nbi.osm
juju config -m osm ng-ui external-hostname=ui.osm

echo "export OSM_HOSTNAME=nbi.osm:443" >> .bashrc
echo "export OSM_HOSTNAME=nbi.osm:443" >> .profile
echo "export OSM_PASSWORD=hackfest" >> .bashrc
echo "export OSM_PASSWORD=hackfest" >> .profile

# Set some sane defaults for LXD
lxc profile set default limits.memory 1GB
lxc profile set default limits.cpu 2

echo $0 $@ complete at $(date)