Create Ingress Resource In Humanitec For Civo

Markus Stahl
4 min readAug 21, 2023

In another blog post, we had a look at how to connect a Kubernetes cluster provided by Civo to Humanitec. Now, instead of running for example Camunda 7 on Humanitec’s demo cluster, you could provision it on Civo. When you do so, you will soon find out, that Camunda 7 is starting — but you cannot access the URL. Something is wrong with the ingress.

Reason is that Humanitec provides default resources that are automatically used when deploying an application. The default resources are very common ones and work perfectly for the demo cluster. Now, Civo uses a different ingress that does not match the default ingress of Humanitec. Civo uses Traefik. In order to deploy civo-compatible ingress along with an application we

  1. Must create a ingress resource definition
  2. Configure the ingress resource definition being pulled whenever deploying to Civo

Create Custom Resource for Civo Ingress

Resources are manage at Resource Management in Humanitec. Click on Add resource definition and choose Ingress. When choosing drivers, choose ingress again.

When prompted for the configuration, only provide a name. Leave all remaining fields empty:

Match Civo Ingress with Civo Cluster

Matching a resource definition with an application might be a bit counter intuitive from a developer perspective. It certainly was for me. You do not configure Civo Ingress inside your application. On the contrary, you configure inside the resource definition a so called matching criteria. The matching criteria defines which applications can get access to this resource.

Click on your new ingress for Civo and choose the tab Matching criteria. Click on Add new criteria.

Since we want our new ingress being available to all applications that deploy to Civo environment we choose as criteria Environment type and the name of our civo environment (for instance civo-production)

If you do not remember the name of your Civo environment, you can check it out Environment Types menu on the left.

If you have deployed your application already to Civo without having the new ingress resource definition configured, your applicaiton is automatically matched with Default-Ingress by Humanitec. In that case, checkout the Default-Ingress resource definition and choose Usage tab. If your applicaiton is listed their with Civo-environment, you must remove the usage.

That’s it! If you redeploy your application to your Civo cluster, Humanitec will look for a matching ingress definition — an pick your civo ingress this time.

Why Matching Criteria?

If resource definition and matching criteria are counter intuitive, why do we need to use them, you may ask. That is because Humanitec can be used by lonesome developers that just want things to work. But a lonesome developer is not the typical use case. Humanitec is designed for teams of software engineers and devops engineers (aka platform engineers). Platform engineers define resource definitions for databases, persistent volumes, ingress etc. Developers on the other hand can choose from these tailored resources the right one for their application, without be concerned too much about where the resource is hosted, how it is secured, how exactly the authentication works and so on. Every engineer can work on their profession without standing in each others way.

As a lonesome developer, I learned to like this seperation of concerns, despite I play alone in my little playground. Because once the resource definitions are created, I only need to configure in my application that I want “an ingress” or “a postgress database” or “a persistent volume”. Which one is actually being used by my application is managed automatically by the matching criteria.

Summary

For provisioning an ingress resource at out Civo cluster, we simply need to create and empty ingress resource definition and set the matching criteria to the environment the uses Civo.

When we now deploy a workload that requires an ingress, the default ingress settings provided by Civo will be used.

--

--

Markus Stahl

Sustainable automation with open source technologies.