Skip to main content

Prepare your Kubernetes Cluster

Some components of an Edge Compute Network ('ECN') can be deployed on Kubernetes. These component include Controllers. potctl will also install ioFog Operator to assist in the Kubernetes deployed Control Plane. Resources for routing will also be deployed.

The ioFog platform can be installed easily on a managed Kubernetes Cluster provided by e.g. AWS, GCP, or Azure. Minikube is supported as well.

Using lightweight Kubernetes implementations such as MicroK8s or K3s are not fully supported. They will likely fail because those platforms do not assign host or IP addresses to Load Balancer services.

Kube Config

If we are familiar with kubectl, we will know that it relies on a configuration file typically found in ~/.kube/config which contains credentials for it to connect to the Kubernetes API Server.

potctl similarly relies on this configuration file. We need to make sure it is present on the host that we intend to use potctl from. The file can be saved anywhere on the host but it is recommended to keep it in ~/.kube/config because all of this guide's examples assume it to be there.

RBAC

In order for potctl or Helm to do its thing with our Kubernetes cluster, we will have to make sure we have the right RBAC permissions.

The way we add these permissions will depend on our respective Kubernetes provider. Ultimately, we need the User Account associated with our ~/.kube/config configuration file to have at least the following permissions:

Resources                               Verbs
--------- -----
configmaps [*]
persistentvolumeclaims [*]
pods [*]
secrets [*]
serviceaccounts [*]
services [*]
deployments.apps [*]
rolebindings.rbac.authorization.k8s.io [*]
roles.rbac.authorization.k8s.io [*]
apps.iofog.org [list get watch]
controlplanes.iofog.org [list get watch]

If in doubt, we can use the default cluster role cluster-admin.

Using Google Kubernetes Engine

When using GKE to host our Kubernetes cluster, we need to ensure the gcloud CLI tool is installed. Once installed, we can connect to our cluster and get the requisite ~/.kube/config file by running:

gcloud container clusters get-credentials <NAME> --region <REGION>