Deploy Cyberwatch behind proxy with MicroK8s (deprecated)

This page describes how to deploy Cyberwatch on a machine that access internet through a proxy.

  1. Ensure that the requirements are respected.

  2. Connect to the machine that will host Cyberwatch with a root account.

  3. Configure the package manager to use the proxy.

  4. Install snapd for your distribution.

  5. Activate and start snapd service:

    systemctl enable snapd --now
    
  6. Activate classic snaps:

    test -d /snap || ln -s /var/lib/snapd/snap /snap
    
  7. Check that environment variable HTTP_PROXY and HTTPS_PROXY are configured:

    env | grep HTTP
    

    If this is not the case, they need to be configured.

  8. Configure snap to use the proxy:

    snap set system proxy.http="$HTTP_PROXY"
    snap set system proxy.https="$HTTPS_PROXY"
    
  9. Install microk8s using the snap package manager:

    snap install microk8s --classic
    
  10. Add the machine hostname to the environment variables no_proxy and NO_PROXY in file /etc/environment according to the following example. Replace Y.Y.Y.Y by the IP address of the machine and <HOSTNAME> by the hostname of the machine.

    HTTP_PROXY=http://X.X.X.X:3128
    HTTPS_PROXY=http://X.X.X.X:3128
    http_proxy=http://X.X.X.X:3128
    https_proxy=http://X.X.X.X:3128
    no_proxy=127.0.0.1,10.1.0.0./16,10.152.183.0/24,Y.Y.Y.Y,<HOSTNAME>
    NO_PROXY=127.0.0.1,10.1.0.0./16,10.152.183.0/24,Y.Y.Y.Y,<HOSTNAME>
    
  11. Restart microk8s:

    /snap/bin/microk8s stop; /snap/bin/microk8s start
    
  12. Install Cyberwatch:

    For Debian-based distributions:

    sudo install -m 0755 -d /etc/apt/keyrings
    curl https://dl.cyberwatch.fr/apt/APT-CYBERWATCH-GPG-KEY | sudo gpg --dearmor -o /etc/apt/keyrings/cyberwatch.gpg
    sudo chmod a+r /etc/apt/keyrings/cyberwatch.gpg
    echo "deb [signed-by=/etc/apt/keyrings/cyberwatch.gpg] https://dl.cyberwatch.fr/apt any main" | sudo tee /etc/apt/sources.list.d/cyberwatch.list > /dev/null
    sudo apt update
    sudo apt install cyberwatch
    

    For Red Hat based distributions:

    sudo dnf config-manager --add-repo https://dl.cyberwatch.fr/rpm/cyberwatch.repo
    sudo dnf install cyberwatch
    
  13. Configure Cyberwatch:

    sudo cyberwatch configure
    

    A login and password will be prompted by the script. These credentials are available in the section Docker Credentials on the Cyberwatch license generated for you.

    The first start of Cyberwatch can take few minutes because all the containers images needs to be pulled. To monitor the status of the containers, use the following command:

    sudo cyberwatch status
    

Back to top