Separate Linux and Windows node log collection - #165
Conversation
7b47dd9 to
8d46d12
Compare
sferich888
left a comment
There was a problem hiding this comment.
@davemulford can you review this too.
I think we could simplify this (reduce the number of scripts needed here), if we leverage the -l flag better.
| for service in ${NODE_SERVICES[@]}; do | ||
| echo "INFO: Collecting host service logs for $service" | ||
| /usr/bin/oc adm node-logs --role=$1 -u $service > ${DIR_PATH}/${service}_service.log & | ||
| /usr/bin/oc adm node-logs --role=$1 -l kubernetes.io/os=linux -u $service > ${DIR_PATH}/${service}_service.log & |
There was a problem hiding this comment.
Can we use one or more labels here?
There was a problem hiding this comment.
Yes a comma separated list can be used
| @@ -0,0 +1,22 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Instead of this; would it be better to just merge this into one bash script and select the things we want using labels?
There was a problem hiding this comment.
Most of the Linux log collection relies on the fact that the service logs being collected are from journald. This is not the case for Windows, and why I felt it made sense to seperate them
There was a problem hiding this comment.
We are missing container runtime, logs (docker), as well as kublet how do we get those added?
There was a problem hiding this comment.
I saw that we were only collecting Kubelet logs for master nodes for Linux, and as Windows nodes can only be workers, I removed the kubelet logs from the collected log list.
I can add it back if that would be desirable.
As for Docker logs, that actually is logged to a directory that isn't reachable by oc adm node-logs and changing that logging directory isn't currently within scope of the Windows Machine Config Operator.
There was a problem hiding this comment.
We want to collect everything required to debug what is happening on the node (service logs wise); as it pertains to OpenShift. So I think we want to collect at the very least the container runtime and the kublet process logs (thinks that are installed outside of OpenShift that are pre-requisites for OpenShift to run or be connected to the cluster). .
There was a problem hiding this comment.
@sferich888 collecting kubelet logs is doable. But as @sebsoto mentioned, collecting the Docker logs will be difficult. Please open an issue on our board so that we can track this.
There was a problem hiding this comment.
I've added the kubelet log.
The issue with the Docker logs is that the logging location for that is not under our control. Our product asks that our users bring their own Windows VM image, with docker pre-installed. We'd either have to increase the customer requirements, or investigate reconfiguring Docker.
| PIDS+=($!) | ||
|
|
||
| oc adm node-logs --role="worker" -u crio | \ | ||
| oc adm node-logs --role="worker" -l kubernetes.io/os=linux -u crio | \ |
There was a problem hiding this comment.
I don't think we want this here, as we want to get logs in this situation from any place where OVN is installed, not just on linux.
There was a problem hiding this comment.
For OVN onn Windows, there is a Windows service named hybrid-overlay.exe instead. the -u option does not work on windows as well, as that is specific to journald, which windows does not have
There was a problem hiding this comment.
Shouldn't oc adm node-logs account for this? Is this a bug / issue we should address in that command?
There was a problem hiding this comment.
I would not consider it a bug, as there really isn't a way to get it to work on Windows. The closest parallel to journald would be the Windows Event Viewer, but none of the Windows Kubernetes components are logging to that.
8d46d12 to
8d8f26f
Compare
|
/lgtm @sferich888 @davemulford I'd appreciate if you approved this. |
| @@ -0,0 +1,22 @@ | |||
| #!/bin/bash | |||
| BASE_COLLECTION_PATH="/must-gather" | |||
| WINDOWS_NODE_LOGS=$BASE_COLLECTION_PATH/windows | |||
There was a problem hiding this comment.
Do we want to update https://github.com/openshift/must-gather/blob/master/collection-scripts/gather_service_logs#L13 to say ${BASE_COLLECTION_PATH}/host_service_logs/linux, and then the referenced line can read ${BASE_COLLECTION_PATH}/host_service_logs/windows Thus helping with the find-ability and placement consistency of the logs.
There was a problem hiding this comment.
Yes, having uniformly named directories would benefit both customers and support. We should definitely have this change.
There was a problem hiding this comment.
I have made this change
There was a problem hiding this comment.
I think given we have both tests and users expecting to find linux logs in one location today we should leave that unchanged but write out windows logs, which are net new, to a new location. So lets revert the relocation of linux logs.
So after looking into this more, I don't think this PR will work? But I could be wrong. The way we get logs from nodes is done with a As I understand it, the window nodes will use an upstream kubelet, and as such the method or approach to getting node logs will not be available on windows. Does anyone know, how / what API |
|
@sferich888 I have confirmed that it does work, to answer your question for why it works I am looking into that |
|
@sferich888 That carry patch seems to be specific to the -u |
|
@sferich888 the carry patch is for |
|
@aravindhp yes, but I think |
|
@sferich888 |
8d8f26f to
13edb19
Compare
|
Thanks for the quick changes @sebsoto. This looks fine to me, @sferich888 what do you think? /LGTM |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/lgtm I am reluctantly approving this (only because I feel its not enough), outside of that the PR looks fine provided the shims work on windows. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
14 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@sebsoto Test failure looks legitimate so we're losing crio logs for some reason. |
|
/lgtm cancel |
|
@sdodson There seems to be a repo race condition here. I was asked to change the directory structure, which moved the linux logs into an unexpected place for this test: https://github.com/openshift/origin/blob/master/test/extended/cli/mustgather.go#L75. I cant change this repo unless that repo's test is changed, and I cant change that repo's test until this repo is changed. |
|
The test expects log files in: |
44d0e87 to
c1706b6
Compare
The '-u' flag for 'oc adm node-logs' cannot be used against Windows nodes. This commit ensures that the '-u' method of collection is only used for services running on Linux nodes, and the '--path' option is used for collecting Windows node log files.
c1706b6 to
f7973c8
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: davemulford, sdodson, sebsoto, sferich888 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The '-u' flag for 'oc adm node-logs' cannot be used against Windows
nodes. This commit ensures that the '-u' method of collection is only
used for services running on Linux nodes, and the '--path' option is
used for collecting Windows node log files.