Akri
v0.13
v0.13
  • Home
  • Using Akri
    • Getting Started
    • Kubernetes Cluster Setup
    • Customizing an Akri Installation
    • Requesting Akri Resources
    • Monitoring with Prometheus
  • Discovery Handlers
    • ONVIF for IP Cameras
    • OPC UA
    • udev
  • Demos
    • Discovering and Using USB Cameras
    • Discovering and Using USB Cameras on Raspberry Pi 4
    • Discovering and Using OPC UA Thermometers
    • Discovering and Using Authentication-Enabled Onvif Cameras
    • Introduction and Demo Videos
  • Architecture
    • Overview
    • Resource Sharing
    • Controller
    • Agent
    • Configuration-Level Resources
  • Developing for Akri
    • Developer Guide
    • Building Containers
    • Custom Discovery Handlers
    • Custom Brokers
    • Mock Discovery Handler for Testing
    • Walkthrough of Implementing a Custom Discovery Handler and Broker
    • End to End Test Workflow
  • Community
    • Roadmap
    • Contributing
Powered by GitBook
On this page

Was this helpful?

  1. Using Akri

Kubernetes Cluster Setup

PreviousGetting StartedNextCustomizing an Akri Installation

Last updated 5 months ago

Was this helpful?

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

  1. Reference for instructions on how to install Kubernetes. See Akri's to see what versions of Kubernetes Akri has been tested on.

  2. Install Helm for deploying Akri.

     sudo apt install -y curl
     curl -L https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

Note: To enable workloads on a single-node cluster, remove the master taint.

kubectl taint nodes --all node-role.kubernetes.io/master-
  1. Install . The following will install the latest K3s version. Reference Akri's to see what versions of K3s Akri has been tested on.

       curl -sfL https://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 -

  2. Grant admin privilege to access kube config.

     sudo addgroup k3s-admin
     sudo adduser $USER k3s-admin
     sudo usermod -a -G k3s-admin $USER
     sudo chgrp k3s-admin /etc/rancher/k3s/k3s.yaml
     sudo chmod g+r /etc/rancher/k3s/k3s.yaml
     su - $USER
  3. Check K3s status.

     kubectl get node
  4. Install Helm.

     export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
     sudo apt install -y curl
     curl -L https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
  5. If desired, add nodes to your cluster by running the K3s installation script with the K3S_URL and K3S_TOKEN environment variables. See for more details.

  1.  snap install microk8s --classic
  2. Grant admin privilege for running MicroK8s commands.

     sudo usermod -a -G microk8s $USER
     sudo chown -f -R $USER ~/.kube
     su - $USER
  3. Check MicroK8s status.

     microk8s status --wait-ready
  4. Enable CoreDNS, Helm and RBAC for MicroK8s.

     microk8s enable dns helm3 rbac
  5. 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'
  6. 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:

     echo "--allow-privileged=true" >> /var/snap/microk8s/current/args/kube-apiserver
     microk8s.stop
     microk8s.start

Install . The following will install the latest MicroK8s version. Add --channel=$VERSION/stable to specify as specific Kubernetes version. Reference Akri's to see what versions of MicroK8s Akri has been tested on.

If desired, reference to add additional nodes to the cluster.

Kubernetes documentation
release notes
K3s
release notes
K3s installation documentation
MicroK8s
release notes
MicroK8's documentation