Adding external annotation to routes and ingresses
You can add external annotations and labels to routes and ingresses.
Using custom annotations
This approach is suitable when you manually define and manage the annotations in the CR. These annotations are carried over to the routes and ingresses managed by the API Connect operator.
The following example demonstrates the process of configuring external annotation using Management CR.
apiVersion: management.apiconnect.ibm.com/v1beta1
kind: ManagementCluster
metadata:
name: management
spec:
apiManagerEndpoint:
annotations:
cert-manager.io/issuer: ingress-issuer
my-custom-key: my-custom-value
hosts:
- name: manager.example.com
secretName: apim-endpoint
- You have a static set of annotations known in advance.
- You want the API Connect operator to consistently manage these annotations.
- You don’t expect these annotations to change dynamically.
Using pattern matching for external annotation
You can use this method when annotations or label patterns are generated and managed by an external process, and you want these to persist on the routes and ingresses without the API Connect operator removing them. This is especially useful when you are using a third-party load balancer which might add their own annotations.
By using the external annotation, you can preserve custom external annotations and labels when the key matches the regular expression. Usage of external annotation is supported during creation and update processes in OpenShift® Container Platform (OCP), Cloud Pak for Integration (CP4I), and Kubernetes (K8s).
The following example demonstrates the process of configuring external annotation using Management CR.
apiVersion: management.apiconnect.ibm.com/v1beta1
kind: ManagementCluster
metadata:
name: management
annotations:
apiconnect-operator/external-key-pattern: ".*myloadbalancerprovider.*"
spec:
- Annotations are dynamically generated and managed by an external process (for example, a load balancer controller).
- You need these annotations to persist without interference from the API Connect operator.