Here you will learn how to add a Spring Cloud Gateway for Kubernetes as a component of your Organization Catalog.
There are two primary scenarios:
To add the Gateway instance to a running component, you must first add the labels as shown in the example below.
apiVersion: "tanzu.vmware.com/v1"
kind: SpringCloudGateway
metadata:
name: animal-rescue-gateway
namespace: animal-rescue
labels:
app.kubernetes.io/part-of={PART_OF}
Take care to match the PART_OF
to the name of the label app.kubernetes.io/part-of
in your component.
Once applied, the gateway pods will be visible in the list of resources.
If you want to present the Gateway as an independent component, you still need to add the labels seen before. But matching part-of
value with the one used in your component, as seen below.
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: my-gateway
description: My application gateway
annotations:
'backstage.io/kubernetes-label-selector': 'app.kubernetes.io/part-of={PART_OF}'
spec:
type: service
lifecycle: experimental
owner: default-team
Then, click Registry Entity at the top of the Catalog view and provide a IRL that points to the component descriptor file.
This will make the new component visible in the Catalog view.