Run flotta on OpenShift

Flotta can run on top of any Kubernetes distributions, also, main usage in production is on top of OpenShift cluster.

To install OpenShift, the best way is to follow OpenShift Assisted installer.

Check OpenShift cluster status first:

$ -> oc status
In project default on server https://api.mycluster.redhat.com:6443

svc/openshift - kubernetes.default.svc.cluster.local
svc/kubernetes - 10.128.0.1:443 -> 6443

View details with 'oc describe <resource>/<name>' or list resources with 'oc get all'.

Flotta operator has a few tools that helps to install flotta, for that, let’s clone it:

git clone https://github.com/project-flotta/flotta-operator -b v0.1.0 --depth 1
cd flotta-operator

Now let’s install Flotta on the cluster:

make deploy IMG=quay.io/project-flotta/flotta-operator:v0.1.0 TARGET=ocp

A bunch of CRDs are now created, where the definitions can be found here:

$ -> oc  api-resources --api-group="management.project-flotta.io"
NAME                      SHORTNAMES   APIVERSION                              NAMESPACED   KIND
edgeconfigs                            management.project-flotta.io/v1alpha1   true         EdgeConfig
edgedevices                            management.project-flotta.io/v1alpha1   true         EdgeDevice
edgedevicesets                         management.project-flotta.io/v1alpha1   true         EdgeDeviceSet
edgedevicesignedrequest   edsr         management.project-flotta.io/v1alpha1   true         EdgeDeviceSignedRequest
edgeworkloads                          management.project-flotta.io/v1alpha1   true         EdgeWorkload
playbookexecutions                     management.project-flotta.io/v1alpha1   true         PlaybookExecution

At the same time, in the flotta namespace an operator should be running:

$ -> oc get pods -n flotta
NAME                                                  READY   STATUS    RESTARTS   AGE
flotta-operator-controller-manager-7f9587c999-rbwpg   2/2     Running   0          55s
$ ->

Flotta is now running and ready to register edgedevices. To register a edgedevice we need first to retrieve the install scripts using the Makefile target agent-install-scripts.

make agent-install-scripts

Now, two scripts are created:

  • hack/install-agent-dnf.sh: To install on normal Fedora installations
  • hack/install-agent-rpm-ostree.sh: To install on rpm-ostree devices.

On the device, with Fedora already installed, we need to execute the following:

$ sudo hack/install-agent-dnf.sh -i  192.168.128.101

Where 192.168.128.101 is your OpenShift Ingress IP.

After a while, if you list the devices in your cluster, you can see that the edgedevice is already registered:

$ -> kubectl get edgedevices
NAME        AGE
camera-ny   118s

From here, you should be able to deploy workloads to these devices. As explained here