Blog Post

Azure Integration Services Blog
9 MIN READ

Hybrid Logic Apps on RKE2: a self-managed cluster with MetalLB

anandgmenon's avatar
anandgmenon
Icon for Microsoft rankMicrosoft
Jul 22, 2026

Azure Logic Apps Hybrid lets you run the Logic Apps runtime on your own Kubernetes cluster and still author, deploy, and monitor from Azure. The previous post walked through Red Hat OpenShift. This one is RKE2. We spun up a single-node RKE2 cluster, gave the ingress an IP with MetalLB, connected it to Arc, and shipped a Hybrid Logic App end-to-end. A handful of things needed care along the way, and those are what this post is really about.

If you've done Hybrid on AKS or K3s, the shape will look familiar. The official requirements doc covers the general flow. RKE2 is close enough to vanilla Kubernetes that most of it just works out of the box. Four things don't. Three of them are DNS. They're called out at the step they matter.

What makes RKE2 different?

AreaWhat we found
Ingress IPRKE2 has an embedded cloud-controller-manager for node lifecycle, but no service load balancer. type: LoadBalancer sits at <pending> until you bring one. We used MetalLB (Step 2).
Pod securityNo SCC dance like OpenShift; the extension pods schedule as-is. What we did hit was the node's inotify limit. Enough runtime pods use it that the default runs out and about half the deployment crash-loops (Step 4).
CoreDNSRKE2 names its DNS objects rke2-coredns-rke2-coredns, not coredns/kube-dns. az containerapp arc setup-core-dns doesn't have an RKE2 distro flag yet, so DNS is manual (Step 7).
Distribution flagRKE2 is upstream Kubernetes. Don't copy the OpenShift install command; the Azure.Cluster.Distribution=openshift and coreDNSVersion overrides don't apply here and will bite you (Step 4).

Prerequisites

A Linux hostAnywhere RKE2 runs: bare metal, a VM, an edge appliance. We used a single Ubuntu 22.04 Azure VM (Standard_D8as_v5) so everything was easy to nuke afterwards. 4 vCPU / 16 GB is the practical floor.
Azure subscriptionRights to create Arc resources, custom locations, and connected environments.
Azure CLILatest, with the connectedk8s, k8s-extension, customlocation, and containerapp extensions.
An SMB file shareReachable from the cluster, for workflow artifacts.
A spare IP rangeA small unused range on your node's L2 network for MetalLB to hand out (Step 2).
az extension add --name connectedk8s
az extension add --name k8s-extension
az extension add --name customlocation
az extension add --name containerapp

Step 1: Stand up RKE2

One line and a couple of minutes:

curl -sfL https://get.rke2.io | sudo sh -
sudo systemctl enable --now rke2-server.service

# kubectl + kubeconfig are dropped in place
export PATH=$PATH:/var/lib/rancher/rke2/bin
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml
kubectl get nodes          # Ready in ~2-5 min after the first image pull

RKE2 servers are schedulable by default, so this single node is your entire cluster. No taint to remove. If you want to run kubectl from your laptop, add the node's public IP or hostname to tls-san in /etc/rancher/rke2/config.yaml before the first start, then copy rke2.yaml out and swap 127.0.0.1 for that address.

Quick sanity check. Expose a throwaway nginx as LoadBalancer: kubectl create deploy nginx --image=nginx && kubectl expose deploy nginx --port=80 --type=LoadBalancer. The EXTERNAL-IP will sit at <pending> forever. That's the gap MetalLB fills in the next step. Clean up the deployment and service when you're done looking.

Step 2: Give the ingress an IP with MetalLB

All the Logic Apps in this environment share a single Envoy ingress, and something has to give that service an IP. A cloud does it for you; on-prem, you pick one of two options:

  • In-cluster load balancer. MetalLB (or Cilium, kube-vip, OpenELB) assigns an IP from a pool on your node network. Leave envoy.serviceType=LoadBalancer in Step 4. This is what we did.
  • External L4 load balancer in front of NodePort. If you already run an F5, HAProxy, NetScaler, or an Azure Standard Load Balancer, keep using it. Set envoy.serviceType=NodePort (plus envoy.nodeHttpsPort / envoy.nodeHttpPort) and point your LB at those NodePorts. Then pass the LB's VIP as --static-ip in Step 6.

We went with MetalLB in L2 mode:

kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.9/config/manifests/metallb-native.yaml
kubectl wait --for=condition=Ready pods --all -n metallb-system --timeout=180s

Then give it a pool from your node subnet and advertise it over L2:

apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: hybrid-pool
  namespace: metallb-system
spec:
  addresses:
    - 192.168.1.240-192.168.1.250   # a spare range on your node network
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
  name: hybrid-l2
  namespace: metallb-system
spec:
  ipAddressPools:
    - hybrid-pool

Two things to watch. The range should be free on your node subnet, and it must not collide with RKE2's cluster (10.42.0.0/16) or service (10.43.0.0/16) CIDRs. Re-run the throwaway LoadBalancer test from Step 1; the EXTERNAL-IP should now be one of your pool addresses.

Running MetalLB on one cloud VM? L2 mode ARPs the pool IPs on the node's network, but a cloud SDN won't route an unassigned IP to your NIC from the outside. It works fine for anything inside the cluster (kube-proxy programs the IP locally), but to hit envoy from outside the VM you'll need to socat-forward the VM's public IP to the LB IP, or add the pool IP as a secondary ipconfig on the NIC. On real on-prem L2 you don't have to think about any of this.

Step 3: Connect the cluster to Azure Arc

az connectedk8s connect --name <cluster> --resource-group <rg> --location <region>
kubectl get pods -n azure-arc      # all agents Running in a couple of minutes

If your host is behind a strict egress policy, or in our case an internal MS VM with an inbound-deny NRMS policy, remember that Arc onboarding only needs outbound connectivity and a local kubeconfig. We ran the connect command on the VM itself using a system-assigned managed identity (az login --identity). No inbound port, no browser device-code prompt.

Step 4: Install the Container Apps extension

This is the extension that turns the cluster into a Logic Apps host. On RKE2 it's the plain command, with no Azure.Cluster.Distribution or coreDNSVersion overrides. If you copy those from an OpenShift guide, the install will still succeed and then behave in mildly confusing ways.

az k8s-extension create \
  --resource-group <rg> --cluster-name <cluster> \
  --cluster-type connectedClusters --name logicapps-aca-extension \
  --extension-type Microsoft.App.Environment \
  --release-train stable --auto-upgrade-minor-version true --scope cluster \
  --release-namespace logicapps-aca-ns \
  --configuration-settings "Microsoft.CustomLocation.ServiceAccount=default" \
  --configuration-settings "appsNamespace=logicapps-aca-ns" \
  --configuration-settings "clusterName=<env-name>" \
  --configuration-settings "keda.enabled=true" \
  --configuration-settings "keda.logicAppsScaler.enabled=true" \
  --configuration-settings "keda.logicAppsScaler.replicaCount=1" \
  --configuration-settings "containerAppController.api.functionsServerEnabled=true" \
  --configuration-settings "functionsProxyApiConfig.enabled=true" \
  --configuration-settings "envoy.serviceType=LoadBalancer"

Our first install came back "Succeeded", but half the pods were in CrashLoopBackOff. billing, containerapp-controller, keda-logicapps-scaler, mdm, and log-processor all had the same line in their logs:

The configured user limit (128) on the number of inotify instances has been reached

These are .NET services with FileSystemWatcher under the hood. The default fs.inotify.max_user_instances=128 on stock Ubuntu is comfortably below what the extension needs. Raise it on the node, delete the pods, done:

sudo sysctl -w fs.inotify.max_user_instances=8192
sudo sysctl -w fs.inotify.max_user_watches=1048576
echo -e "fs.inotify.max_user_instances=8192\nfs.inotify.max_user_watches=1048576" | sudo tee /etc/sysctl.d/99-inotify.conf
kubectl delete pods --all -n logicapps-aca-ns

After that everything came up green, and envoy grabbed a MetalLB address on its own. Confirm:

az k8s-extension show -g <rg> --cluster-name <cluster> \
  --cluster-type connectedClusters --name logicapps-aca-extension \
  --query provisioningState -o tsv          # -> Succeeded
kubectl get svc microsoft-app-environment-k8se-envoy -n logicapps-aca-ns   # EXTERNAL-IP from your pool

Step 5: Create a custom location

Turn on the custom-locations feature, then create the location that ties the cluster, extension, and namespace together:

az connectedk8s enable-features -n <cluster> -g <rg> \
  --features cluster-connect custom-locations \
  --custom-locations-oid $(az ad sp show --id bc313c14-388c-4e7d-a58e-70017303ee3b --query id -o tsv)

EXT_ID=$(az k8s-extension show -g <rg> --cluster-name <cluster> \
  --cluster-type connectedClusters --name logicapps-aca-extension --query id -o tsv)
CC_ID=$(az connectedk8s show -g <rg> -n <cluster> --query id -o tsv)

az customlocation create \
  --resource-group <rg> --name <custom-location> \
  --location <region> --host-resource-id $CC_ID \
  --namespace logicapps-aca-ns --cluster-extension-ids $EXT_ID

One thing we tripped on: the extension type isn't offered in every Azure region. It's registered in eastus, westus, westeurope, and a handful of others, but not eastus2 at the time of writing. The connectedCluster resource's region is independent of where the node actually runs, so pick a supported one here.

Step 6: Create the connected environment

CL_ID=$(az customlocation show -g <rg> -n <custom-location> --query id -o tsv)

az containerapp connected-env create \
  --resource-group <rg> --name <env-name> \
  --location <region> --custom-location $CL_ID

Because MetalLB already put an EXTERNAL-IP on the envoy LoadBalancer service, the platform picks it up automatically. --static-ip is only needed if you went the NodePort + external LB route in Step 2, in which case you pass your LB's VIP here.

Step 7: Configure cluster DNS

App hostnames like *.<env>.<region>.k4apps.io need to resolve to the Envoy ingress from inside the cluster. On AKS or OpenShift, az containerapp arc setup-core-dns handles this. RKE2 isn't a supported distro on that command yet, so it's manual, but it's a small manual.

The extension already writes the correct rewrite and forward rules into a coredns-custom ConfigMap. What's missing is CoreDNS mounting that ConfigMap and importing it from the Corefile.

We tried the direct route first: patch the Corefile ConfigMap, edit the Deployment to add the volume, restart. It works, right up until the next rke2-server restart. RKE2's helm controller re-renders both objects from the chart and wipes your changes. The right way is a HelmChartConfig. The rke2-coredns chart exposes extraConfig (config outside the default zone block) and extraVolumes/extraVolumeMounts, which is exactly what we need:

# /var/lib/rancher/rke2/server/manifests/rke2-coredns-config.yaml
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: rke2-coredns
  namespace: kube-system
spec:
  valuesContent: |-
    extraConfig:
      import:
        parameters: /etc/coredns/custom/*.server
    extraVolumes:
      - name: custom-config-volume
        configMap:
          name: coredns-custom
          optional: true
    extraVolumeMounts:
      - name: custom-config-volume
        mountPath: /etc/coredns/custom

Drop the file in /var/lib/rancher/rke2/server/manifests/, or kubectl apply -f it (the helm controller watches both). Within a minute CoreDNS redeploys with the mount and the top-level import. This time it survives restarts and RKE2 upgrades because the chart is now the source of truth.

To verify, run nslookup test.<env-domain> from a throwaway pod. You should get back the microsoft-app-environment-k8se-envoy-internal ClusterIP.

One last DNS thing: a kube-dns alias. The Logic Apps platform locates cluster DNS by looking for a Service named kube-dns in kube-system. That's the convention on AKS, K3s, kubeadm, and most other distros. RKE2 uses rke2-coredns-rke2-coredns and doesn't ship the alias, so the platform can't find DNS. Symptom: revision calls come back as 502s. Fix: create the alias.

apiVersion: v1
kind: Service
metadata: { name: kube-dns, namespace: kube-system, labels: { k8s-app: kube-dns } }
spec:
  selector: { k8s-app: kube-dns }
  ports:
    - { name: dns, port: 53, protocol: UDP, targetPort: 53 }
    - { name: dns-tcp, port: 53, protocol: TCP, targetPort: 53 }

It's a plain Service. Nothing about it gets templated or overwritten, so it just stays put across reconciles and upgrades.

Step 8: Create and deploy a Logic App

Plumbing's out of the way. In the portal, create a new Logic App (Standard) with the Hybrid hosting option, point it at your connected environment, wire storage up to your SMB share, and create. Author the workflow the way you always would. The runs will execute on your RKE2 cluster instead of in Azure.

Troubleshooting: the RKE2 things we hit

SymptomCause & fix
Test LoadBalancer / envoy stays <pending>No LB provider on the cluster. Install MetalLB (Step 2). RKE2 ships no ServiceLB.
Runtime pods CrashLoopBackOff with inotify instances ... reachedNode fs.inotify.max_user_instances too low. Raise it to 8192 and restart the pods (Step 4).
Revision invoke returns 502Platform can't find a kube-dns Service; RKE2's CoreDNS is under a different name. Add the alias (Step 7).
App hostnames don't resolve inside the clusterCoreDNS isn't loading coredns-custom. Apply the HelmChartConfig (Step 7).
Extension type "not registered in region"The Arc cluster is in an unsupported region. Reconnect it in a supported one; it's independent of where the node runs (Step 5).
Cluster shows Arc Offline after a reboot; azure-arc pods UnknownStale pods from an ungraceful stop. kubectl delete pods --all -n azure-arc --force and they'll recreate and reconnect.

References

Updated Jul 22, 2026
Version 2.0
No CommentsBe the first to comment