OSM beta bundles and charmed installer to deploy OSM sidecar charms 78/12478/11
authoraticig <gulsum.atici@canonical.com>
Tue, 23 Aug 2022 12:13:23 +0000 (15:13 +0300)
committerbeierlm <mark.beierl@canonical.com>
Thu, 8 Sep 2022 00:09:03 +0000 (02:09 +0200)
Changing charmed installer to deploy OSM from latest/beta bundle,
updating juju version to 2.9.33.

Change-Id: Ie64bff771f8cb91670588c4e28754304d692b544
Signed-off-by: aticig <gulsum.atici@canonical.com>
installers/charm/bundles/osm-ha/bundle.yaml
installers/charm/bundles/osm/bundle.yaml
installers/charmed_install.sh
installers/charmed_uninstall.sh

index 27af107..7d1a446 100644 (file)
@@ -31,23 +31,17 @@ description: |
 applications:
   zookeeper:
     charm: zookeeper-k8s
-    channel: latest/edge
+    channel: latest/stable
     scale: 3
     storage:
       data: 100M
-    annotations:
-      gui-x: 0
-      gui-y: 500
   kafka:
     charm: kafka-k8s
-    channel: latest/edge
+    channel: latest/stable
     scale: 3
     trust: true
     storage:
       data: 100M
-    annotations:
-      gui-x: 0
-      gui-y: 250
   mariadb:
     charm: charmed-osm-mariadb-k8s
     scale: 3
@@ -59,9 +53,6 @@ applications:
       root_password: osm4u
       user: mano
       ha-mode: true
-    annotations:
-      gui-x: -300
-      gui-y: -250
   mongodb:
     charm: mongodb-k8s
     channel: latest/stable
@@ -69,84 +60,68 @@ applications:
     series: kubernetes
     storage:
       db: 50M
-    annotations:
-      gui-x: 0
-      gui-y: 0
   nbi:
     charm: osm-nbi
-    channel: latest/stable
+    channel: latest/beta
+    trust: true
     scale: 3
-    series: kubernetes
     options:
-      database_commonkey: osm
-      auth_backend: keystone
-      log_level: DEBUG
+      database-commonkey: osm
+      log-level: DEBUG
     resources:
-      image: opensourcemano/nbi:testing-daily
-    annotations:
-      gui-x: 0
-      gui-y: -250
+      nbi-image: opensourcemano/nbi:testing-daily
   ro:
     charm: osm-ro
-    channel: latest/stable
+    channel: latest/beta
+    trust: true
     scale: 3
-    series: kubernetes
     options:
-      log_level: DEBUG
+      log-level: DEBUG
     resources:
-      image: opensourcemano/ro:testing-daily
-    annotations:
-      gui-x: -300
-      gui-y: 250
+      ro-image: opensourcemano/ro:testing-daily
   ng-ui:
     charm: osm-ng-ui
-    channel: latest/stable
+    channel: latest/beta
+    trust: true
     scale: 3
-    series: kubernetes
     resources:
-      image: opensourcemano/ng-ui:testing-daily
-    annotations:
-      gui-x: 600
-      gui-y: 0
+      ng-ui-image: opensourcemano/ng-ui:testing-daily
   lcm:
     charm: osm-lcm
-    channel: latest/stable
+    channel: latest/beta
     scale: 3
-    series: kubernetes
     options:
-      database_commonkey: osm
-      log_level: DEBUG
+      database-commonkey: osm
+      log-level: DEBUG
     resources:
-      image: opensourcemano/lcm:testing-daily
-    annotations:
-      gui-x: -300
-      gui-y: 0
+      lcm-image: opensourcemano/lcm:testing-daily
   mon:
     charm: osm-mon
-    channel: latest/stable
+    channel: latest/beta
+    trust: true
     scale: 1
-    series: kubernetes
     options:
-      database_commonkey: osm
-      log_level: DEBUG
-      keystone_enabled: true
+      database-commonkey: osm
+      log-level: DEBUG
+      keystone-enabled: true
     resources:
-      image: opensourcemano/mon:testing-daily
-    annotations:
-      gui-x: 300
-      gui-y: 0
+      mon-image: opensourcemano/mon:testing-daily
   pol:
     charm: osm-pol
-    channel: latest/stable
+    channel: latest/beta
     scale: 3
-    series: kubernetes
     options:
-      log_level: DEBUG
+      log-level: DEBUG
     resources:
-      image: opensourcemano/pol:testing-daily
-    annotations:
-      gui-x: -300
-      gui-y: 500
+      pol-image: opensourcemano/pol:testing-daily
+  vca:
+    charm: osm-vca-integrator
+    channel: latest/beta
+    scale: 1
+  ingress:
+    charm: nginx-ingress-integrator
+    channel: latest/stable
+    scale: 3
   pla:
     charm: osm-pla
     channel: latest/stable
@@ -156,9 +131,6 @@ applications:
       log_level: DEBUG
     resources:
       image: opensourcemano/pla:testing-daily
-    annotations:
-      gui-x: 600
-      gui-y: -250
   prometheus:
     charm: osm-prometheus
     channel: latest/stable
@@ -168,26 +140,17 @@ applications:
       data: 50M
     options:
       default-target: "mon:8000"
-    annotations:
-      gui-x: 300
-      gui-y: 250
   grafana:
     charm: osm-grafana
     channel: latest/stable
     scale: 3
     series: kubernetes
-    annotations:
-      gui-x: 300
-      gui-y: 500
   keystone:
     charm: osm-keystone
     channel: latest/stable
     scale: 1
     resources:
       keystone-image: opensourcemano/keystone:testing-daily
-    annotations:
-      gui-x: 300
-      gui-y: -250
 relations:
   - - grafana:prometheus
     - prometheus:prometheus
@@ -199,6 +162,8 @@ relations:
     - kafka:kafka
   - - lcm:mongodb
     - mongodb:database
+  - - lcm:vca
+    - vca:vca
   - - ro:ro
     - lcm:ro
   - - ro:kafka
@@ -213,6 +178,8 @@ relations:
     - mongodb:database
   - - mon:kafka
     - kafka:kafka
+  - - mon:vca
+    - vca:vca
   - - pla:kafka
     - kafka:kafka
   - - pla:mongodb
@@ -221,6 +188,8 @@ relations:
     - mongodb:database
   - - nbi:kafka
     - kafka:kafka
+  - - nbi:ingress
+    - ingress:ingress
   - - nbi:prometheus
     - prometheus:prometheus
   - - nbi:keystone
@@ -229,6 +198,8 @@ relations:
     - prometheus:prometheus
   - - ng-ui:nbi
     - nbi:nbi
+  - - ng-ui:ingress
+    - ingress:ingress
   - - mon:keystone
     - keystone:keystone
   - - mariadb:mysql
index edac6c9..f9fc6b9 100644 (file)
@@ -30,23 +30,17 @@ description: |
 applications:
   zookeeper:
     charm: zookeeper-k8s
-    channel: latest/edge
+    channel: latest/stable
     scale: 1
     storage:
       data: 100M
-    annotations:
-      gui-x: 0
-      gui-y: 500
   kafka:
     charm: kafka-k8s
-    channel: latest/edge
+    channel: latest/stable
     scale: 1
     trust: true
     storage:
       data: 100M
-    annotations:
-      gui-x: 0
-      gui-y: 250
   mariadb:
     charm: charmed-osm-mariadb-k8s
     scale: 1
@@ -57,9 +51,6 @@ applications:
       password: manopw
       root_password: osm4u
       user: mano
-    annotations:
-      gui-x: -300
-      gui-y: -250
   mongodb:
     charm: mongodb-k8s
     channel: latest/stable
@@ -67,84 +58,68 @@ applications:
     series: kubernetes
     storage:
       db: 50M
-    annotations:
-      gui-x: 0
-      gui-y: 0
   nbi:
     charm: osm-nbi
-    channel: latest/stable
+    channel: latest/beta
+    trust: true
     scale: 1
-    series: kubernetes
     options:
-      database_commonkey: osm
-      auth_backend: keystone
-      log_level: DEBUG
+      database-commonkey: osm
+      log-level: DEBUG
     resources:
-      image: opensourcemano/nbi:testing-daily
-    annotations:
-      gui-x: 0
-      gui-y: -250
+      nbi-image: opensourcemano/nbi:testing-daily
   ro:
     charm: osm-ro
-    channel: latest/stable
+    channel: latest/beta
+    trust: true
     scale: 1
-    series: kubernetes
     options:
-      log_level: DEBUG
+      log-level: DEBUG
     resources:
-      image: opensourcemano/ro:testing-daily
-    annotations:
-      gui-x: -300
-      gui-y: 250
+      ro-image: opensourcemano/ro:testing-daily
   ng-ui:
     charm: osm-ng-ui
-    channel: latest/stable
+    channel: latest/beta
+    trust: true
     scale: 1
-    series: kubernetes
     resources:
-      image: opensourcemano/ng-ui:testing-daily
-    annotations:
-      gui-x: 600
-      gui-y: 0
+      ng-ui-image: opensourcemano/ng-ui:testing-daily
   lcm:
     charm: osm-lcm
-    channel: latest/stable
+    channel: latest/beta
     scale: 1
-    series: kubernetes
     options:
-      database_commonkey: osm
-      log_level: DEBUG
+      database-commonkey: osm
+      log-level: DEBUG
     resources:
-      image: opensourcemano/lcm:testing-daily
-    annotations:
-      gui-x: -300
-      gui-y: 0
+      lcm-image: opensourcemano/lcm:testing-daily
   mon:
     charm: osm-mon
-    channel: latest/stable
+    channel: latest/beta
+    trust: true
     scale: 1
-    series: kubernetes
     options:
-      database_commonkey: osm
-      log_level: DEBUG
-      keystone_enabled: true
+      database-commonkey: osm
+      log-level: DEBUG
+      keystone-enabled: true
     resources:
-      image: opensourcemano/mon:testing-daily
-    annotations:
-      gui-x: 300
-      gui-y: 0
+      mon-image: opensourcemano/mon:testing-daily
   pol:
     charm: osm-pol
-    channel: latest/stable
+    channel: latest/beta
     scale: 1
-    series: kubernetes
     options:
-      log_level: DEBUG
+      log-level: DEBUG
     resources:
-      image: opensourcemano/pol:testing-daily
-    annotations:
-      gui-x: -300
-      gui-y: 500
+      pol-image: opensourcemano/pol:testing-daily
+  vca:
+    charm: osm-vca-integrator
+    channel: latest/beta
+    scale: 1
+  ingress:
+    charm: nginx-ingress-integrator
+    channel: latest/stable
+    scale: 1
   pla:
     charm: osm-pla
     channel: latest/stable
@@ -154,9 +129,6 @@ applications:
       log_level: DEBUG
     resources:
       image: opensourcemano/pla:testing-daily
-    annotations:
-      gui-x: 600
-      gui-y: -250
   prometheus:
     charm: osm-prometheus
     channel: latest/stable
@@ -166,26 +138,17 @@ applications:
       data: 50M
     options:
       default-target: "mon:8000"
-    annotations:
-      gui-x: 300
-      gui-y: 250
   grafana:
     charm: osm-grafana
     channel: latest/stable
     scale: 1
     series: kubernetes
-    annotations:
-      gui-x: 300
-      gui-y: 500
   keystone:
     charm: osm-keystone
     channel: latest/stable
     scale: 1
     resources:
       keystone-image: opensourcemano/keystone:testing-daily
-    annotations:
-      gui-x: 300
-      gui-y: -250
 relations:
   - - grafana:prometheus
     - prometheus:prometheus
@@ -197,6 +160,8 @@ relations:
     - kafka:kafka
   - - lcm:mongodb
     - mongodb:database
+  - - lcm:vca
+    - vca:vca
   - - ro:ro
     - lcm:ro
   - - ro:kafka
@@ -211,6 +176,8 @@ relations:
     - mongodb:database
   - - mon:kafka
     - kafka:kafka
+  - - mon:vca
+    - vca:vca
   - - pla:kafka
     - kafka:kafka
   - - pla:mongodb
@@ -219,6 +186,8 @@ relations:
     - mongodb:database
   - - nbi:kafka
     - kafka:kafka
+  - - nbi:ingress
+    - ingress:ingress
   - - nbi:prometheus
     - prometheus:prometheus
   - - nbi:keystone
@@ -227,6 +196,8 @@ relations:
     - prometheus:prometheus
   - - ng-ui:nbi
     - nbi:nbi
+  - - ng-ui:ingress
+    - ingress:ingress
   - - mon:keystone
     - keystone:keystone
   - - mariadb:mysql
index c6f770c..844e646 100755 (executable)
@@ -17,7 +17,7 @@
 
 LXD_VERSION=4.0
 JUJU_VERSION=2.9
-JUJU_AGENT_VERSION=2.9.29
+JUJU_AGENT_VERSION=2.9.33
 K8S_CLOUD_NAME="k8s-cloud"
 KUBECTL="microk8s.kubectl"
 MICROK8S_VERSION=1.23
@@ -41,7 +41,7 @@ MODEL_NAME=osm
 
 OSM_BUNDLE=ch:osm
 OSM_HA_BUNDLE=ch:osm-ha
-CHARMHUB_CHANNEL=latest/stable
+CHARMHUB_CHANNEL=latest/beta
 unset TAG
 
 function check_arguments(){
@@ -255,9 +255,9 @@ function deploy_charmed_osm(){
     generate_password_overlay && secret_overlay="--overlay $PASSWORD_OVERLAY_FILE"
 
     if [ -v BUNDLE ]; then
-        juju deploy --trust --channel $CHARMHUB_CHANNEL -m $MODEL_NAME $BUNDLE --overlay ~/.osm/vca-overlay.yaml $images_overlay $extra_overlay $secret_overlay
+        juju deploy --trust --channel $CHARMHUB_CHANNEL -m $MODEL_NAME $BUNDLE $images_overlay $extra_overlay $secret_overlay
     else
-        juju deploy --trust --channel $CHARMHUB_CHANNEL -m $MODEL_NAME $OSM_BUNDLE --overlay ~/.osm/vca-overlay.yaml $images_overlay $extra_overlay $secret_overlay
+        juju deploy --trust --channel $CHARMHUB_CHANNEL -m $MODEL_NAME $OSM_BUNDLE $images_overlay $extra_overlay $secret_overlay
     fi
 
     if [ ! -v KUBECFG ]; then
@@ -270,9 +270,16 @@ function deploy_charmed_osm(){
         hostport="$(echo ${url/$user@/} | cut -d/ -f1)"
         API_SERVER="$(echo $hostport | sed -e 's,:.*,,g')"
     fi
+    # Configure VCA Integrator
+    juju config vca \
+      k8s-cloud=microk8s \
+      lxd-cloud=lxd-cloud:lxd-cloud \
+      controllers="`cat ~/.local/share/juju/controllers.yaml`" \
+      accounts="`cat ~/.local/share/juju/accounts.yaml`" \
+      public-key="`cat ~/.local/share/juju/ssh/juju_id_rsa.pub`"
     # Expose OSM services
-    juju config -m $MODEL_NAME nbi site_url=https://nbi.${API_SERVER}.nip.io
-    juju config -m $MODEL_NAME ng-ui site_url=https://ui.${API_SERVER}.nip.io
+    juju config -m $MODEL_NAME nbi external-hostname=nbi.${API_SERVER}.nip.io
+    juju config -m $MODEL_NAME ng-ui external-hostname=ui.${API_SERVER}.nip.io
     juju config -m $MODEL_NAME grafana site_url=https://grafana.${API_SERVER}.nip.io
     juju config -m $MODEL_NAME prometheus site_url=https://prometheus.${API_SERVER}.nip.io
 
@@ -280,7 +287,7 @@ function deploy_charmed_osm(){
     check_osm_deployed
     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
+    juju config -m $MODEL_NAME mon grafana-password=$grafana_admin_password
     check_osm_deployed
     echo "OSM with charms deployed"
 }
@@ -288,7 +295,7 @@ function deploy_charmed_osm(){
 function check_osm_deployed() {
     TIME_TO_WAIT=600
     start_time="$(date -u +%s)"
-    total_service_count=14
+    total_service_count=16
     previous_count=0
     while true
     do
@@ -338,46 +345,6 @@ EOF
     mv /tmp/password-overlay.yaml $PASSWORD_OVERLAY_FILE
 }
 
-function create_overlay() {
-    sudo snap install jq
-    sudo snap install yq
-    local HOME=/home/$USER
-    local vca_user=$(cat $HOME/.local/share/juju/accounts.yaml | yq e .controllers.$CONTROLLER_NAME.user - )
-    local vca_secret=$(cat $HOME/.local/share/juju/accounts.yaml | yq e .controllers.$CONTROLLER_NAME.password - )
-    local vca_host=$(cat $HOME/.local/share/juju/controllers.yaml | yq e .controllers.$CONTROLLER_NAME.api-endpoints[0] - | cut -d ":" -f 1)
-    local vca_port=$(cat $HOME/.local/share/juju/controllers.yaml | yq e .controllers.$CONTROLLER_NAME.api-endpoints[0] - | cut -d ":" -f 2)
-    local vca_pubkey=\"$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub)\"
-    local vca_cloud="lxd-cloud"
-    # Get the VCA Certificate
-    local vca_cacert=$(cat $HOME/.local/share/juju/controllers.yaml | yq e .controllers.$CONTROLLER_NAME.ca-cert - | base64 | tr -d \\n)
-
-    # Calculate the default route of this machine
-    local DEFAULT_IF=`ip route list match 0.0.0.0 | awk '{print $5}'`
-
-    # Generate a new overlay.yaml, overriding any existing one
-    cat << EOF > /tmp/vca-overlay.yaml
-applications:
-  lcm:
-    options:
-      vca_user: $vca_user
-      vca_secret: $vca_secret
-      vca_host: $vca_host
-      vca_port: $vca_port
-      vca_pubkey: $vca_pubkey
-      vca_cacert: $vca_cacert
-      vca_cloud: $vca_cloud
-      vca_k8s_cloud: $K8S_CLOUD_NAME
-  mon:
-    options:
-      vca_user: $vca_user
-      vca_secret: $vca_secret
-      vca_host: $vca_host
-      vca_cacert: $vca_cacert
-EOF
-    mv /tmp/vca-overlay.yaml ~/.osm/
-    OSM_VCA_HOST=$vca_host
-}
-
 function generate_images_overlay(){
     echo "applications:" > /tmp/images-overlay.yaml
 
@@ -535,27 +502,22 @@ check_arguments $@
 mkdir -p ~/.osm
 install_snaps
 bootstrap_k8s_lxd
-create_overlay
 if [ -v ONLY_VCA ]; then
     HOME=/home/$USER
-    vca_user=$(cat $HOME/.local/share/juju/accounts.yaml | yq e .controllers.$CONTROLLER_NAME.user - )
-    vca_secret=$(cat $HOME/.local/share/juju/accounts.yaml | yq e .controllers.$CONTROLLER_NAME.password - )
-    vca_host=$(cat $HOME/.local/share/juju/controllers.yaml | yq e .controllers.$CONTROLLER_NAME.api-endpoints[0] - | cut -d ":" -f 1)
-    vca_port=$(cat $HOME/.local/share/juju/controllers.yaml | yq e .controllers.$CONTROLLER_NAME.api-endpoints[0] - | cut -d ":" -f 2)
-    vca_pubkey=\"$(cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub)\"
-    vca_cloud="lxd-cloud"
-    vca_cacert=$(cat $HOME/.local/share/juju/controllers.yaml | yq e .controllers.$CONTROLLER_NAME.ca-cert - | base64 | tr -d \\n)
-    hostname=`cat /etc/hostname`
-
-    echo "Use the following command to register the installed VCA to your OSM:"
-    echo -e "  osm vca-add --endpoints $vca_host:$vca_port \\\n         --user $vca_user \\\n         --secret $vca_secret \\\n         --cacert $vca_cacert \\\n         --lxd-cloud lxd-cloud \\\n         --lxd-credentials lxd-cloud \\\n         --k8s-cloud microk8s \\\n         --k8s-credentials microk8s\\\n         $hostname-vca"
+    k8scloud=microk8s
+    lxdcloud=lxd-cloud:lxd-cloud
+    controllers="`cat $HOME/.local/share/juju/controllers.yaml`"
+    accounts="`cat $HOME/.local/share/juju/accounts.yaml`"
+    publickey="`cat $HOME/.local/share/juju/ssh/juju_id_rsa.pub`"
+    echo "Use the following command to register the installed VCA to your OSM VCA integrator charm"
+    echo -e "  juju config vca \\\n    k8s-cloud=$k8scloud \\\n    lxd-cloud=$lxdcloud \\\n    controllers=$controllers \\\n    accounts=$accounts \\\n    public-key=$publickey"
     track deploy_osm deploy_vca_only_ok
 else
     deploy_charmed_osm
     track deploy_osm deploy_osm_services_k8s_ok
     install_osmclient
     track osmclient osmclient_ok
-    export OSM_HOSTNAME=$(juju config -m $MODEL_NAME nbi site_url | sed "s/http.*\?:\/\///"):443
+    export OSM_HOSTNAME=$(juju config -m $MODEL_NAME nbi external-hostname):443
     export OSM_PASSWORD=$keystone_admin_password
     sleep 10
     add_local_k8scluster
index 09305d2..386cb04 100755 (executable)
@@ -14,7 +14,7 @@
 #
 
 
-juju destroy-model osm --destroy-storage -y --force --no-wait
+juju destroy-model osm --destroy-storage -y
 sudo snap unalias osm
 sudo snap remove osmclient
 CONTROLLER_NAME="osm-vca"