Use mongodb charm in k8s installer 63/10563/1
authorDavid Garcia <david.garcia@canonical.com>
Mon, 19 Oct 2020 13:42:42 +0000 (15:42 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 29 Mar 2021 13:43:32 +0000 (15:43 +0200)
- Update JUJU_AGENT_VERSION to 2.8.6
- Use mongodb charm and update needed osm pod specs to point at it

Change-Id: I75734a19aaa5b3b7a8913591ee86a8e1b82b29cd
Signed-off-by: David Garcia <david.garcia@canonical.com>
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/charmed_install.sh
installers/docker/osm_pla/pla.yaml
installers/docker/osm_pods/lcm.yaml
installers/docker/osm_pods/mon.yaml
installers/docker/osm_pods/nbi.yaml
installers/docker/osm_pods/pol.yaml

index 9fda516..7d03fc7 100755 (executable)
@@ -15,6 +15,7 @@
 
 # set -eux
 
+JUJU_AGENT_VERSION=2.8.6
 K8S_CLOUD_NAME="k8s-cloud"
 KUBECTL="microk8s.kubectl"
 IMAGES_OVERLAY_FILE=~/.osm/images-overlay.yaml
@@ -88,7 +89,7 @@ EOF
         cat $KUBECFG | juju add-k8s $K8S_CLOUD_NAME $ADD_K8S_OPTS
         [ -v BOOTSTRAP_NEEDED ] && juju bootstrap $K8S_CLOUD_NAME $CONTROLLER_NAME \
             --config controller-service-type=loadbalancer \
-            --agent-version=2.8.1
+            --agent-version=$JUJU_AGENT_VERSION
     else
         sg ${KUBEGRP} -c "echo ${DEFAULT_IP}-${DEFAULT_IP} | microk8s.enable metallb"
         sg ${KUBEGRP} -c "microk8s.enable ingress"
@@ -112,7 +113,7 @@ EOF
 
         [ ! -v BOOTSTRAP_NEEDED ] && sg ${KUBEGRP} -c "microk8s.config" | juju add-k8s $K8S_CLOUD_NAME $ADD_K8S_OPTS
         [ -v BOOTSTRAP_NEEDED ] && sg ${KUBEGRP} -c \
-            "juju bootstrap microk8s $CONTROLLER_NAME --config controller-service-type=loadbalancer --agent-version=2.8.1" \
+            "juju bootstrap microk8s $CONTROLLER_NAME --config controller-service-type=loadbalancer --agent-version=$JUJU_AGENT_VERSION" \
             && K8S_CLOUD_NAME=microk8s
     fi
 
index 39f1b9d..e35e53e 100644 (file)
@@ -41,6 +41,8 @@ spec:
           value: mongo
         - name: OSMPLA_MESSAGE_HOST
           value: kafka
+        - name: OSMPLA_DATABASE_URI
+          value: mongodb://mongodb-k8s:27017/?replicaSet=rs0
         volumeMounts:
         - name: osm-packages
           mountPath: /app/storage
index 6824f63..b464861 100644 (file)
@@ -40,13 +40,13 @@ spec:
         env:
         - name: OSMLCM_RO_HOST
           value: ro
-        - name: OSMLCM_DATABASE_HOST
-          value: mongodb-k8s
+        - name: OSMLCM_DATABASE_URI
+          value: mongodb://mongodb-k8s:27017/?replicaSet=rs0
         - name: OSMLCM_MESSAGE_HOST
           value: kafka
         envFrom:
         - secretRef:
-           name: lcm-secret
+          name: lcm-secret
         volumeMounts:
         - name: osm-packages
           mountPath: /app/storage
@@ -55,7 +55,7 @@ spec:
       volumes:
       - name: osm-packages
         hostPath:
-         path: /var/lib/osm/osm_osm_packages/_data
+          path: /var/lib/osm/osm_osm_packages/_data
       - name: prometheus-config
         hostPath:
           path: /var/lib/osm/prometheus
index 31808aa..490889f 100644 (file)
@@ -59,6 +59,8 @@ spec:
           value: kafka
         - name: OSMMON_MESSAGE_PORT
           value: "9092"
+        - name: OSMMON_DATABASE_URI
+          value: mongodb://mongodb-k8s:27017/?replicaSet=rs0
         envFrom:
         - secretRef:
            name: mon-secret
index c1fbf30..0dd2b2d 100644 (file)
@@ -55,17 +55,17 @@ spec:
         - containerPort: 9999
           protocol: TCP
         env:
-         - name: OSMNBI_DATABASE_HOST
-           value: mongodb-k8s
-         - name:  OSMNBI_MESSAGE_HOST
-           value: kafka
+        - name: OSMNBI_DATABASE_URI
+          value: mongodb://mongodb-k8s:27017/?replicaSet=rs0
+        - name:  OSMNBI_MESSAGE_HOST
+          value: kafka
         envFrom:
         - secretRef:
-           name: nbi-secret
+          name: nbi-secret
         volumeMounts:
-         - name: osm-packages
-           mountPath: /app/storage
+        - name: osm-packages
+          mountPath: /app/storage
       volumes:
-       - name: osm-packages
-         hostPath:
+      - name: osm-packages
+        hostPath:
           path: /var/lib/osm/osm_osm_packages/_data
index 8ad3c8b..063a976 100644 (file)
@@ -42,6 +42,8 @@ spec:
            value: kafka
          - name: OSMPOL_MESSAGE_PORT
            value: "9092"
+         - name: OSMPOL_DATABASE_URI
+           value: mongodb://mongodb-k8s:27017/?replicaSet=rs0
         envFrom:
         - secretRef:
              name: pol-secret