In this topic, you will learn how to add a Spring Cloud Gateway for Kubernetes as a component of your Organization Catalog.

There are two primary scenarios:

  • Adding Spring Cloud Gateway to a running component
  • Adding Spring Cloud Gateway as a new component

Adding Spring Cloud Gateway to a component

To add the Gateway instance to a running component, you must first add the labels as shown in the following example.

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.

Your app screen shows the list of resources.

Adding Spring Cloud Gateway as a new component

To present the Gateway as an independent component:

  1. Add the labels described earlier, and you must match the part-of value with the one used in your component, as shown in the following example.

    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
    
  2. 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.

    In your organization catalog, you can register new components by providing the component IRL.
    Enter the URL in the Register an existing component screen.
check-circle-line exclamation-circle-line close-line
Scroll to top icon