# Prerequisites

Before installing, be sure your system meets the minimum requirements and has access to the [hostnames required](https://help.camio.com/hc/en-us/articles/11283787258388-How-do-I-install-MicroK8s-for-Camio-Flex#h_01GKYWFH8SGK9FW959THF6Z8H1).

- [According to MicroK8s official documentation](https://microk8s.io/docs/getting-started): MicroK8s runs in as little as 540MB of memory, but to accommodate workloads, we recommend a system with at least 20G of disk space and 4G of memory.
- Connection to the internet

The above are the bare minimum requirements to _install microk8s._ Camio Flex requires the above requirements along with the following:

- Current estimates are around 1gb/stream of memory + 1cpu core/stream + 10gb/stream of disk space. Ideally with 20% extra for usage spikes and overhead.
- Adding local storage is also an option, and a recommendation of an additional 50-100gb/stream
- Flex is also not recommended on systems with less than 4 cores at the moment.

The system must also be running Ubuntu, preferably no older than version 20.04.

## Hostnames for microk8s

Your firewall must permit access to these additional hostnames.

- ```
api.snapcraft.io
```

- ```
public.apps.ubuntu.com
```

- ```
snapcraft.io
```

- ```
fastly.cdn.snapcraft.io
```

# Installing Microk8s

Camio Flex is tested on Microk8s version 1.23

1. To install it, use snap install:

```
sudo snap install microk8s --classic --channel=1.23/stable
```

2. By recommendation of MicroK8s, add the active user to the microk8s group and own .kube:

```
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
```

3. Check to see the status:

```
sudo microk8s status
```

4. Now we will enable the required addons:

```
sudo microk8s enable dns storage helm3
```

5. If you would like a k8s gui, you can also add the dashboard package:

```
sudo microk8s enable dashboard
```

6. The next step is to edit the kublet file. This is usually found at the following path:

```
/var/snap/microk8s/current/args/kubelet
```

7. Add or edit these values in the kubelet file:

```
   --max-pods=10000
   --log-file-max-size=1000
   --log-flush-frequency=3
   --container-log-max-files=1
```

8. Then reset the kubelet service:

```
sudo service snap.microk8s.daemon-kubelet restart
```

9. You can use the microk8s status command to check when microk8s is back up:

```
sudo microk8s status
```

MicroK8s should now be installed and set up properly for use with Camio Flex.
