Skip to content
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

Make k8s-cilium-exec.sh friendlier to read #17997

Merged
merged 1 commit into from
Jan 5, 2022

Conversation

weizhoublue
Copy link
Contributor

@weizhoublue weizhoublue commented Nov 24, 2021

the debug script k8s-cilium-exec.sh is used to execute command on all cilium-agent pods
but its output is not friendly to figure out which node each output section belongs to
for example , below output is for 2-nodes cluster , if an issue is happening , we could not tell which node the issue is happening on

# ./k8s-cilium-exec.sh  cilium status
KVStore:                Ok   Disabled
Kubernetes:             Ok   1.22 (v1.22.1) [linux/amd64]
Kubernetes APIs:        ["cilium/v2::CiliumClusterwideNetworkPolicy", "cilium/v2::CiliumEgressNATPolicy", "cilium/v2::CiliumEndpoint", "cilium/v2::CiliumLocalRedirectPolicy", "cilium/v2::CiliumNetworkPolicy", "cilium/v2::CiliumNode", "core/v1::Endpoint", "core/v1::Namespace", "core/v1::Node", "core/v1::Pods", "core/v1::Service", "networking.k8s.io/v1::NetworkPolicy"]
KubeProxyReplacement:   Probe   [ens192 172.110.185.60 fd00:110::172:110:185:60 (Direct Routing), ens224 10.6.185.60 fd00:6::10:6:185:60]
Cilium:                 Ok   1.10.4 (v1.10.4-2a46fd6)
NodeMonitor:            Listening for events on 8 CPUs with 64x4096 of shared memory
Cilium health daemon:   Ok
IPAM:                   IPv4: 9/254 allocated from 172.60.0.0/24, IPv6: 9/18446744073709551614 allocated from fc06:1::/64
ClusterMesh:            1/1 clusters ready, 8 global-services
BandwidthManager:       EDT with BPF   [ens192, ens224]
Host Routing:           Legacy
Masquerading:           BPF   [ens192, ens224]   172.61.0.0/16 [IPv4: Enabled, IPv6: Enabled]
Controller Status:      54/54 healthy
Proxy Status:           OK, ip 172.60.0.27, 0 redirects active on ports 10000-20000
Hubble:                 Ok   Current/Max Flows: 65535/65535 (100.00%), Flows/s: 16.49   Metrics: Ok
Encryption:             Disabled
Cluster health:         4/4 reachable   (2021-11-24T08:47:15Z)
KVStore:                Ok   Disabled
Kubernetes:             Ok   1.22 (v1.22.1) [linux/amd64]
Kubernetes APIs:        ["cilium/v2::CiliumClusterwideNetworkPolicy", "cilium/v2::CiliumEgressNATPolicy", "cilium/v2::CiliumEndpoint", "cilium/v2::CiliumLocalRedirectPolicy", "cilium/v2::CiliumNetworkPolicy", "cilium/v2::CiliumNode", "core/v1::Endpoint", "core/v1::Namespace", "core/v1::Node", "core/v1::Pods", "core/v1::Service", "networking.k8s.io/v1::NetworkPolicy"]
KubeProxyReplacement:   Probe   [ens192 172.110.185.65 fd00:110::172:110:185:65 (Direct Routing), ens224 10.6.185.65 fd00:6::10:6:185:65]
Cilium:                 Ok   1.10.4 (v1.10.4-2a46fd6)
NodeMonitor:            Listening for events on 8 CPUs with 64x4096 of shared memory
Cilium health daemon:   Ok
IPAM:                   IPv4: 14/254 allocated from 172.60.1.0/24, IPv6: 14/18446744073709551614 allocated from fc06:1:0:1::/64
ClusterMesh:            1/1 clusters ready, 8 global-services
BandwidthManager:       EDT with BPF   [ens192, ens224]
Host Routing:           Legacy
Masquerading:           BPF   [ens192, ens224]   172.61.0.0/16 [IPv4: Enabled, IPv6: Enabled]
Controller Status:      75/75 healthy
Proxy Status:           OK, ip 172.60.1.174, 0 redirects active on ports 10000-20000
Hubble:                 Ok   Current/Max Flows: 65535/65535 (100.00%), Flows/s: 23.58   Metrics: Ok
Encryption:             Disabled
Cluster health:         4/4 reachable   (2021-11-24T08:46:55Z)

I add the the pod and node information for each output section , so it is easy to find where an error is happening

# ./k8s-cilium-exec.sh  cilium status
==== detail from pod cilium-8fv96 , on node 172-110-185-65
KVStore:                Ok   Disabled
Kubernetes:             Ok   1.22 (v1.22.1) [linux/amd64]
Kubernetes APIs:        ["cilium/v2::CiliumClusterwideNetworkPolicy", "cilium/v2::CiliumEgressNATPolicy", "cilium/v2::CiliumEndpoint", "cilium/v2::CiliumLocalRedirectPolicy", "cilium/v2::CiliumNetworkPolicy", "cilium/v2::CiliumNode", "core/v1::Endpoint", "core/v1::Namespace", "core/v1::Node", "core/v1::Pods", "core/v1::Service", "networking.k8s.io/v1::NetworkPolicy"]
KubeProxyReplacement:   Probe   [ens192 172.110.185.65 fd00:110::172:110:185:65 (Direct Routing), ens224 10.6.185.65 fd00:6::10:6:185:65]
Cilium:                 Ok   1.10.4 (v1.10.4-2a46fd6)
NodeMonitor:            Listening for events on 8 CPUs with 64x4096 of shared memory
Cilium health daemon:   Ok
IPAM:                   IPv4: 14/254 allocated from 172.60.1.0/24, IPv6: 14/18446744073709551614 allocated from fc06:1:0:1::/64
ClusterMesh:            1/1 clusters ready, 8 global-services
BandwidthManager:       EDT with BPF   [ens192, ens224]
Host Routing:           Legacy
Masquerading:           BPF   [ens192, ens224]   172.61.0.0/16 [IPv4: Enabled, IPv6: Enabled]
Controller Status:      75/75 healthy
Proxy Status:           OK, ip 172.60.1.174, 0 redirects active on ports 10000-20000
Hubble:                 Ok   Current/Max Flows: 65535/65535 (100.00%), Flows/s: 23.58   Metrics: Ok
Encryption:             Disabled
Cluster health:         4/4 reachable   (2021-11-24T08:46:55Z)

==== detail from pod cilium-297wj , on node 172-110-185-60
KVStore:                Ok   Disabled
Kubernetes:             Ok   1.22 (v1.22.1) [linux/amd64]
Kubernetes APIs:        ["cilium/v2::CiliumClusterwideNetworkPolicy", "cilium/v2::CiliumEgressNATPolicy", "cilium/v2::CiliumEndpoint", "cilium/v2::CiliumLocalRedirectPolicy", "cilium/v2::CiliumNetworkPolicy", "cilium/v2::CiliumNode", "core/v1::Endpoint", "core/v1::Namespace", "core/v1::Node", "core/v1::Pods", "core/v1::Service", "networking.k8s.io/v1::NetworkPolicy"]
KubeProxyReplacement:   Probe   [ens192 172.110.185.60 fd00:110::172:110:185:60 (Direct Routing), ens224 10.6.185.60 fd00:6::10:6:185:60]
Cilium:                 Ok   1.10.4 (v1.10.4-2a46fd6)
NodeMonitor:            Listening for events on 8 CPUs with 64x4096 of shared memory
Cilium health daemon:   Ok
IPAM:                   IPv4: 9/254 allocated from 172.60.0.0/24, IPv6: 9/18446744073709551614 allocated from fc06:1::/64
ClusterMesh:            1/1 clusters ready, 8 global-services
BandwidthManager:       EDT with BPF   [ens192, ens224]
Host Routing:           Legacy
Masquerading:           BPF   [ens192, ens224]   172.61.0.0/16 [IPv4: Enabled, IPv6: Enabled]
Controller Status:      54/54 healthy
Proxy Status:           OK, ip 172.60.0.27, 0 redirects active on ports 10000-20000
Hubble:                 Ok   Current/Max Flows: 65535/65535 (100.00%), Flows/s: 16.49   Metrics: Ok
Encryption:             Disabled
Cluster health:         4/4 reachable   (2021-11-24T08:46:15Z)

Signed-off-by: weizhou Lan weizhou.lan@daocloud.io

@weizhoublue weizhoublue requested a review from a team as a code owner November 24, 2021 08:56
@maintainer-s-little-helper
Copy link

Commit a8ac3a4a87059f8192f04ed9be80c64a81271b78 does not contain "Signed-off-by".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Nov 24, 2021
@gandro gandro added dont-merge/wait-until-release Freeze window for current release is blocking non-bugfix PRs release-note/misc This PR makes changes that have no direct user impact. sig/contributing Impacts contribution workflow, guidelines, and tools. labels Nov 24, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Nov 24, 2021
@weizhoublue
Copy link
Contributor Author

Signed-off-by: weizhou Lan weizhou.lan@daocloud.io

@joestringer joestringer changed the title contrib: k8s-cilium-exec.sh is not friendly to read Make k8s-cilium-exec.sh friendlier to read Dec 6, 2021
Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

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

Thanks, this is easier to read.

Please fix up the author and signoff using the following commands, and then force push to update the PR:

git config --global user.name "weizhou Lan"
git commit --amend --reset-author --signoff

@aanm aanm removed the dont-merge/wait-until-release Freeze window for current release is blocking non-bugfix PRs label Dec 9, 2021
Copy link
Member

@aditighag aditighag left a comment

Choose a reason for hiding this comment

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

Nice improvement! Approved, pending comment from Joe.

@nbusseneau
Copy link
Member

nbusseneau commented Dec 10, 2021

@weizhoublue Thanks for your contribution! As noted above by Joe, we require the commit description to include sign-offs. Can you please amend your commit so that we can merge your PR?

EDIT: Ah sorry I misread the timestamps, I thought the request from Joe was dating back way earlier than just yesterday and wanted to check in, see if I could help. Sorry for the mixup, it is probable you haven't even had the time to catch up with the latest comments 😅

Signed-off-by: weizhou Lan <weizhou.lan@daocloud.io>
@weizhoublue weizhoublue force-pushed the pr/welan/opt-script-output branch from a8ac3a4 to e4a1e8e Compare December 30, 2021 13:57
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Dec 30, 2021
@weizhoublue
Copy link
Contributor Author

weizhoublue commented Dec 30, 2021

@joestringer @nbusseneau
apologize for the late response , many thanks for reminding
I patched the sign-off to the commit

Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@joestringer joestringer merged commit 56c75df into cilium:master Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact. sig/contributing Impacts contribution workflow, guidelines, and tools.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants