Skip to content

Conversation

@lynnemorrison
Copy link
Collaborator

Initial implementation of debug dump command for nonkube.
Missing skstat commands for skupper-router containers.

@lynnemorrison lynnemorrison force-pushed the v2_nonkube_debug branch 2 times, most recently from 66632d1 to e0954aa Compare July 8, 2025 13:17
@lynnemorrison lynnemorrison self-assigned this Jul 8, 2025
@lynnemorrison
Copy link
Collaborator Author

@ajssmith @fgiorget when you get a chance can you take a look at what I have so far. Please let me know what other items you would like to see in the dump

@ajssmith ajssmith requested review from fgiorgetti and nluaces July 10, 2025 15:27

out, err := cli.ContainerExec(rtrContainerName, strings.Split("skstat -c", " "))
if err == nil {
fmt.Println("containerexec: ", err, out)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work. As containers are connected to the host network, we are using a secure connection
to communicate with the router through a normal listener.

First you need to call runtime.GetLocalRouterAddress to determine the effective router address.

Then you can create a skStatCommand variable that includes:

localRouterAddress := runtime.GetLocalRouterAddress("my-namespace")
skStatCommand := []string{
  "-b", localRouterAddress,
  "--ssl-certificate", "/etc/skupper-router/runtime/certs/skupper-local-client/tls.crt",
  "--ssl-key", "/etc/skupper-router/runtime/certs/skupper-local-client/tls.key",
  "--ssl-trustfile", "/etc/skupper-router/runtime/certs/skupper-local-client/ca.crt"
}

Then you can use it as a prefix to all skstat commands you're going to run.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing. The skstat is not being executed on linux sites.
In that case, instead of executing inside of the container, you have to run the same command directly on the host machine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add skstat for linix sites

@lynnemorrison lynnemorrison requested a review from fgiorgetti July 22, 2025 12:27
utils.WriteTar(rpath+"Container-"+container.Name+".yaml", []byte(encodedOutput), time.Now(), tw)
}

logs, err = cli.ContainerLogs(ctlContainerName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If using the linux platform, we need to capture logs too.
In that case, you could run something like:

In rootful mode:

journalctl -u skupper-<namespace>.service --no-pager --all

In rootless mode:

journalctl --user -u skupper-<namespace>.service --no-pager --all

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added logs for linux sites

localRouterAddress, err := runtime.GetLocalRouterAddress(cmd.namespace)
utils.WriteTar(path+"logs/"+rtrName+".txt", pv, time.Now(), tw)
}
pv, err = utils.RunCommand("skrouterd", "/bin/skstat", "-c")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this one be skrouterd -v ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was accidently left in. I was just testing before I had the loop below working.

@lynnemorrison lynnemorrison force-pushed the v2_nonkube_debug branch 2 times, most recently from 7f0b822 to 9a9616a Compare August 19, 2025 12:45
@lynnemorrison lynnemorrison requested a review from c-kruse as a code owner August 19, 2025 12:45
@fgiorgetti fgiorgetti added cli Issues associated with the CLI v2 issue for v2 Skupper version labels Aug 21, 2025
@fgiorgetti
Copy link
Member

@lynnemorrison could you rebase and update this PR?
I will review it again, once done.

@lynnemorrison
Copy link
Collaborator Author

@fgiorgetti merged with latest code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Issues associated with the CLI v2 issue for v2 Skupper version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants