Getting started Community Training Tutorials Documentation APIs, AI & Tools
spec.deployment.metadata.labels
For Managed Omni Gateway on Runtime Fabric, you can add custom labels to the gateway’s Kubernetes resources and control which nodes run the gateway pods. Define these customizations in a Runtime Fabric KubernetesTemplate custom resource (kubernetestemplates.rtf.mulesoft.com).
Name the KubernetesTemplate resource managed-flex-gateway. You can define the template in either of these namespaces:
Gateway namespace
The template applies to all Managed Omni Gateways deployed to the namespace.
Runtime Fabric agent namespace (usually rtf)
The template applies to all Managed Omni Gateways that the Runtime Fabric agent manages.
To customize Mule app resources instead, see Customizing Mule App Kubernetes Resources.
Managed Omni Gateway uses only these fields of the KubernetesTemplate resource:
| Field | Description | Minimum Omni Gateway Version |
|---|---|---|
|
Custom labels. Omni Gateway applies these labels to the gateway deployment, its pods, its service, its registration secret, its Omni Gateway ignores the |
1.15.0 |
|
Node selector for the gateway pods. |
1.14.0 |
|
Tolerations for the gateway pods. |
1.14.0 |
|
Affinity rules for the gateway pods. |
1.14.0 |
A node selector, tolerations, or affinity rules that you define in the template replace the corresponding Helm chart setting of the gateway. Omni Gateway doesn’t merge the two.
Omni Gateway ignores other KubernetesTemplate fields, such as annotations, pod and service labels, and security context settings.
Make sure that you have:
A Managed Omni Gateway deployed to Runtime Fabric. See Deploy a Managed Omni Gateway.
Permission to create KubernetesTemplate resources in the Runtime Fabric cluster.
Create a YAML file with your KubernetesTemplate configuration, for example:
apiVersion: rtf.mulesoft.com/v1
kind: KubernetesTemplate
metadata:
name: managed-flex-gateway
namespace: rtf
spec:
deployment:
metadata:
labels:
team: payments
cost-center: "1234"
pod:
nodeSelector:
node-role: gateway
tolerations:
- key: dedicated
operator: Equal
value: gateway
effect: NoSchedule
Apply the resource:
Kubernetes
OpenShift
kubectl apply -f <template-file>.yaml
oc apply -f <template-file>.yaml
Redeploy the gateway in Runtime Manager to apply the template.
Omni Gateway applies the template, and any later changes to it, only when the gateway is deployed or redeployed.
Verify that the gateway deployment and pods have your labels:
Kubernetes
OpenShift
kubectl get deployments,pods -n <omni-gateway-namespace> --show-labels
oc get deployments,pods -n <omni-gateway-namespace> --show-labels