Feature 10884: Juju 2.9 support 21/11621/1
authorDavid Garcia <david.garcia@canonical.com>
Mon, 28 Jun 2021 14:50:42 +0000 (16:50 +0200)
committerDavid Garcia <david.garcia@canonical.com>
Thu, 3 Feb 2022 10:45:23 +0000 (11:45 +0100)
OSM LTS Support

- Update osm bundles (charmed)
- Update Juju version (snap and agent version) (charmed and k8s)
- Update to new mongodb charm (charmed and k8s)
- Fix ingress issue by adding an ingress_class config
- Charmed installer: point to local bundles until all charms are in
CharmHub
Change-Id: I6ff8328e5db6719bbf9d5d4c9b5490f478b2ace8
Signed-off-by: David Garcia <david.garcia@canonical.com>
20 files changed:
installers/charm/bundles/osm-ha/bundle.yaml
installers/charm/bundles/osm/bundle.yaml
installers/charm/grafana/config.yaml
installers/charm/grafana/src/charm.py
installers/charm/kafka-exporter/config.yaml
installers/charm/kafka-exporter/src/charm.py
installers/charm/keystone/config.yaml
installers/charm/keystone/src/charm.py
installers/charm/mongodb-exporter/config.yaml
installers/charm/mongodb-exporter/src/charm.py
installers/charm/mysqld-exporter/config.yaml
installers/charm/mysqld-exporter/src/charm.py
installers/charm/nbi/config.yaml
installers/charm/nbi/src/charm.py
installers/charm/ng-ui/config.yaml
installers/charm/ng-ui/src/charm.py
installers/charm/prometheus/config.yaml
installers/charm/prometheus/src/charm.py
installers/charmed_install.sh
installers/full_install_osm.sh

index f48bae2..0909160 100644 (file)
@@ -68,22 +68,17 @@ applications:
     annotations:
       gui-x: 0
       gui-y: 250
-  mongodb-k8s:
-    charm: "cs:~charmed-osm/mongodb-k8s"
-    channel: "stable"
+  mongodb:
+    charm: ch:mongodb-k8s
     scale: 3
     series: kubernetes
     storage:
-      database: 50M
-    options:
-      replica-set: rs0
-      namespace: osm
-      enable-sidecar: true
+      db: 50M
     annotations:
       gui-x: 0
       gui-y: 0
   nbi:
-    charm: "cs:~charmed-osm/nbi-12"
+    charm: "cs:~charmed-osm/nbi-13"
     scale: 3
     series: kubernetes
     options:
@@ -94,7 +89,7 @@ applications:
       gui-x: 0
       gui-y: -250
   ro:
-    charm: "cs:~charmed-osm/ro-4"
+    charm: "cs:~charmed-osm/ro-5"
     scale: 3
     series: kubernetes
     options:
@@ -103,14 +98,14 @@ applications:
       gui-x: -300
       gui-y: 250
   ng-ui:
-    charm: "cs:~charmed-osm/ng-ui-21"
+    charm: "cs:~charmed-osm/ng-ui-22"
     scale: 3
     series: kubernetes
     annotations:
       gui-x: 600
       gui-y: 0
   lcm:
-    charm: "cs:~charmed-osm/lcm-8"
+    charm: "cs:~charmed-osm/lcm-9"
     scale: 3
     series: kubernetes
     options:
@@ -120,7 +115,7 @@ applications:
       gui-x: -300
       gui-y: 0
   mon:
-    charm: "cs:~charmed-osm/mon-5"
+    charm: "cs:~charmed-osm/mon-6"
     scale: 1
     series: kubernetes
     options:
@@ -131,7 +126,7 @@ applications:
       gui-x: 300
       gui-y: 0
   pol:
-    charm: "cs:~charmed-osm/pol-4"
+    charm: "cs:~charmed-osm/pol-5"
     scale: 3
     series: kubernetes
     options:
@@ -140,7 +135,7 @@ applications:
       gui-x: -300
       gui-y: 500
   pla:
-    charm: "cs:~charmed-osm/pla-9"
+    charm: "cs:~charmed-osm/pla-10"
     scale: 3
     series: kubernetes
     options:
@@ -149,7 +144,7 @@ applications:
       gui-x: 600
       gui-y: -250
   prometheus:
-    charm: "cs:~charmed-osm/prometheus-4"
+    charm: "cs:~charmed-osm/prometheus-5"
     scale: 1
     series: kubernetes
     storage:
@@ -160,14 +155,14 @@ applications:
       gui-x: 300
       gui-y: 250
   grafana:
-    charm: "cs:~charmed-osm/grafana-4"
+    charm: "cs:~charmed-osm/grafana-5"
     scale: 3
     series: kubernetes
     annotations:
       gui-x: 300
       gui-y: 500
   keystone:
-    charm: "cs:~charmed-osm/keystone-9"
+    charm: "cs:~charmed-osm/keystone-11"
     scale: 1
     series: kubernetes
     annotations:
@@ -183,27 +178,27 @@ relations:
   - - lcm:kafka
     - kafka-k8s:kafka
   - - lcm:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - ro:ro
     - lcm:ro
   - - ro:kafka
     - kafka-k8s:kafka
   - - ro:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - pol:kafka
     - kafka-k8s:kafka
   - - pol:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - mon:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - mon:kafka
     - kafka-k8s:kafka
   - - pla:kafka
     - kafka-k8s:kafka
   - - pla:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - nbi:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - nbi:kafka
     - kafka-k8s:kafka
   - - nbi:prometheus
index c6ba49e..bdd4cd6 100644 (file)
@@ -61,22 +61,17 @@ applications:
     annotations:
       gui-x: 0
       gui-y: 250
-  mongodb-k8s:
-    charm: "cs:~charmed-osm/mongodb-k8s"
-    channel: "stable"
+  mongodb:
+    charm: ch:mongodb-k8s
     scale: 1
     series: kubernetes
     storage:
-      database: 50M
-    options:
-      replica-set: rs0
-      namespace: osm
-      enable-sidecar: true
+      db: 50M
     annotations:
       gui-x: 0
       gui-y: 0
   nbi:
-    charm: "cs:~charmed-osm/nbi-12"
+    charm: "cs:~charmed-osm/nbi-13"
     scale: 1
     series: kubernetes
     options:
@@ -87,7 +82,7 @@ applications:
       gui-x: 0
       gui-y: -250
   ro:
-    charm: "cs:~charmed-osm/ro-4"
+    charm: "cs:~charmed-osm/ro-5"
     scale: 1
     series: kubernetes
     options:
@@ -96,14 +91,14 @@ applications:
       gui-x: -300
       gui-y: 250
   ng-ui:
-    charm: "cs:~charmed-osm/ng-ui-21"
+    charm: "cs:~charmed-osm/ng-ui-22"
     scale: 1
     series: kubernetes
     annotations:
       gui-x: 600
       gui-y: 0
   lcm:
-    charm: "cs:~charmed-osm/lcm-8"
+    charm: "cs:~charmed-osm/lcm-9"
     scale: 1
     series: kubernetes
     options:
@@ -113,7 +108,7 @@ applications:
       gui-x: -300
       gui-y: 0
   mon:
-    charm: "cs:~charmed-osm/mon-5"
+    charm: "cs:~charmed-osm/mon-6"
     scale: 1
     series: kubernetes
     options:
@@ -124,7 +119,7 @@ applications:
       gui-x: 300
       gui-y: 0
   pol:
-    charm: "cs:~charmed-osm/pol-4"
+    charm: "cs:~charmed-osm/pol-5"
     scale: 1
     series: kubernetes
     options:
@@ -133,7 +128,7 @@ applications:
       gui-x: -300
       gui-y: 500
   pla:
-    charm: "cs:~charmed-osm/pla-9"
+    charm: "cs:~charmed-osm/pla-10"
     scale: 1
     series: kubernetes
     options:
@@ -142,7 +137,7 @@ applications:
       gui-x: 600
       gui-y: -250
   prometheus:
-    charm: "cs:~charmed-osm/prometheus-4"
+    charm: "cs:~charmed-osm/prometheus-5"
     scale: 1
     series: kubernetes
     storage:
@@ -153,14 +148,14 @@ applications:
       gui-x: 300
       gui-y: 250
   grafana:
-    charm: "cs:~charmed-osm/grafana-4"
+    charm: "cs:~charmed-osm/grafana-5"
     scale: 1
     series: kubernetes
     annotations:
       gui-x: 300
       gui-y: 500
   keystone:
-    charm: "cs:~charmed-osm/keystone-9"
+    charm: "cs:~charmed-osm/keystone-11"
     scale: 1
     series: kubernetes
     annotations:
@@ -176,27 +171,27 @@ relations:
   - - lcm:kafka
     - kafka-k8s:kafka
   - - lcm:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - ro:ro
     - lcm:ro
   - - ro:kafka
     - kafka-k8s:kafka
   - - ro:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - pol:kafka
     - kafka-k8s:kafka
   - - pol:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - mon:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - mon:kafka
     - kafka-k8s:kafka
   - - pla:kafka
     - kafka-k8s:kafka
   - - pla:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - nbi:mongodb
-    - mongodb-k8s:mongo
+    - mongodb:database
   - - nbi:kafka
     - kafka-k8s:kafka
   - - nbi:prometheus
index 19274e5..3a7e63f 100644 (file)
@@ -27,6 +27,11 @@ options:
       of Keystone, it may need to be configured to handle the requested size.
       Note: if set to 0, there is no limit.
     default: 0
+  ingress_class:
+    type: string
+    description: |
+      Ingress class name. This is useful for selecting the ingress to be used
+      in case there are multiple ingresses in the underlying k8s clusters.
   ingress_whitelist_source_range:
     type: string
     description: |
index bf6fbd9..28be79a 100755 (executable)
@@ -51,6 +51,7 @@ class ConfigModel(ModelValidator):
     osm_dashboards: bool
     site_url: Optional[str]
     cluster_issuer: Optional[str]
+    ingress_class: Optional[str]
     ingress_whitelist_source_range: Optional[str]
     tls_secret_name: Optional[str]
 
@@ -174,8 +175,10 @@ class GrafanaCharm(CharmedOsmBase):
                     str(config.max_file_size) + "m"
                     if config.max_file_size > 0
                     else config.max_file_size
-                ),
+                )
             }
+            if config.ingress_class:
+                annotations["kubernetes.io/ingress.class"] = config.ingress_class
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index 8d3703e..706e330 100644 (file)
 ##
 
 options:
+  ingress_class:
+    type: string
+    description: |
+      Ingress class name. This is useful for selecting the ingress to be used
+      in case there are multiple ingresses in the underlying k8s clusters.
   ingress_whitelist_source_range:
     type: string
     description: |
index 123fa0b..a15abc8 100755 (executable)
@@ -49,6 +49,7 @@ PORT = 9308
 class ConfigModel(ModelValidator):
     site_url: Optional[str]
     cluster_issuer: Optional[str]
+    ingress_class: Optional[str]
     ingress_whitelist_source_range: Optional[str]
     tls_secret_name: Optional[str]
 
@@ -195,6 +196,8 @@ class KafkaExporterCharm(CharmedOsmBase):
         if config.site_url:
             parsed = urlparse(config.site_url)
             annotations = {}
+            if config.ingress_class:
+                annotations["kubernetes.io/ingress.class"] = config.ingress_class
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index 402096c..9a7acd5 100644 (file)
@@ -20,6 +20,11 @@ options:
       If there is a reverse proxy in front of Keystone, it may
       need to be configured to handle the requested size.
     default: 5
+  ingress_class:
+    type: string
+    description: |
+      Ingress class name. This is useful for selecting the ingress to be used
+      in case there are multiple ingresses in the underlying k8s clusters.
   ingress_whitelist_source_range:
     type: string
     description: |
index b5ce0cc..2a0a521 100755 (executable)
@@ -78,6 +78,7 @@ class ConfigModel(ModelValidator):
     token_expiration: int
     max_file_size: int
     site_url: Optional[str]
+    ingress_class: Optional[str]
     ingress_whitelist_source_range: Optional[str]
     tls_secret_name: Optional[str]
     mysql_host: Optional[str]
@@ -364,8 +365,10 @@ class KeystoneCharm(CharmedOsmBase):
                     str(config.max_file_size) + "m"
                     if config.max_file_size > 0
                     else config.max_file_size
-                ),
+                )
             }
+            if config.ingress_class:
+                annotations["kubernetes.io/ingress.class"] = config.ingress_class
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index 206bca5..727598b 100644 (file)
 ##
 
 options:
+  ingress_class:
+    type: string
+    description: |
+      Ingress class name. This is useful for selecting the ingress to be used
+      in case there are multiple ingresses in the underlying k8s clusters.
   ingress_whitelist_source_range:
     type: string
     description: |
index fd318fa..149940a 100755 (executable)
@@ -49,6 +49,7 @@ PORT = 9216
 class ConfigModel(ModelValidator):
     site_url: Optional[str]
     cluster_issuer: Optional[str]
+    ingress_class: Optional[str]
     ingress_whitelist_source_range: Optional[str]
     tls_secret_name: Optional[str]
     mongodb_uri: Optional[str]
@@ -215,6 +216,8 @@ class MongodbExporterCharm(CharmedOsmBase):
         if config.site_url:
             parsed = urlparse(config.site_url)
             annotations = {}
+            if config.ingress_class:
+                annotations["kubernetes.io/ingress.class"] = config.ingress_class
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index f1192a1..a7702a3 100644 (file)
 ##
 
 options:
+  ingress_class:
+    type: string
+    description: |
+      Ingress class name. This is useful for selecting the ingress to be used
+      in case there are multiple ingresses in the underlying k8s clusters.
   ingress_whitelist_source_range:
     type: string
     description: |
index 2ae7d83..bcd43b5 100755 (executable)
@@ -49,6 +49,7 @@ PORT = 9104
 class ConfigModel(ModelValidator):
     site_url: Optional[str]
     cluster_issuer: Optional[str]
+    ingress_class: Optional[str]
     ingress_whitelist_source_range: Optional[str]
     tls_secret_name: Optional[str]
     mysql_uri: Optional[str]
@@ -211,6 +212,8 @@ class MysqlExporterCharm(CharmedOsmBase):
         if config.site_url:
             parsed = urlparse(config.site_url)
             annotations = {}
+            if config.ingress_class:
+                annotations["kubernetes.io/ingress.class"] = config.ingress_class
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index a3d94bc..7f32752 100644 (file)
@@ -27,6 +27,11 @@ options:
       of Keystone, it may need to be configured to handle the requested size.
       Note: if set to 0, there is no limit.
     default: 0
+  ingress_class:
+    type: string
+    description: |
+      Ingress class name. This is useful for selecting the ingress to be used
+      in case there are multiple ingresses in the underlying k8s clusters.
   ingress_whitelist_source_range:
     type: string
     description: |
index bbbf5ec..d3a2251 100755 (executable)
@@ -57,6 +57,7 @@ class ConfigModel(ModelValidator):
     max_file_size: int
     site_url: Optional[str]
     cluster_issuer: Optional[str]
+    ingress_class: Optional[str]
     ingress_whitelist_source_range: Optional[str]
     tls_secret_name: Optional[str]
     mongodb_uri: Optional[str]
@@ -250,6 +251,8 @@ class NbiCharm(CharmedOsmBase):
                 ),
                 "nginx.ingress.kubernetes.io/backend-protocol": "HTTPS",
             }
+            if config.ingress_class:
+                annotations["kubernetes.io/ingress.class"] = config.ingress_class
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index df09698..39d3b2d 100644 (file)
@@ -31,6 +31,11 @@ options:
       of Keystone, it may need to be configured to handle the requested size.
       Note: if set to 0, there is no limit.
     default: 0
+  ingress_class:
+    type: string
+    description: |
+      Ingress class name. This is useful for selecting the ingress to be used
+      in case there are multiple ingresses in the underlying k8s clusters.
   ingress_whitelist_source_range:
     type: string
     description: |
index 5efaaae..5388466 100755 (executable)
@@ -51,6 +51,7 @@ class ConfigModel(ModelValidator):
     max_file_size: int
     site_url: Optional[str]
     cluster_issuer: Optional[str]
+    ingress_class: Optional[str]
     ingress_whitelist_source_range: Optional[str]
     tls_secret_name: Optional[str]
 
@@ -148,8 +149,10 @@ class NgUiCharm(CharmedOsmBase):
                     str(config.max_file_size) + "m"
                     if config.max_file_size > 0
                     else config.max_file_size
-                ),
+                )
             }
+            if config.ingress_class:
+                annotations["kubernetes.io/ingress.class"] = config.ingress_class
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index a5f5e8a..c1c0fb9 100644 (file)
@@ -35,6 +35,11 @@ options:
       of Keystone, it may need to be configured to handle the requested size.
       Note: if set to 0, there is no limit.
     default: 0
+  ingress_class:
+    type: string
+    description: |
+      Ingress class name. This is useful for selecting the ingress to be used
+      in case there are multiple ingresses in the underlying k8s clusters.
   ingress_whitelist_source_range:
     type: string
     description: |
index 5fdee72..e3e0e42 100755 (executable)
@@ -56,6 +56,7 @@ class ConfigModel(ModelValidator):
     max_file_size: int
     site_url: Optional[str]
     cluster_issuer: Optional[str]
+    ingress_class: Optional[str]
     ingress_whitelist_source_range: Optional[str]
     tls_secret_name: Optional[str]
     enable_web_admin_api: bool
@@ -196,8 +197,10 @@ class PrometheusCharm(CharmedOsmBase):
                     str(config.max_file_size) + "m"
                     if config.max_file_size > 0
                     else config.max_file_size
-                ),
+                )
             }
+            if config.ingress_class:
+                annotations["kubernetes.io/ingress.class"] = config.ingress_class
             ingress_resource_builder = IngressResourceV3Builder(
                 f"{self.app.name}-ingress", annotations
             )
index 22144ad..d40ef15 100755 (executable)
@@ -16,8 +16,8 @@
 # set -eux
 
 LXD_VERSION=4.0
-JUJU_VERSION=2.8
-JUJU_AGENT_VERSION=2.8.13
+JUJU_VERSION=2.9
+JUJU_AGENT_VERSION=2.9.22
 K8S_CLOUD_NAME="k8s-cloud"
 KUBECTL="microk8s.kubectl"
 MICROK8S_VERSION=1.20
@@ -27,8 +27,14 @@ PATH=/snap/bin:${PATH}
 
 MODEL_NAME=osm
 
-OSM_BUNDLE=cs:osm-66
-OSM_HA_BUNDLE=cs:osm-ha-51
+# 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
 
 function check_arguments(){
@@ -460,7 +466,7 @@ if [ -v ONLY_VCA ]; then
     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"
+    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"
 else
     deploy_charmed_osm
     install_osmclient
index b232b4c..f157c1c 100755 (executable)
@@ -1001,13 +1001,7 @@ function deploy_osm_services() {
 #deploy charmed services
 function deploy_charmed_services() {
     juju add-model $OSM_STACK_NAME $OSM_VCA_K8S_CLOUDNAME
-    # deploy mongodb charm
-    namespace=$OSM_STACK_NAME
-    juju deploy cs:~charmed-osm/mongodb-k8s \
-        --config enable-sidecar=true \
-        --config replica-set=rs0 \
-        --config namespace=$namespace \
-        -m $namespace
+    juju deploy ch:mongodb-k8s -m $OSM_STACK_NAME
 }
 
 function deploy_osm_pla_service() {
@@ -1629,8 +1623,8 @@ function parse_docker_registry_url() {
 }
 
 LXD_VERSION=4.0
-JUJU_VERSION=2.8
-JUJU_AGENT_VERSION=2.8.13
+JUJU_VERSION=2.9
+JUJU_AGENT_VERSION=2.9.22
 UNINSTALL=""
 DEVELOP=""
 UPDATE=""