[WIP] Manually installing OSM on Kubernetes


#1

OSM on Kubernetes

This is a WORK-IN-PROGRESS guide will walk you through setting up a non-HA installation the Charmed Distribution of OSM using microk8s.

Installing

Before deploying OSM on Kubernetes, we’ll need to install a few prerequisites.

LXD

For best performance, we recommend configuring LXD to use ZFS for container storage

# Install LXD from snap
sudo snap install lxd

# Initialize LXD
$ lxd init
Would you like to use LXD clustering? (yes/no) [default=no]: no
Do you want to configure a new storage pool? (yes/no) [default=yes]: yes
Name of the new storage pool [default=default]: default
Name of the storage backend to use (btrfs, ceph, dir, lvm, zfs) [default=zfs]: zfs
Create a new ZFS pool? (yes/no) [default=yes]: yes
Would you like to use an existing block device? (yes/no) [default=no]: no
Size in GB of the new loop device (1GB minimum) [default=31GB]: 31GB
Would you like to connect to a MAAS server? (yes/no) [default=no]: no
Would you like to create a new local network bridge? (yes/no) [default=yes]: yes
What should the new bridge be called? [default=lxdbr0]: lxdbr0
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: auto
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like LXD to be available over the network? (yes/no) [default=no]: no
Would you like stale cached images to be updated automatically? (yes/no) [default=yes] yes
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: no

microk8s

Wait for microk8s to be available

sudo snap install microk8s --classic
microk8s.status --wait-ready
microk8s.enable dashboard storage dns

# Make an alias to kubectl
sudo snap alias microk8s.kubectl kubectl

# Why?
sudo iptables -P FORWARD ACCEPT

Juju

Bootstrap controller for VCA

sudo snap install juju --classic

juju bootstrap localhost osm

Get your credentials

$ juju gui

GUI 2.14.0 for model "admin/default" is enabled at:
  https://10.29.253.64:17070/gui/u/admin/default
Your login credential is:
  username: admin
  password: 596928981883b8af17cd2e27a6aad4e7

TODO: Make this easier

Performance

TODO: Document additional LXD performance

Bootstrap controller for OSM on Kubernetes

# Bootstrap a Juju controller for the Canonical Distribution of OSM on microk8s
juju bootstrap microk8s cdo

juju add-model osm

Setup NFS

Shared storage is required for certain components of OSM. Until a proper shared storage solution is integrated upstream, we’ll setup a NFS server.

For convenience, we’ve made install_nfs.sh available. It has two options:

  • install_nfs.sh --install
  • install_nfs.sh --uninstall

Deploying OSM

Create storage pools:

juju create-storage-pool operator-storage kubernetes storage-class=microk8s-hostpath
juju create-storage-pool kafka-pv kubernetes storage-class=microk8s-hostpath
juju create-storage-pool ro-pv kubernetes storage-class=microk8s-hostpath
juju create-storage-pool packages-pv kubernetes storage-class=nfs-hostpath
juju create-storage-pool mariadb-pv kubernetes storage-class=microk8s-hostpath
juju create-storage-pool mongo-pv kubernetes storage-class=microk8s-hostpath
juju create-storage-pool zookeeper-pv kubernetes storage-class=microk8s-hostpath
juju create-storage-pool mon-pv kubernetes storage-class=microk8s-hostpath
juju create-storage-pool pol-pv kubernetes storage-class=microk8s-hostpath
juju create-storage-pool prometheus-pv kubernetes storage-class=microk8s-hostpath

Deploy the bundle

juju deploy cs:~charmed-osm/bundle/canonical-osm --overlay overlay.yaml

Uninstalling (manually)

TODO: Add commands to tear down controllers

Killing the controller

TODO: Document steps if normal tear down fails

juju kill-controller osm-on-k8s
juju unregister osm-on-k8s