Chapter 9. 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.
9.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
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>
9.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.NoteCNI 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 --user status podman.socket
to make sure the Podman API Socket is running.If the socket isn’t running, use
systemctl --user enable --now podman.socket
to start it.See Podman socket activation for information about enabling this endpoint.
Procedure
Set your session to use Skupper Podman:
$ export SKUPPER_PLATFORM=podman
To verify the
skupper
mode:$ skupper switch podman
Create a Skupper site:
Use the following command to create a site where tokens are created to link on any network interface:
$ skupper init
NoteBy 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.
NoteWhen 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.
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.
NoteYou can only create one site per user. If you require a host to support many sites, create a user for each site.
9.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
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>
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