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
Expected Behavior
Example from https://docs.projectcalico.org/reference/calicoctl/node/diags
Current Behavior
socket information is not collected as netstat tool is obsolete and removed in Ubuntu and other distros.
Possible Solution
ss -anshould be run ifnetstat -a -nfailshttps://github.com/projectcalico/calicoctl/blob/9e38edf150db3044f81c2a0ccaaca3125c04056c/calicoctl/commands/node/diags.go#L91
Steps to Reproduce (for bugs)
Run
calicoctl node diagsin latest distrosContext
Trying to simulate log collection for troubleshooting kubernetes+calico environment
Your Environment
calicoctl version):docker run --rm calico/node versions)Kubernetes 1.22.1Ubuntu 20.04.3 5.4.0-81-generic