echo -e " -b tags/v1.1.0 (a specific tag)"
echo -e " ..."
echo -e " -c <orchestrator> deploy osm services using container <orchestrator>. Valid values are <k8s> or <swarm>. If -c is not used then osm will be deployed using default orchestrator. When used with --uninstall, osm services deployed by the orchestrator will be uninstalled"
- echo -e " -n <ui> install OSM with Next Gen UI. Valid values are <lwui> or <ngui>. If -n is not specified osm will be installed with light-ui. When used with uninstall, osm along with the UI specified will be uninstalled"
echo -e " -s <stack name> or <namespace> user defined stack name when installed using swarm or namespace when installed using k8s, default is osm"
echo -e " -H <VCA host> use specific juju host controller IP"
echo -e " -S <VCA secret> use VCA/juju secret key"
echo -e " --showopts: print chosen options and exit (only for debugging)"
echo -e " -y: do not prompt for confirmation, assumes yes"
echo -e " -h / --help: print this help"
- echo -e " --charmed: install OSM with charms"
- echo -e " --bundle <bundle path>: Specify with which bundle to deploy OSM with charms (--charmed option)"
- echo -e " --kubeconfig <kubeconfig path>: Specify with which kubernetes to deploy OSM with charms (--charmed option)"
- echo -e " --controller <name>: Specifies the name of the controller to use - The controller must be already bootstrapped (--charmed option)"
- echo -e " --lxd-cloud <yaml path>: Takes a YAML file as a parameter with the LXD Cloud information (--charmed option)"
- echo -e " --lxd-credentials <yaml path>: Takes a YAML file as a parameter with the LXD Credentials information (--charmed option)"
- echo -e " --microstack: Installs microstack as a vim. (--charmed option)"
- echo -e " --tag: Docker image tag"
+ echo -e " --charmed: Deploy and operate OSM with Charms on k8s"
+ echo -e " [--bundle <bundle path>]: Specify with which bundle to deploy OSM with charms (--charmed option)"
+ echo -e " [--k8s <kubeconfig path>]: Specify with which kubernetes to deploy OSM with charms (--charmed option)"
+ echo -e " [--vca <name>]: Specifies the name of the controller to use - The controller must be already bootstrapped (--charmed option)"
+ echo -e " [--lxd <yaml path>]: Takes a YAML file as a parameter with the LXD Cloud information (--charmed option)"
+ echo -e " [--lxd-cred <yaml path>]: Takes a YAML file as a parameter with the LXD Credentials information (--charmed option)"
+ echo -e " [--microstack]: Installs microstack as a vim. (--charmed option)"
+ echo -e " [--ha]: Installs High Availability bundle. (--charmed option)"
+ echo -e " [--tag]: Docker image tag"
}
newgrp docker << EONG
docker image rm ${DOCKER_USER}/ro:${OSM_DOCKER_TAG}
docker image rm ${DOCKER_USER}/lcm:${OSM_DOCKER_TAG}
+ docker image rm ${DOCKER_USER}/light-ui:${OSM_DOCKER_TAG}
docker image rm ${DOCKER_USER}/keystone:${OSM_DOCKER_TAG}
docker image rm ${DOCKER_USER}/nbi:${OSM_DOCKER_TAG}
docker image rm ${DOCKER_USER}/mon:${OSM_DOCKER_TAG}
docker image rm ${DOCKER_USER}/pla:${OSM_DOCKER_TAG}
docker image rm ${DOCKER_USER}/osmclient:${OSM_DOCKER_TAG}
EONG
- if [ -n "$NGUI" ]; then
- newgrp docker << EONG
- docker image rm ${DOCKER_USER}/ng-ui:${OSM_DOCKER_TAG}
-EONG
- else
- newgrp docker << EONG
- docker image rm ${DOCKER_USER}/light-ui:${OSM_DOCKER_TAG}
-EONG
- fi
if [ -n "$KUBERNETES" ]; then
OSM_NAMESPACE_VOL="${OSM_HOST_VOL}/${OSM_STACK_NAME}"
#Configure NAT rules, based on the current IP addresses of containers
function nat(){
check_install_iptables_persistent
-
+
echo -e "\nConfiguring NAT rules"
echo -e " Required root privileges"
sudo $OSM_DEVOPS/installers/nat_osm
function install_juju() {
echo "Installing juju"
- sudo snap install juju --classic
+ sudo snap install juju --classic --channel=2.7/stable
[[ ":$PATH": != *":/snap/bin:"* ]] && PATH="/snap/bin:${PATH}"
echo "Finished installation of juju"
return 0
sg docker -c "docker build ${LWTEMPDIR}/LCM -f ${LWTEMPDIR}/LCM/Dockerfile.local -t ${DOCKER_USER}/lcm --no-cache" || FATAL "cannot build LCM docker image"
fi
- if [ -n "$NGUI" ]; then
- if [ -n "$PULL_IMAGES" ]; then
- sg docker -c "docker pull ${DOCKER_USER}/ng-ui:${OSM_DOCKER_TAG}" || FATAL "cannot pull ng-ui docker image"
- elif [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q NG-UI ; then
- git -C ${LWTEMPDIR} clone https://osm.etsi.org/gerrit/osm/NG-UI
- git -C ${LWTEMPDIR}/NG-UI checkout ${COMMIT_ID}
- sg docker -c "docker build ${LWTEMPDIR}/NG-UI -f ${LWTEMPDIR}/NG-UI/docker/Dockerfile -t ${DOCKER_USER}/ng-ui --no-cache" || FATAL "cannot build NG-UI docker image"
- fi
- else
- if [ -n "$PULL_IMAGES" ]; then
- sg docker -c "docker pull ${DOCKER_USER}/light-ui:${OSM_DOCKER_TAG}" || FATAL "cannot pull light-ui docker image"
- elif [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q LW-UI ; then
- git -C ${LWTEMPDIR} clone https://osm.etsi.org/gerrit/osm/LW-UI
- git -C ${LWTEMPDIR}/LW-UI checkout ${COMMIT_ID}
- sg docker -c "docker build ${LWTEMPDIR}/LW-UI -f ${LWTEMPDIR}/LW-UI/docker/Dockerfile -t ${DOCKER_USER}/light-ui --no-cache" || FATAL "cannot build LW-UI docker image"
- fi
- fi
+ if [ -n "$PULL_IMAGES" ]; then
+ sg docker -c "docker pull ${DOCKER_USER}/light-ui:${OSM_DOCKER_TAG}" || FATAL "cannot pull light-ui docker image"
+ elif [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q LW-UI ; then
+ git -C ${LWTEMPDIR} clone https://osm.etsi.org/gerrit/osm/LW-UI
+ git -C ${LWTEMPDIR}/LW-UI checkout ${COMMIT_ID}
+ sg docker -c "docker build ${LWTEMPDIR}/LW-UI -f ${LWTEMPDIR}/LW-UI/docker/Dockerfile -t ${DOCKER_USER}/light-ui --no-cache" || FATAL "cannot build LW-UI docker image"
+ fi
if [ -n "$PULL_IMAGES" ]; then
sg docker -c "docker pull ${DOCKER_USER}/osmclient:${OSM_DOCKER_TAG}" || FATAL "cannot pull osmclient docker image"
if [ -n "$KUBERNETES" ]; then
#Kubernetes resources
$WORKDIR_SUDO cp -bR ${OSM_DEVOPS}/installers/docker/osm_pods $OSM_DOCKER_WORK_DIR
- [ -n "$NGUI" ] && $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/osm_pods/ng-ui.yaml $OSM_K8S_WORK_DIR/ng-ui.yaml && $WORKDIR_SUDO rm $OSM_K8S_WORK_DIR/light-ui.yaml
else
- if [ -n "$NGUI" ]; then
- # For NG-UI
- $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/docker-compose-ngui.yaml $OSM_DOCKER_WORK_DIR/docker-compose.yaml
- else
- # Docker-compose
- $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/docker-compose.yaml $OSM_DOCKER_WORK_DIR/docker-compose.yaml
- fi
+ # Docker-compose
+ $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/docker-compose.yaml $OSM_DOCKER_WORK_DIR/docker-compose.yaml
if [ -n "$INSTALL_PLA" ]; then
$WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/osm_pla/docker-compose.yaml $OSM_DOCKER_WORK_DIR/osm_pla/docker-compose.yaml
fi
}
function parse_yaml() {
- osm_services="nbi lcm ro pol mon light-ui ng-ui keystone"
+ osm_services="nbi lcm ro pol mon light-ui keystone"
TAG=$1
for osm in $osm_services; do
- $WORKDIR_SUDO sed -i "s/opensourcemano\/$osm:.*/$DOCKER_USER\/$osm:$TAG/g" $OSM_K8S_WORK_DIR/$osm.yaml
+ $WORKDIR_SUDO sed -i "s/opensourcemano\/$osm:.*/opensourcemano\/$osm:$TAG/g" $OSM_K8S_WORK_DIR/$osm.yaml
done
}
echo "OSM_STACK_NAME=$OSM_STACK_NAME"
echo "PULL_IMAGES=$PULL_IMAGES"
echo "KUBERNETES=$KUBERNETES"
- echo "NGUI=$NGUI"
echo "SHOWOPTS=$SHOWOPTS"
echo "Install from specific refspec (-b): $COMMIT_ID"
}
INSTALL_NODOCKER=""
INSTALL_NOJUJU=""
KUBERNETES=""
-NGUI=""
INSTALL_K8S_MONITOR=""
INSTALL_NOHOSTCLIENT=""
SESSION_ID=`date +%s`
K8S_MANIFEST_DIR="/etc/kubernetes/manifests"
RE_CHECK='^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'
-while getopts ":b:r:c:n:k:u:R:D:o:m:H:S:s:w:t:U:P:A:l:L:K:-: hy" o; do
+while getopts ":b:r:c:k:u:R:D:o:m:H:S:s:w:t:U:P:A:l:L:K:-: hy" o; do
case "${o}" in
b)
COMMIT_ID=${OPTARG}
echo -e "Invalid argument for -i : ' $OPTARG'\n" >&2
usage && exit 1
;;
- n)
- [ "${OPTARG}" == "lwui" ] && continue
- [ "${OPTARG}" == "ngui" ] && NGUI="y" && continue
- echo -e "Invalid argument for -n : ' $OPTARG'\n" >&2
- usage && exit 1
- ;;
k)
REPOSITORY_KEY="${OPTARG}"
REPO_ARGS+=(-k "$REPOSITORY_KEY")
[ "${OPTARG}" == "k8s_monitor" ] && INSTALL_K8S_MONITOR="y" && continue
[ "${OPTARG}" == "charmed" ] && CHARMED="y" && continue
[ "${OPTARG}" == "bundle" ] && continue
- [ "${OPTARG}" == "kubeconfig" ] && continue
- [ "${OPTARG}" == "lxdendpoint" ] && continue
- [ "${OPTARG}" == "lxdcert" ] && continue
+ [ "${OPTARG}" == "k8s" ] && continue
+ [ "${OPTARG}" == "lxd" ] && continue
+ [ "${OPTARG}" == "lxd-cred" ] && continue
[ "${OPTARG}" == "microstack" ] && continue
+ [ "${OPTARG}" == "ha" ] && continue
[ "${OPTARG}" == "tag" ] && continue
[ "${OPTARG}" == "pla" ] && INSTALL_PLA="y" && continue
echo -e "Invalid option: '--$OPTARG'\n" >&2
/usr/share/osm-devops/installers/charmed_uninstall.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D /usr/share/osm-devops -t $DOCKER_TAG "$@"
else
/usr/share/osm-devops/installers/charmed_install.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D /usr/share/osm-devops -t $DOCKER_TAG "$@"
- fi
- echo "Your installation is now complete, follow these steps for configuring the osmclient:"
- echo
- echo "1. Get the NBI IP with the following command:"
- echo
- echo "juju status --format yaml | yq r - applications.nbi-k8s.address"
- echo
- echo "2. Create the OSM_HOSTNAME environment variable with the NBI IP"
- echo
- echo "export OSM_HOSTNAME=<NBI-IP>"
- echo
- echo "3. Add the previous command to your .bashrc for other Shell sessions"
- echo
- echo "export OSM_HOSTNAME=<previous-IP> >> ~/.bashrc"
- echo
- echo "DONE"
+ echo "Your installation is now complete, follow these steps for configuring the osmclient:"
+ echo
+ echo "1. Get the NBI IP with the following command:"
+ echo
+ echo NBI_IP='`juju status --format json | jq -rc '"'"'.applications."nbi-k8s".address'"'"'`'
+ echo
+ echo "2. Create the OSM_HOSTNAME environment variable with the NBI IP"
+ echo
+ echo "export OSM_HOSTNAME=\$NBI_IP"
+ echo
+ echo "3. Add the previous command to your .bashrc for other Shell sessions"
+ echo
+ echo "echo \"export OSM_HOSTNAME=\$NBI_IP\" >> ~/.bashrc"
+ echo
+ echo "DONE"
+ fi
exit 0
fi