From 7406dee9575b42f83e72cfacb0107382faa09163 Mon Sep 17 00:00:00 2001 From: David Garcia Date: Mon, 19 Oct 2020 15:42:42 +0200 Subject: [PATCH] Use mongodb charm in k8s installer - 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 Signed-off-by: garciadeblas --- installers/charmed_install.sh | 5 +++-- installers/docker/osm_pla/pla.yaml | 2 ++ installers/docker/osm_pods/lcm.yaml | 8 ++++---- installers/docker/osm_pods/mon.yaml | 2 ++ installers/docker/osm_pods/nbi.yaml | 18 +++++++++--------- installers/docker/osm_pods/pol.yaml | 2 ++ 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/installers/charmed_install.sh b/installers/charmed_install.sh index 9fda5166..7d03fc77 100755 --- a/installers/charmed_install.sh +++ b/installers/charmed_install.sh @@ -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 diff --git a/installers/docker/osm_pla/pla.yaml b/installers/docker/osm_pla/pla.yaml index 39f1b9d5..e35e53e7 100644 --- a/installers/docker/osm_pla/pla.yaml +++ b/installers/docker/osm_pla/pla.yaml @@ -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 diff --git a/installers/docker/osm_pods/lcm.yaml b/installers/docker/osm_pods/lcm.yaml index 6824f63d..b4648618 100644 --- a/installers/docker/osm_pods/lcm.yaml +++ b/installers/docker/osm_pods/lcm.yaml @@ -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 diff --git a/installers/docker/osm_pods/mon.yaml b/installers/docker/osm_pods/mon.yaml index 31808aaa..490889f5 100644 --- a/installers/docker/osm_pods/mon.yaml +++ b/installers/docker/osm_pods/mon.yaml @@ -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 diff --git a/installers/docker/osm_pods/nbi.yaml b/installers/docker/osm_pods/nbi.yaml index c1fbf30b..0dd2b2de 100644 --- a/installers/docker/osm_pods/nbi.yaml +++ b/installers/docker/osm_pods/nbi.yaml @@ -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 diff --git a/installers/docker/osm_pods/pol.yaml b/installers/docker/osm_pods/pol.yaml index 8ad3c8be..063a976a 100644 --- a/installers/docker/osm_pods/pol.yaml +++ b/installers/docker/osm_pods/pol.yaml @@ -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 -- 2.25.1