Este conteúdo não está disponível no idioma selecionado.

Chapter 9. Exposing services on the application network using the CLI


After creating an application network by linking sites, you can expose services from one site using connectors and consume those services on other sites using listeners. A routing key is a string that matches one or more connectors with one or more listeners. For example, if you create a connector with the routing key backend, you need to create a listener with the routing key backend to consume that service.

This section assumes you have created and linked at least two sites.

9.1. Creating a connector using the CLI

A connector binds a local workload to listeners in remote sites. Listeners and connectors are matched using routing keys.

For more information about connectors, see Connector concept.

Procedure

  1. Create a workload that you want to expose on the network, for example:

    kubectl create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3
    Copy to Clipboard Toggle word wrap
  2. Create a connector:

    skupper connector create <name> <port> [--routing-key <name>]
    Copy to Clipboard Toggle word wrap

    For example:

    skupper connector create backend 8080 --workload deployment/backend
    Copy to Clipboard Toggle word wrap
  3. Check the connector status:

    skupper connector status
    Copy to Clipboard Toggle word wrap

    For example:

    $ skupper connector status
    NAME    STATUS  ROUTING-KEY     SELECTOR        HOST    PORT    HAS MATCHING LISTENER    MESSAGE
    backend Pending backend         app=backend             8080    false   No matching listeners
    Copy to Clipboard Toggle word wrap

    📌 NOTE By default, the routing key name is set to the name of the connector. If you want to use a custom routing key, set the --routing-key to your custom name.

There are many options to consider when creating connectors using the CLI, see CLI Reference, including frequently used options.

Additional information

If you need to expose a service from another namespace, you must use YAML as described in Creating a connector for a different namespace using YAML.

9.2. Creating a listener using the CLI

A listener binds a local connection endpoint to connectors in remote sites. Listeners and connectors are matched using routing keys.

For more information about listeners. see Listener concept.

Procedure

  1. Identify a connector that you want to use. Note the routing key of that connector.
  2. Create a listener:

    skupper listener create <name> <port> [--routing-key <name>]
    Copy to Clipboard Toggle word wrap

    For example:

    $ skupper listener create backend 8080
    Waiting for create to complete...
    Listener "backend" is ready
    Copy to Clipboard Toggle word wrap
  3. Check the listener status:

    skupper listener status
    Copy to Clipboard Toggle word wrap

    For example:

    $ skupper listener status
    NAME    STATUS  ROUTING-KEY     HOST    PORT    MATCHING-CONNECTOR      MESSAGE
    backend Ready   backend         backend 8080    true                    OK
    Copy to Clipboard Toggle word wrap

    📌 NOTE There must be a MATCHING-CONNECTOR for the service to operate. By default, the routing key name is the listener name. If you want to use a custom routing key, set the --routing-key to your custom name.

There are many options to consider when creating connectors using the CLI, see CLI Reference, including frequently used options.

Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat