# Pre-requisites

This document describes the pre-requisites to deploy Self-Hosted version of <code class="expression">space.vars.product\_name</code>.

Following table provides the recommended number of servers you should allocate to run your Self-Hosted <code class="expression">space.vars.product\_name</code> Instance.

### Management Cluster

As part of the installation process, the Self-Hosted version of <code class="expression">space.vars.product\_name</code> creates a **Kubernetes cluster** using the physical servers that you use to deploy it on. We refer to this cluster as the **management cluster**. The <code class="expression">space.vars.product\_name</code> management plane then runs as a set of Kubernetes pods and services on this management cluster.

Following is the recommended capacity for the management cluster, based on the projected scale of your <code class="expression">space.vars.product\_name</code> deployment.

| **Hypervisors You Plan to Use**       | **Minimum Management Cluster Capacity**                                                                                 | **Recommended Management Cluster Capacity**                                                                            |
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| <p>Small<br><br>(<20 hosts)</p>       | <p>3 servers, each with:<br><br>14 vCPUs, 28GB RAM and 250GB SSD</p>                                                    | <p>4 servers, each with:<br><br>16 vCPUs, 32GB RAM and 500GB SSD</p>                                                   |
| <p>Growth<br><br>(<100 hosts)</p>     | <p>4 servers, each with:<br><br>16 vCPUs, 32GB RAM and 500GB SSD</p>                                                    | <p>5 servers, each with:<br><br>16 vCPUs, 32GB RAM and 1TB SSD</p>                                                     |
| <p>Enterprise<br><br>(>100 hosts)</p> | <p>5 servers, each with:<br><br>16 vCPUs, 32GB RAM and 1TB SSD<br><br>1 additional server for every 100 Hypervisors</p> | <p>6 servers, each with:<br><br>24 vCPUs, 32GB RAM and 1TB SSD<br><br>1 additional server for every 50 Hypervisors</p> |

The above recommendation is for a single Management Plane region. For every extra region that needs to be deployed on the same Management Cluster, the capacity should be increased increased accordingly. It is recommended to have a separate management cluster in every geographical location, so as to avoid performance degration and single point of failure.

### Server Configuration

Each physical server that you use to run as part of the management cluster should meet following requirements:

**Operating System**: Ubuntu 22.04

**Swap config:**

* Make sure that each server has swap disabled. You can run the following command to do this.

{% tabs %}
{% tab title="Bash" %}

```bash
swapoff -a
```

{% endtab %}
{% endtabs %}

The above change will not survive a reboot; hence it is recommended to update the `/etc/fstab` file and comment out the line has the entry for `swap` partition. e.g.

{% tabs %}
{% tab title="Bash" %}

```bash
UUID=aabbcc /               ext4    errors=remount-ro 0       1
UUID=xxyyzz /home           ext4    defaults        	0       2
UUID=mswmsw /media/windows  ntfs    defaults				  0       0

#/dev/sdb1 none swap sw 0 0   <--- comment out the line
```

{% endtab %}
{% endtabs %}

**IPv6 support:**

Ensure the below sysctl setting is set to 0, so that IPv6 support is enabled on the server.

{% tabs %}
{% tab title="Bash" %}

```bash
sysctl net.ipv6.conf.all.disable_ipv6
# If currently set to 1, change it to 0 as below:
echo net.ipv6.conf.all.disable_ipv6=0 >> /etc/sysctl.conf
sysctl -p
```

{% endtab %}
{% endtabs %}

**Passwordless Sudo:**

* Many operations require sudo access (for example, the installation of yum repos, docker etc.). Please ensure that your server has passwordless sudo enabled.

**Kernel Panic Option**

Update the server configuration section to include a step for setting `kernel.panic=10`

{% tabs %}
{% tab title="YAML" %}

```yaml
echo "kernel.panic=10" >> /etc/sysctl.conf && sysctl -p
```

{% endtab %}
{% endtabs %}

**SSH Keys:**

* We rely on ssh to login to the management cluster hosts, and to install various components and manage them.
* Please generate ssh keys and sync them across all hosts of the management cluster.
* We recommend generating the key pair on one host and then adding the public key to all other hosts in their `~/.ssh/authorized_keys` file. This will enable every host in the management cluster to ssh into every other host.

{% tabs %}
{% tab title="Bash" %}

```bash
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh-copy-id -i ~/.ssh/id_rsa.pub root@test-3
```

{% endtab %}
{% endtabs %}

**Package Updates:**

* Install `cgroup-tools` :

{% tabs %}
{% tab title="Bash" %}

```bash
apt-get update -y && apt-get install cgroup-tools -y
```

{% endtab %}
{% endtabs %}

* Download and Update OpenSSL Version to 3.0.7 for Ubuntu 22.04:

{% tabs %}
{% tab title="Bash" %}

```bash
export AGENT_KEY=<YOUR_USER_AGENT_KEY>
# Download the OpenSSL package
curl --user-agent "${AGENT_KEY}" https://pf9-airctl.s3-accelerate.amazonaws.com/openssl-smcp-ubuntu/openssl_3.0.7-1_amd64.deb --output /tmp/openssl_3.0.7-1_amd64.deb
# Verify the MD5 checksum
md5sum /tmp/openssl_3.0.7-1_amd64.deb | grep 706caf || { echo "MD5 checksum does not match, exiting." && exit 1; }
# Install the OpenSSL package
sudo dpkg -i /tmp/openssl_3.0.7-1_amd64.deb || { echo "Failed to install OpenSSL, exiting." && exit 1; }
echo "/usr/local/ssl/lib64" | sudo tee /etc/ld.so.conf.d/openssl-3.0.7.conf
sudo ldconfig -v
# Create a symbolic link to the OpenSSL binary
sudo ln -sf /usr/local/ssl/bin/openssl /usr/bin/openssl
# Verify the OpenSSL version
openssl version | grep 3.0.7 || { echo "OpenSSL version does not match, exiting." && exit 1; }
```

{% endtab %}
{% endtabs %}

* *User Agent Key For Installation:\**

You will need a specific Platform9 user agent key for installation of your self-hosted management plane. Your Platform9 sales engineer will share the key with you prior to the install.

### Networking

You will need 2 virtual IPs that are on the same L2 domain as the hosts in the management cluster.

* VIP #1: This is the IP where you can access the <code class="expression">space.vars.product\_name</code> management plane UI.
* VIP #2: This is used to serve the management Kubernetes cluster's API server.

### Storage

For a production setup of <code class="expression">space.vars.self\_hosted\_product\_name</code>, you will need a Kubernetes Container Strorage Interface (CSI) compatible storage for persisting the state of the management cluster. Read more about [CSI and Kubernetes Storage here](https://kubernetes.io/docs/concepts/storage/volumes/).
