-
Notifications
You must be signed in to change notification settings - Fork 86
initial debug dump implementation for nonkube #2174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
| utils.WriteTar(rpath+"Container-"+container.Name+".yaml", []byte(encodedOutput), time.Now(), tw) | ||
| } | ||
|
|
||
| logs, err = cli.ContainerLogs(ctlContainerName) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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.
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 ?
There was a problem hiding this comment.
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.
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.