Spin Up Virtual Kubernetes cluster with Openfaas in 90 Seconds

Scenario:

Let’s create a Virtual Kubernetes cluster with Openfaas installed in it in just 90 Seconds with Klusternetes(KNTS)

Introduction :

Openfaas:

OpenFaaS® makes it easy for developers to deploy event-driven functions and microservices to Kubernetes without repetitive, boilerplate coding. Package your code or an existing binary in a Docker image to get a highly scalable endpoint with auto-scaling and metrics.

Klusternetes:

Klusternetes is a platform that allows you to create a Kubernetes cluster in a few seconds. It also provides some of the leading DevOps tools as add-ons while creating your Cluster and provides a Service URL for add-ons that have UI.

Steps:

Login to the klusternetes App. If you don’t have an account in the Klusternetes app check here to create one

Click on “Add cluster” in the top right corner which will lead you to a cluster creation page. Fill in the necessary fields and select a medium cluster and click next.

It will lead you to the Features page, go to the Architecture section and select OpenFaaS. Here comes the best feature of Klusternetes, we can edit the configuration of the add-ons. So, now click on “Edit configuration”

Here you can edit a few configurations of the OpenFaas application. or if you want to edit more configuration you can click on Edit YAML at the top and can edit the field which you want.

After editing the config as you want click on the “Save configuration” button and then click on the “Submit” Button.

That’s it, you created a Klusternetes cluster with OpenFaas installed in it. Now you can download the kubeconfig of the cluster by clicking on the download button. It will show you the command’s to download.

You can get the download option even on your cluster list page. Click on “Done”. Now you will be on the main page of your account. Here is the list of clusters that you created and information about your cluster. You can even see the “Service URL”.

Click on the “+” icon near your cluster, you can see two columns one is for an overview of the cluster and the other is for Add-on. you can get the Service URL in Add ons column.

You can get the username and password of OpenFaas from the secret that’s been created in your cluster.

Activate the cluster with those 3 commands from the download button. Now run this command to get secret

 kubectl get secret basic-auth -o yaml

Now run the following commands to get the password and the username

kubectl get secret basic-auth -o jsonpath="{.data.basic-auth-password}" | base64 -d; echo

kubectl get secret basic-auth -o jsonpath="{.data.basic-auth-user}" | base64 -d; echo

Now you can log in to the OpenFaaS application with those credentials

Summary:

So, that’s how you can spin up the OpenFaaS cluster within 90 Seconds. Klusternetes also provide a lot of add-ons and is easy to understand.