--overlay) OVERLAY="$2" ;;
--k8s) KUBECFG="$2" ;;
--vca) CONTROLLER="$2" ;;
+ --small-profile) INSTALL_NOLXD=y;;
--lxd) LXD_CLOUD="$2" ;;
--lxd-cred) LXD_CREDENTIALS="$2" ;;
--microstack) MICROSTACK=y ;;
fi
track bootstrap_k8s bootstrap_k8s_ok
- if [ -v LXD_CLOUD ]; then
- if [ ! -v LXD_CREDENTIALS ]; then
- echo "The installer needs the LXD server certificate if the LXD is external"
- FATAL_TRACK bootstrap_lxd "No LXD certificate supplied"
- fi
- else
- LXDENDPOINT=$DEFAULT_IP
- LXD_CLOUD=~/.osm/lxd-cloud.yaml
- LXD_CREDENTIALS=~/.osm/lxd-credentials.yaml
- # Apply sysctl production values for optimal performance
- sudo cp /usr/share/osm-devops/installers/60-lxd-production.conf /etc/sysctl.d/60-lxd-production.conf
- sudo sysctl --system
- # Install LXD snap
- sudo apt-get remove --purge -y liblxc1 lxc-common lxcfs lxd lxd-client
- sudo snap install lxd --channel $LXD_VERSION/stable
- # Configure LXD
- sudo usermod -a -G lxd `whoami`
- cat /usr/share/osm-devops/installers/lxd-preseed.conf | sed 's/^config: {}/config:\n core.https_address: '$LXDENDPOINT':8443/' | sg lxd -c "lxd init --preseed"
- sg lxd -c "lxd waitready"
- DEFAULT_MTU=$(ip addr show $DEFAULT_IF | perl -ne 'if (/mtu\s(\d+)/) {print $1;}')
- sg lxd -c "lxc profile device set default eth0 mtu $DEFAULT_MTU"
- sg lxd -c "lxc network set lxdbr0 bridge.mtu $DEFAULT_MTU"
-
- cat << EOF > $LXD_CLOUD
+ if [ ! -v INSTALL_NOLXD ]; then
+ if [ -v LXD_CLOUD ]; then
+ if [ ! -v LXD_CREDENTIALS ]; then
+ echo "The installer needs the LXD server certificate if the LXD is external"
+ FATAL_TRACK bootstrap_lxd "No LXD certificate supplied"
+ fi
+ else
+ LXDENDPOINT=$DEFAULT_IP
+ LXD_CLOUD=~/.osm/lxd-cloud.yaml
+ LXD_CREDENTIALS=~/.osm/lxd-credentials.yaml
+ # Apply sysctl production values for optimal performance
+ sudo cp /usr/share/osm-devops/installers/60-lxd-production.conf /etc/sysctl.d/60-lxd-production.conf
+ sudo sysctl --system
+ # Install LXD snap
+ sudo apt-get remove --purge -y liblxc1 lxc-common lxcfs lxd lxd-client
+ sudo snap install lxd --channel $LXD_VERSION/stable
+ # Configure LXD
+ sudo usermod -a -G lxd `whoami`
+ cat /usr/share/osm-devops/installers/lxd-preseed.conf | sed 's/^config: {}/config:\n core.https_address: '$LXDENDPOINT':8443/' | sg lxd -c "lxd init --preseed"
+ sg lxd -c "lxd waitready"
+ DEFAULT_MTU=$(ip addr show $DEFAULT_IF | perl -ne 'if (/mtu\s(\d+)/) {print $1;}')
+ sg lxd -c "lxc profile device set default eth0 mtu $DEFAULT_MTU"
+ sg lxd -c "lxc network set lxdbr0 bridge.mtu $DEFAULT_MTU"
+
+ cat << EOF > $LXD_CLOUD
clouds:
lxd-cloud:
type: lxd
config:
ssl-hostname-verification: false
EOF
- openssl req -nodes -new -x509 -keyout ~/.osm/client.key -out ~/.osm/client.crt -days 365 -subj "/C=FR/ST=Nice/L=Nice/O=ETSI/OU=OSM/CN=osm.etsi.org"
- local server_cert=`cat /var/snap/lxd/common/lxd/server.crt | sed 's/^/ /'`
- local client_cert=`cat ~/.osm/client.crt | sed 's/^/ /'`
- local client_key=`cat ~/.osm/client.key | sed 's/^/ /'`
+ openssl req -nodes -new -x509 -keyout ~/.osm/client.key -out ~/.osm/client.crt -days 365 -subj "/C=FR/ST=Nice/L=Nice/O=ETSI/OU=OSM/CN=osm.etsi.org"
+ local server_cert=`cat /var/snap/lxd/common/lxd/server.crt | sed 's/^/ /'`
+ local client_cert=`cat ~/.osm/client.crt | sed 's/^/ /'`
+ local client_key=`cat ~/.osm/client.key | sed 's/^/ /'`
- cat << EOF > $LXD_CREDENTIALS
+ cat << EOF > $LXD_CREDENTIALS
credentials:
lxd-cloud:
lxd-cloud:
client-key: |
$client_key
EOF
- lxc config trust add local: ~/.osm/client.crt
+ lxc config trust add local: ~/.osm/client.crt
+ fi
+
+ juju add-cloud -c $CONTROLLER_NAME lxd-cloud $LXD_CLOUD --force
+ juju add-credential -c $CONTROLLER_NAME lxd-cloud -f $LXD_CREDENTIALS
+ sg lxd -c "lxd waitready"
+ juju controller-config features=[k8s-operators]
+ track bootstrap_lxd bootstrap_lxd_ok
fi
-
- juju add-cloud -c $CONTROLLER_NAME lxd-cloud $LXD_CLOUD --force
- juju add-credential -c $CONTROLLER_NAME lxd-cloud -f $LXD_CREDENTIALS
- sg lxd -c "lxd waitready"
- juju controller-config features=[k8s-operators]
- track bootstrap_lxd bootstrap_lxd_ok
}
function deploy_charmed_osm(){
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 " [--small-profile]: Do not install and configure LXD which aims to use only K8s Clouds (--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)"
[ "${OPTARG}" == "microstack" ] && continue
[ "${OPTARG}" == "overlay" ] && continue
[ "${OPTARG}" == "only-vca" ] && continue
+ [ "${OPTARG}" == "small-profile" ] && continue
[ "${OPTARG}" == "vca" ] && continue
[ "${OPTARG}" == "ha" ] && continue
[ "${OPTARG}" == "tag" ] && continue