Teams in Fabric8

One of the first things you will probably do when starting to work with Fabric8 is the creation of a Team:

A team is a collection of people working together on one or more microservices.

A team has a number of environments such as Dev, Test, Staging, Production. Each team can decide whatever environments it requires. A team always has a Development environment where the development tools run such as Jenkins, Nexus and the developer console.

A team contains a namespace which must contain a Jenkins, Nexus and Gogs implementation in order to use the full benefits of Fabric8. However when you create a new team from the web console, you will notice that not everything is generated correctly. In the version of Fabric8 I was working with some parts where missing. The key components such as Fabric8 itself where not deployed in my namespace. This prevented the installation of the “CD-pipeline” which contains the Jenkins, Nexus and Gogs pods. After some research I found out that the workaround can be done from the command line. With the help of “kubectl”, the cli of kubernetes you first have to create a new namespace.

kubectl create namespace <namespace>
kubectl config set-context 'kubectl config current-context' --namespace=<namespace>
gofabric8 deploy

After the above commands have completed you will see a new namespace in your Fabric8 console. Select the “Create Team” button. Select the option “Existing Namespace” and pick the namespace you just created. Finish the installation of the team and you are ready to go.

createteam

When running the “CD-pipeline” installation I also ran into the persistence claim issue mentioned in the my previous blogpost. In order to create the persistence volume claims you have to specify the namespace as well. Otherwise the claims won’t be created.

gofabric8 volumes --namespace=<namespace>

Getting started with Fabric8

Last week I started to look into Fabric8. The first step I took, was of course the installation of Fabric8. This post is a short walk-through of my installation and the problems that I faced. You have several options for installing fabric8, as can be seen here. For simplicity I chose to install it on my Linux laptop (link). The installation of Fabric8 is quiet simple, I chose to install it with the KVM driver. When you are using Fabric8 you can easily create a lot of small applications. I noticed that the performance was not optimal when starting it with the default settings so I used the following command:

gofabric8 start --cpus=4 --memory=8144

After running the “gofabric8 start” command you will be redirected to your browser:
cleanworkspace
The first thing I tried to do was to create an application. The first time you do this Fabric8 will ask you to setup a Gogs Secrect. Just select the default entry “default-gogs-git”. Next fabric8 will ask you to run a CD pipeline. In order to create a new application Fabric8 requires several applications to be running in your domain. This includes Jenkins, Gogs and Nexus.
At this stage I found out that the installation was not completely successful. The Gogs, Nexus and Jenkins pods did not start correctly. It appeared that the latest version of kubernetes is not yet working correctly in combination with Fabric8. In order to get all the pods up and running I had to downgrade my kubernetes.

First stop your fabric8 instance and delete your minikube instance.

gofabric8 stop
minikube delete
minikube start --vm-driver=kvm --memory=8144 --cpus=1 --disk-size=50g --kubernetes-version v1.4.5
gofabric8 start

After this you will see that the pods are trying to start. However in my case they wouldn’t start correctly. I got the error:

StorageClass "standard" not found

The persistence claim could not be made. The claim is either not made correctly or not made at all. The solution is simple, you have to run the following command:

gofabric8 volumes

This command will create the persistence claims. When you go back to the Fabric8 console you will see that the pods will start correctly.
allpodsupandrunning

When you try to create an application you will no longer run into any problems. Complete the installation of the CD Pipeline and you can create your first application.

After that you can create a new Application. Fabric8 provides a list of example projects. I of course choose the integration (Camel with spring-boot) project).

Note that the current version of fabric8 dictates that you have to specify a project name with all lower-case. If you do not do this the project will only be partially created.

newproject

The next step is to select the pipeline you want to use. Default Fabric8 supplies several options, from a simple deploy to a complete Canary Release Stage and approval, which automatically creates a test, stage and production environment.

devopsoptions

Just select your choice and sit back and wait until everything is created. You will notice that a maven job is triggered. The code of your application will be added to Gogs. If you go to the Jenkins instance of your instance. You will see that the Jenkins job has been created as well. After a while the first pod will be created the first (test environment). And, in my case, eventually a staging environment is created as well.

projectrunningwithtwoenvironments

That is it, I have shown you how to install and create your first project in Fabric8. My first impression after the installation is that Fabric8 is not yet finished. The GUI feels a bit flaky, sometimes you have to hit the refresh button to see some data and not everything works out of the box. However, the options and potential that Fabric8 provides makes it an extreme interesting solution to run your applications. The out of the box provisioning, creation of environments, build-pipelines etc. look really promising.