initial debug dump implementation for nonkube#2174
initial debug dump implementation for nonkube#2174lynnemorrison wants to merge 3 commits intoskupperproject:mainfrom
Conversation
66632d1 to
e0954aa
Compare
e0954aa to
5104df8
Compare
|
|
||
| out, err := cli.ContainerExec(rtrContainerName, strings.Split("skstat -c", " ")) | ||
| if err == nil { | ||
| fmt.Println("containerexec: ", err, out) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
add skstat for linix sites
| utils.WriteTar(rpath+"Container-"+container.Name+".yaml", []byte(encodedOutput), time.Now(), tw) | ||
| } | ||
|
|
||
| logs, err = cli.ContainerLogs(ctlContainerName) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
added logs for linux sites
0580fd2 to
6867960
Compare
| localRouterAddress, err := runtime.GetLocalRouterAddress(cmd.namespace) | ||
| utils.WriteTar(path+"logs/"+rtrName+".txt", pv, time.Now(), tw) | ||
| } | ||
| pv, err = utils.RunCommand("skrouterd", "/bin/skstat", "-c") |
There was a problem hiding this comment.
Should this one be skrouterd -v ?
There was a problem hiding this comment.
It was accidently left in. I was just testing before I had the loop below working.
7f0b822 to
9a9616a
Compare
|
@lynnemorrison could you rebase and update this PR? |
9a9616a to
51606cf
Compare
|
@fgiorgetti merged with latest code |
Initial implementation of debug dump command for nonkube.
Missing skstat commands for skupper-router containers.