Thanks to visit codestin.com
Credit goes to github.com

Skip to content

calicoctl node diags is still using obsolete 'netstat' tool instead of 'ss' #5258

Description

@gouthamraj91

Expected Behavior

Example from https://docs.projectcalico.org/reference/calicoctl/node/diags

$ sudo calicoctl node diags
Collecting diagnostics
Using temp dir: /tmp/calico676127473
Dumping netstat
Dumping routes (IPv4)
Dumping routes (IPv6)
[...]

Current Behavior

socket information is not collected as netstat tool is obsolete and removed in Ubuntu and other distros.

gosekar@gosekar-k8s-master:~$ sudo calicoctl node diags
Collecting diagnostics
Using temp dir: /tmp/calico662105980
Dumping netstat
Failed to run command: netstat -a -n
Error: 
Dumping routes (IPv4)
Dumping routes (IPv6)
[...]

Possible Solution

ss -an should be run if netstat -a -n fails
https://github.com/projectcalico/calicoctl/blob/9e38edf150db3044f81c2a0ccaaca3125c04056c/calicoctl/commands/node/diags.go#L91

Steps to Reproduce (for bugs)

Run calicoctl node diags in latest distros

Context

Trying to simulate log collection for troubleshooting kubernetes+calico environment

Your Environment

  • calicoctl version (e.g. calicoctl version):
gosekar@gosekar-k8s-master:~$ calicoctl version
Client Version:    v3.20.0
Git commit:        38b00edd
Cluster Version:   v3.20.0
Cluster Type:      k8s,bgp,kubeadm,kdd
  • calico/node version (e.g. docker run --rm calico/node versions)
gosekar@gosekar-k8s-master:~$ kubectl exec -it calico-node-l6tng -n kube-system -- /bin/calico-node -v
v3.20.0
  • Orchestrator type and version (e.g. kubernetes, mesos, rkt):
    Kubernetes 1.22.1
  • Operating System and version:
    Ubuntu 20.04.3 5.4.0-81-generic
  • Link to your project (optional): Nil

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions