End to end setup with MicroK8S on Ubuntu
This tutorial installs OSIE on a single machine, with the databases bundled in the Helm chart. It suits evaluations and small installations. For production, follow the Kubernetes installation guide, where the databases are run by Kubernetes operators.
MicroK8S is one of the simplest Kubernetes distributions, being provided on Ubuntu by Canonical.
In this tutorial, we are going to install MicroK8S on a single Ubuntu machine. Afterwards, we are going to install
OSIE on the MicroK8S distribution using the helm chart. Configuring high availability for the cluster is out of the scope here.
Prerequisites
- a virtual machine with Ubuntu 22.04 LTS installed with at least 4 vCPU and 8GB RAM.
- a public IP address configured on the network interface
- your domain pointing to the IP address on the DNS
- SSH access to that machine
- root access either via the root user or
sudo
Note: Make sure your VM supports AVX by checking cat /proc/cpuinfo | grep avx, otherwise MongoDB won't work.
Installation
Install MicroK8S and then install OSIE on top of it.
1. Install MicroK8S
sudo snap install microk8s --classic --channel=1.27
2. (optional) if you are not root, join the microk8s group
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
# You will also need to re-enter the session for the group update to take place:
su - $USER
3. Check the status
microk8s status --wait-ready
4. Enable the required features
# Enables the NGINX ingress
microk8s enable ingress
# Enables storage on the local disk
microk8s enable hostpath-storage
5. Install cert-manager
cert-manager is the tool used to automatically generate SSL certificates using Let's Encrypt.
asd asd asd asd asd asd asd asd asd asd asd asd asd asd
microk8s kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml
# Wait for cert-manager installation to complete
microk8s kubectl -n cert-manager get pods
Create a letsencrypt issuer.
microk8s kubectl apply -f - <<EOF
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-issuer-account-key
solvers:
- http01:
ingress:
ingressClassName: nginx
EOF
6. Add OSIE's helm repository
microk8s helm repo add osie https://helm.osie.io
microk8s helm repo update
7. Install OSIE
Create the configuration file values.yml. Please update the hostname accordingly.
cat <<EOF > values.yml
global:
ingress:
enabled: true
hostname: "osie.mycompany.com"
ingressClassName: "nginx"
annotations:
cert-manager.io/cluster-issuer: letsencrypt
tls: true
keycloak:
enabled: false
EOF
Install the release
microk8s helm install osie osie/osie -f values.yml
8. Verify the installation
Navigate to https://osie.mycompany.com/osie_admin. On first access, you will be guided through an onboarding process where you can create your administrator account and set a password.
Post installation
Save the encryption key and set up upgrades as described in the Kubernetes installation guide.