Chapter 7. Using Skupper Podman


Using the skupper command-line interface (CLI) allows you to create and manage Skupper sites from the context of the current Linux user. Skupper Podman allows you to create a site using containers, without requiring Kubernetes.

A typical workflow is to create a site, link sites together, and expose services to the service network.

7.1. About Skupper Podman

Skupper Podman is available with the following precedence:

skupper --platform podman <command>
Use this option to avoid changing mode, for example, if you are working on Kubernetes and Podman simultaneously.
export SKUPPER_PLATFORM=podman

Use this command to use Skupper Podman for the current session, for example, if you have two terminals set to different contexts. To set the environment to target Kubernetes sites:

$ export SKUPPER_PLATFORM=kubernetes
skupper switch podman
If you enter this command, all subsequent command target Podman rather than Kubernetes for all terminal sessions.

To determine which mode is currently active:

$ skupper switch

podman

To switch back to target Kubernetes sites: skupper switch kubernetes

Note

Services exposed on remote sites are not automatically available to Podman sites. This is the equivalent to Kubernetes sites created using skupper init --enable-service-sync false.

To consume an exposed service on a Podman site, check that it exists using skupper service status on the original site and use that information to create the service on the Podman site:

$ skupper service create <name> <port>

7.2. Creating a site using Skupper podman

A service network consists of Skupper sites. This section describes how to create a site in on a Linux host using the default settings. See Using the Skupper CLI for information about using the Skupper CLI to create Podman sites.

Prerequisites

  • The latest skupper CLI is installed.
  • Podman is installed, see https://podman.io/
  • netavark is configured as the podman network backend.

    By default, Podman v4 uses Netavark which works with Skupper.

    If you are using CNI, for example, if you upgrade from Podman v3, you must also install the podman-plugins package. For example, dnf install podman-plugins for RPM based distributions.

    Note

    CNI will be deprecated in the future in preference of Netavark.

    To check if netavark is configured as the podman network backend:

    $ podman info | grep networkBackend

    To install netavark on rpm based Linux, eg RHEL8:

    $ sudo dnf install netavark

    Configure podman to use netavark by making sure the following lines exist in the /etc/containers/containers.conf file:

    [network]
    network_backend = "netavark"
  • Podman service endpoint.

    Use systemctl status podman.socket to make sure the Podman API Socket is running.

    Use systemctl --user enable --now podman.socket to start the Podman API Socket.

    See Podman socket activation for information about enabling this endpoint.

Procedure

  1. Set your session to use Skupper Podman:

    $ export SKUPPER_PLATFORM=podman

    To verify the skupper mode:

    $ skupper switch
    
    podman
  2. Create a Skupper site:

    Use the following command to create a site where tokens are created to link on any network interface:

    $ skupper init
    Note

    By default, this command times out after 2 minutes for podman sites. You can increase the time with the --timeout option.

    The following output is displayed:

    It is recommended to enable lingering for <username>, otherwise Skupper may not start on boot.
    Skupper is now installed for user '<username>'.  Use 'skupper status' to get more information.

    Use the following command to start the site service at system start and persist over logouts:

    # loginctl enable-linger <username>

    By default, skupper init tries to include all IP addresses associated with local network interfaces as valid ingress hosts. You can use --ingress-host <IP/Hostname> to restrict token ingress to a specific network context:

    $ skupper init --ingress-host my-cloud-vm.example.com

    If you do not require that other sites can link to the site you are creating:

    $ skupper init --ingress none

    In this guide we assume you have enabled ingress using the first command. This allows you create tokens that allow links from every network interface on the host.

    Note

    When creating a token you can specify the ingress host.

    You can also restrict ingress to an IP address or hostname when initializing as described in the Skupper Podman CLI reference documentation.

  3. Check the status of your site:

    $ skupper status
    Skupper is enabled for "<username>" with site name "<machine-name>-<username>" in interior mode. It is not connected to any other sites. It has no exposed services.
    Note

    You can only create one site per user. If you require a host to support many sites, create a user for each site.

7.3. Linking sites using Skupper Podman

A service network consists of Skupper sites. This section describes how to link sites to form a service network.

Linking two sites requires a single initial directional connection. However:

  • Communication between the two sites is bidirectional, only the initial linking is directional.
  • The choice of direction for linking is typically determined by accessibility. For example, if you are linking a virtual machine running in the cloud with a Linux host running behind a firewall, you must link from the Linux host to the cloud virtual machine because that route is accessible.

Procedure

  1. Generate a token on one site:

    $ skupper token create <filename>

    If you created the site without specifying an ingress-host, the token is valid for all network contexts. You can use --ingress-host <IP/Hostname> to restrict token ingress to a specific network context:

    $ skupper token create <filename> --ingress-host <IP/Hostname>
  2. Create a link from the other site:

    $ skupper link create <filename>

After you have linked to a network, you can check the link status:

$ skupper link status
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.