Install Cyberwatch offline with MicroK8s (deprecated)
This document details the procedure to follow to install Cyberwatch on an offline machine.
Prerequisites
Please ensure that the following prerequisites are satisfied:
- a machine with MicroK8s installed;
- a machine with access to the internet with a similar operating system to the one that does not have access to the internet;
- credentials provided by Cyberwatch to access container images and Helm charts (i.e a login/password provided by Cyberwatch).
Get required files
Connect via SSH on a machine with the same operating system as the machine where Cyberwatch will be deployed. This machine must be connected to the internet.
Create the
cyberwatch_sources
directory:mkdir cyberwatch_sources; cd cyberwatch_sources
On a Red Hat based distribution:
Install
yum-utils
:sudo yum install yum-utils curl epel-release
Install
snapd
:sudo yum install snapd
Install
podman
:sudo yum install podman export CONTAINER_DOWNLOADER=podman
On a Debian-based distribution:
Install
snapd
:sudo apt install snapd
Install
docker
:sudo apt install docker.io export CONTAINER_DOWNLOADER=docker
Download the cyberwatch package:
For Apt:
wget https://dl.cyberwatch.fr/apt/incoming/cyberwatch.deb
For Rpm:
wget https://dl.cyberwatch.fr/rpm/incoming/cyberwatch.rpm
Export the Cyberwatch’s credentials (complete the commands):
export CBW_USER= export CBW_PASSWORD=
Download the container images.
Login to the container registry:
sudo $CONTAINER_DOWNLOADER login -u cbw\$$CBW_USER -p $CBW_PASSWORD harbor.cyberwatch.fr/cbw-on-premise
Pull the images and save them:
sudo $CONTAINER_DOWNLOADER pull harbor.cyberwatch.fr/cbw-on-premise/olympe:stable sudo $CONTAINER_DOWNLOADER pull harbor.cyberwatch.fr/cbw-on-premise/redis:latest sudo $CONTAINER_DOWNLOADER pull harbor.cyberwatch.fr/cbw-on-premise/nginx:latest sudo $CONTAINER_DOWNLOADER pull harbor.cyberwatch.fr/cbw-on-premise/mariadb:latest sudo $CONTAINER_DOWNLOADER pull harbor.cyberwatch.fr/cbw-on-premise/third_parties:latest sudo $CONTAINER_DOWNLOADER pull harbor.cyberwatch.fr/cbw-on-premise/kibana-oss:latest sudo $CONTAINER_DOWNLOADER pull harbor.cyberwatch.fr/cbw-on-premise/elasticsearch-oss:latest sudo $CONTAINER_DOWNLOADER save harbor.cyberwatch.fr/cbw-on-premise/olympe:stable -o olympe.tar sudo $CONTAINER_DOWNLOADER save harbor.cyberwatch.fr/cbw-on-premise/redis:latest -o redis.tar sudo $CONTAINER_DOWNLOADER save harbor.cyberwatch.fr/cbw-on-premise/nginx:latest -o nginx.tar sudo $CONTAINER_DOWNLOADER save harbor.cyberwatch.fr/cbw-on-premise/mariadb:latest -o mariadb.tar sudo $CONTAINER_DOWNLOADER save harbor.cyberwatch.fr/cbw-on-premise/third_parties:latest -o third_parties.tar sudo $CONTAINER_DOWNLOADER save harbor.cyberwatch.fr/cbw-on-premise/kibana-oss:latest -o kibana-oss.tar sudo $CONTAINER_DOWNLOADER save harbor.cyberwatch.fr/cbw-on-premise/elasticsearch-oss:latest -o elasticsearch-oss.tar
Ensure that 7 container images have been downloaded:
ls *.tar | wc -l
Download Cyberwatch’s Helm chart.
Install Helm:
sudo systemctl start snapd sudo ln -s /var/lib/snapd/snap /snap sudo snap install helm --classic
Login to the registry and download the chart:
echo "$CBW_PASSWORD" | /snap/bin/helm registry login harbor.cyberwatch.fr/cbw-on-premise \ --username "cbw\$$CBW_USER" --password-stdin /snap/bin/helm pull oci://harbor.cyberwatch.fr/cbw-on-premise/cyberwatch-chart
Erase the environment variables:
unset CBW_USER CBW_PASSWORD history -c
Archive all the files:
cd .. sudo tar czvf cyberwatch_sources.tar.gz cyberwatch_sources
Install Cyberwatch
Transfer the archive on the offline machine.
Switch to the
root
user:sudo su
Extract the sources:
tar xvzf cyberwatch_sources.tar.gz cd cyberwatch_sources
Start MicroK8s:
/snap/bin/microk8s start
Load the container images into MicroK8s container’s cache:
ls *.tar| xargs -n 1 -I {} /snap/bin/microk8s ctr i import $(pwd)/{}
Verify the default containers are running:
/snap/bin/microk8s kubectl get po -A
If there is an error, please refer to the Troubleshooting page.
Install the cyberwatch package:
For Debian-based distributions:
dpkg -i cyberwatch.deb
For Red Hat based distributions:
rpm -i cyberwatch.rpm
Configure these two environment variable to file
/etc/cyberwatch/config.env
:CBW_OFFLINE="true" HELM="helm -n cyberwatch --kubeconfig /var/snap/microk8s/current/credentials/client.config"
Configure Cyberwatch:
sudo cyberwatch configure --offline
Start Cyberwatch:
sudo cyberwatch start
Monitor the status of the containers until they are all in the
Running
state:sudo cyberwatch status
Register the admin user through the web interface.