Initial Setup of a Runtime Fabric Instance



Once we have completed the installation of our Runtime Fabric instance, and before we can deploy any apps there are some extra steps of configuration in your RTF that need to be done:
  • Associate Environments
  • Create Ingress Template for RTF
  • Deploy a test app to validate the whole setup
These steps are not particular to any K8s provider, they'll be for Runtime Fabric clusters installed on AKS, EKS, GKE, Openshift, etc. Let's see them in detail:


Associate Environments

In this step we make our Runtime Fabric instance available for our Anypoint environments. We can associate our RTF instance to one or multiple Business Groups and we can even select the specific environments on those Business Groups on which we want to make RTF available to deploy apps.

The best practice here is to have different RTF clusters for Production and Non-Production environments. That'll guarantee a minimum of isolation.

For that, from the home page of your RTF instance click on the Associated Environments tab and select the Business Groups first and the environments of that Business Group after.


Unless you associate your environment to this RTF instance you won't see this RTF available in the dropdown of available deployment targets.


Configure the Ingress Resource Template for RTF

Every time we deploy an application to our Runtime Fabric we need to create an Ingress for that app. That ingress contains the routing rules to be applied by the ingress controller of our K8s cluster. For example, if we deploy a hello-world app we need to create an ingress that routes the traffic to http://my-domain/hellow-world/my-endpoint to our app in the cluster.

We don't have to do this manually for each app we deploy. Fortunately, Runtime Fabric Services allows us to create a template that will be applied on each deployment.

On this tutorial we'll use a very simple ingress template, with a path-based rule to route the traffic to the hostname/app-name path.

There might be extra configurations to be added on this template, depending on the ingress controller we're using. Custom configurations are defined in the annotations section of the ingress manifest. In this tutorial we're using NGINX as ingress controller and we'll be using an annotation to make our rule work as expected (see below).

To create the ingress resource template:
  • Create a file called rtf-ingress.yaml and paste the following content:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^/app-name(/|$)(.*) /$2 break;
name: rtf-ingress-template
namespace: rtf
spec:
ingressClassName: rtf-nginx
rules:
- host: [EXTERNAL_DNS_NAME_OF_YOUR_INGRESS_CONTROLLER]
http:
paths:
- path: /app-name
pathType: ImplementationSpecific
backend:
service:
name: service
port:
number: 80
  • You'll have to replace [EXTERNAL_DNS_NAME_OF_YOUR_INGRESS_CONTROLLER] with the one of your installation
  • Then, create the ingress resource by running the following command:
kubectl apply -f rtf-ingress.yaml


Testing - Deploy an App

Finally, our RTF setup is complete, we only need to deploy a simple app to verify everything works.
  • Go to Runtime Manager > Applications and click on Deploy Application
  • Provide a name for your app and select our RTF cluster in the Deployment Target dropdown
  • Upload the jar file of a valid mule app. For testing purposes, you can choose to Import a Hello World app from Exchange (provided by MuleSoft)
  • Click on the Ingress tab and verify that the public point to be created is correct.
  • Click on Deploy Application and wait. Your app should be ready in a few seconds
  • Lastly test your app and verify you can hit successfully your endpoint(s)
Previous Post Next Post