if [ -v KUBECFG ]; then
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
+ [ -v BOOTSTRAP_NEEDED ] && juju bootstrap $K8S_CLOUD_NAME $CONTROLLER_NAME \
+ --config controller-service-type=loadbalancer \
+ --agent-version=2.8.1
else
sg ${KUBEGRP} -c "echo ${DEFAULT_IP}-${DEFAULT_IP} | microk8s.enable metallb"
sg ${KUBEGRP} -c "microk8s.enable storage dns"
done
[ ! -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" && K8S_CLOUD_NAME=microk8s
+ [ -v BOOTSTRAP_NEEDED ] && sg ${KUBEGRP} -c \
+ "juju bootstrap microk8s $CONTROLLER_NAME --config controller-service-type=loadbalancer --agent-version=2.8.1" \
+ && K8S_CLOUD_NAME=microk8s
fi
if [ -v LXD_CLOUD ]; then
API_SERVER="$(echo $hostport | sed -e 's,:.*,,g')"
fi
+ # Expose OSM services
+ # Expose NBI
juju config nbi-k8s juju-external-hostname=nbi.${API_SERVER}.xip.io
juju expose nbi-k8s
- wait_for_port nbi-k8s 0
- sg ${KUBEGRP} -c "${KUBECTL} get ingress -n osm -o json | jq '.items[0].metadata.annotations += {\"nginx.ingress.kubernetes.io/backend-protocol\": \"HTTPS\"}' | ${KUBECTL} --validate=false replace -f -"
- sg ${KUBEGRP} -c "${KUBECTL} get ingress -n osm -o json | jq '.items[0].metadata.annotations += {\"nginx.ingress.kubernetes.io/proxy-body-size\": \"0\"}' | ${KUBECTL} replace -f -"
-
+ # Expose NG UI
juju config ng-ui juju-external-hostname=ui.${API_SERVER}.xip.io
juju expose ng-ui
- wait_for_port ng-ui 1
- sg ${KUBEGRP} -c "${KUBECTL} get ingress -n osm -o json | jq '.items[2].metadata.annotations += {\"nginx.ingress.kubernetes.io/proxy-body-size\": \"0\"}' | ${KUBECTL} --validate=false replace -f -"
-
+ # Expose UI
juju config ui-k8s juju-external-hostname=osm.${API_SERVER}.xip.io
juju expose ui-k8s
+ # Wait for ingress resources to be applied
+ wait_for_port nbi-k8s 0
+ wait_for_port ng-ui 1
wait_for_port ui-k8s 2
- sg ${KUBEGRP} -c "${KUBECTL} get ingress -n osm -o json | jq '.items[1].metadata.annotations += {\"nginx.ingress.kubernetes.io/proxy-body-size\": \"0\"}' | ${KUBECTL} --validate=false replace -f -"
-}
+
+ # Apply annotations
+ sg ${KUBEGRP} -c "${KUBECTL} annotate ingress nginx.ingress.kubernetes.io/backend-protocol=HTTPS -n osm -l juju-app=nbi-k8s"
+ sg ${KUBEGRP} -c "${KUBECTL} annotate ingress nginx.ingress.kubernetes.io/proxy-body-size=0 -n osm -l juju-app=nbi-k8s"
+ sg ${KUBEGRP} -c "${KUBECTL} annotate ingress nginx.ingress.kubernetes.io/proxy-body-size=0 -n osm -l juju-app=ng-ui"
+ sg ${KUBEGRP} -c "${KUBECTL} annotate ingress nginx.ingress.kubernetes.io/proxy-body-size=0 -n osm -l juju-app=ui-k8s"
+
function check_osm_deployed() {
TIME_TO_WAIT=600
ng-ui:
options:
image: opensourcemano/ng-ui:$TAG
+ keystone:
+ options:
+ image: opensourcemano/keystone:$TAG
EOF
mv /tmp/images-overlay.yaml $IMAGES_OVERLAY_FILE