Before deploying Akri, you must have a Kubernetes cluster (v1.16 or higher) running with kubectl and Helm installed. Akri is Kubernetes native, so it should run on most Kubernetes distributions. This document provides cluster setup instructions for the three Kubernetes distributions that all of our end-to-end tests run on.
Note: All nodes must be Linux on amd64, arm64v8, or arm32v7.
Install Kubernetes Distribution
Reference Kubernetes documentation for instructions on how to install Kubernetes. See Akri's release notes to see what versions of Kubernetes Akri has been tested on.
Install K3s. The following will install the latest K3s version. Reference Akri's release notes to see what versions of K3s Akri has been tested on.
curl-sfLhttps://get.k3s.io|sh-
Note: Optionally specify a version with the INSTALL_K3S_VERSION env var as follows: curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.21.5+k3s1 sh -
If desired, add nodes to your cluster by running the K3s installation script with the K3S_URL and K3S_TOKEN environment variables. See K3s installation documentation for more details.
Install MicroK8s. The following will install the latest MicroK8s version. Add --channel=$VERSION/stable to specify as specific Kubernetes version. Reference Akri's release notes to see what versions of MicroK8s Akri has been tested on.
snapinstallmicrok8s--classic
Grant admin privilege for running MicroK8s commands.
If you don't have an existing kubectl and helm installations, add aliases. If you do not want to set an alias, add microk8s in front of all kubectl and helm commands.
alias kubectl='microk8s kubectl'alias helm='microk8s helm3'
By default, MicroK8s does not allow Pods to run in a privileged context. None of Akri's components run privileged; however, if your custom broker Pods do in order to access devices for example, enable privileged Pods like so:
Akri depends on crictl to track some Pod information. In order to use it, the Agent must know where the container runtime socket lives. This can be configured with Akri's Helm chart either directly by setting agent.host.containerRuntimeSocket or indirectly by specifying the Kubernetes distribution that is being used (kubernetesDistro=k3s|microk8s|k8s). If a distribution is specified, then the appropriate default will be used. If no distribution or runtime is specified, the k8s default is used.
Akri recommends setting this choice as an AKRI_HELM_CRICTL_CONFIGURATION environment variable and then adding the variable to each Akri installation like so: