Skip to content

Instantly share code, notes, and snippets.

@hash-d
Last active September 30, 2025 19:15
Show Gist options
  • Save hash-d/cc4928dac1b3f9c2646388a34296ebe5 to your computer and use it in GitHub Desktop.
Save hash-d/cc4928dac1b3f9c2646388a34296ebe5 to your computer and use it in GitHub Desktop.
Linux sites no reload

#80: skupper.v2.system / reload does not restart process on linux/systemd sites

skupperproject/skupper-ansible#80

This test creates a site and starts it, before adding a Listener and a Connector and reloading the site.

Next, it checks the consequence of the creation of the Listener: port 8082 should be opened.

It works fine for platforms podman and docker, but it fails for linux. And that's because the process is never restarted on systemd.

The playbook provides a way to see that, showing the timestamps of the skrouterd configuration file and of the process: on linux only, the file is more recent than the process.

If one manually stops and starts the systemd service on the target machine, however, the port gets opened.

Note that the test has listener and container on the same namespace with the same routingKey. The intention is simply to have the listener match so it opens the port.

To run the test:

ansible-playbook -i SOME_IP, ./main.yaml -e skupper_platform=linux -vv

Experiment with the differet platforms.

[defaults]
stdout_callback = yaml
---
- name: Test
hosts: all
gather_facts: no
tasks:
- name: Create site
skupper.v2.resource:
platform: "{{ skupper_platform }}"
namespace: asdf
def:
apiVersion: skupper.io/v2alpha1
kind: Site
metadata:
name: asdf
# spec:
- name: Start the site
skupper.v2.system:
action: start
namespace: asdf
platform: "{{ skupper_platform }}"
- name: Create a Listener
skupper.v2.resource:
platform: "{{ skupper_platform }}"
namespace: asdf
state: latest
def:
apiVersion: skupper.io/v2alpha1
kind: Listener
metadata:
name: asdf-listener
namespace: asdf
spec:
routingKey: asdf
port: 9191
host: localhost
- name: Create a Connector
skupper.v2.resource:
platform: "{{ skupper_platform }}"
namespace: asdf
state: latest
def:
apiVersion: skupper.io/v2alpha1
kind: Connector
metadata:
name: asdf-connector
namespace: asdf
spec:
routingKey: asdf
port: 9192
host: localhost
- name: Reload the site
skupper.v2.system:
action: reload
namespace: asdf
platform: "{{ skupper_platform }}"
- name: Check status
ansible.builtin.shell:
cmd: "{{ item }}"
loop:
- ps -C skrouterd -o pid,lstart,cmd
- stat ~/.local/share/skupper/namespaces/*/runtime/router/skrouterd.json
failed_when: false
register: commands
- name: Compare output - file timestamp vs process start time
ansible.builtin.debug:
var: commands.results | community.general.json_query('[].stdout')
- name: Wait for 9191 to be opened
ansible.builtin.wait_for:
port: 9191
state: started
timeout: 60
when: wait | default (true) | bool
- name: Pause
ansible.builtin.pause:
- name: Teardown
skupper.v2.system:
namespace: asdf
platform: "{{ skupper_platform }}"
action: stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment