X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Fcharmed_install.sh;h=7bec50e34efaff26e363015d0833521114bddfbe;hb=9c0d2b7f85bdeb84aeacc8caa5c5be645c3756f1;hp=25c98061a89635c895f4ea27523f1f7922f0f0f3;hpb=734099e0658888208578e3e5ef104dd068462a57;p=osm%2Fdevops.git diff --git a/installers/charmed_install.sh b/installers/charmed_install.sh index 25c98061..7bec50e3 100755 --- a/installers/charmed_install.sh +++ b/installers/charmed_install.sh @@ -27,15 +27,11 @@ PATH=/snap/bin:${PATH} MODEL_NAME=osm -# Latest bundles using old mongodb-k8s -# OSM_BUNDLE=cs:osm-68 -# OSM_HA_BUNDLE=cs:osm-ha-54 -# The charm store does not support referencing charms from CharmHub, -# therefore we will point to the local bundles until we migrate all -# charms to CharmHub. -OSM_BUNDLE=/usr/share/osm-devops/installers/charm/bundles/osm/bundle.yaml -OSM_HA_BUNDLE=/usr/share/osm-devops/installers/charm/bundles/osm-ha/bundle.yaml -TAG=10 + +OSM_BUNDLE=ch:osm +OSM_HA_BUNDLE=ch:osm-ha +CHARMHUB_CHANNEL=10.0/edge +unset TAG function check_arguments(){ while [ $# -gt 0 ] ; do @@ -60,16 +56,16 @@ function check_arguments(){ function install_snaps(){ if [ ! -v KUBECFG ]; then + KUBEGRP="microk8s" sudo snap install microk8s --classic --channel=${MICROK8S_VERSION}/stable + sudo usermod -a -G microk8s `whoami` sudo cat /var/snap/microk8s/current/args/kube-apiserver | grep advertise-address || ( echo "--advertise-address $DEFAULT_IP" | sudo tee -a /var/snap/microk8s/current/args/kube-apiserver - microk8s.stop - microk8s.start + sg ${KUBEGRP} -c microk8s.stop + sg ${KUBEGRP} -c microk8s.start ) - sudo usermod -a -G microk8s `whoami` mkdir -p ~/.kube sudo chown -f -R `whoami` ~/.kube - KUBEGRP="microk8s" sg ${KUBEGRP} -c "microk8s status --wait-ready" KUBECONFIG=~/.osm/microk8s-config.yaml sg ${KUBEGRP} -c "microk8s config" | tee ${KUBECONFIG} @@ -263,9 +259,9 @@ function deploy_charmed_osm(){ fi if [ -v BUNDLE ]; then - juju deploy -m $MODEL_NAME $BUNDLE --overlay ~/.osm/vca-overlay.yaml $images_overlay $extra_overlay + juju deploy --trust --channel $CHARMHUB_CHANNEL -m $MODEL_NAME $BUNDLE --overlay ~/.osm/vca-overlay.yaml $images_overlay $extra_overlay else - juju deploy -m $MODEL_NAME $OSM_BUNDLE --overlay ~/.osm/vca-overlay.yaml $images_overlay $extra_overlay + juju deploy --trust --channel $CHARMHUB_CHANNEL -m $MODEL_NAME $OSM_BUNDLE --overlay ~/.osm/vca-overlay.yaml $images_overlay $extra_overlay fi if [ ! -v KUBECFG ]; then @@ -285,6 +281,9 @@ function deploy_charmed_osm(){ juju config -m $MODEL_NAME prometheus site_url=https://prometheus.${API_SERVER}.nip.io echo "Waiting for deployment to finish..." + grafana_leader=`juju status -m $MODEL_NAME grafana | grep "*" | cut -d "*" -f 1` + grafana_admin_password=`juju run -m $MODEL_NAME --unit $grafana_leader "echo \\$GF_SECURITY_ADMIN_PASSWORD"` + juju config -m $MODEL_NAME mon grafana_password=$grafana_admin_password check_osm_deployed echo "OSM with charms deployed" } @@ -357,7 +356,7 @@ EOF function generate_images_overlay(){ echo "applications:" > /tmp/images-overlay.yaml - charms_with_resources="nbi lcm mon pol ng-ui ro pla keystone" + charms_with_resources="nbi lcm mon pol ng-ui ro pla" for charm in $charms_with_resources; do cat << EOF > /tmp/${charm}_registry.yaml registrypath: ${REGISTRY_URL}opensourcemano/${charm}:$TAG @@ -372,6 +371,23 @@ EOF resources: image: /tmp/${charm}_registry.yaml +EOF + done + ch_charms_with_resources="keystone" + for charm in $ch_charms_with_resources; do + cat << EOF > /tmp/${charm}_registry.yaml +registrypath: ${REGISTRY_URL}opensourcemano/${charm}:$TAG +EOF + if [ ! -z "$REGISTRY_USERNAME" ] ; then + echo username: $REGISTRY_USERNAME >> /tmp/${charm}_registry.yaml + echo password: $REGISTRY_PASSWORD >> /tmp/${charm}_registry.yaml + fi + + cat << EOF >> /tmp/images-overlay.yaml + ${charm}: + resources: + ${charm}-image: /tmp/${charm}_registry.yaml + EOF done