|  | 
|  | 1 | +# Pod Toolbox | 
|  | 2 | + | 
|  | 3 | +When kube-router is ran as a Pod within your Kubernetes cluster, it also ships | 
|  | 4 | +with a number of tools automatically configured for your cluster.  These can be | 
|  | 5 | +used to troubleshoot issues and learn more about how cluster networking is | 
|  | 6 | +performed. | 
|  | 7 | + | 
|  | 8 | +## Logging In | 
|  | 9 | + | 
|  | 10 | +Here's a quick way to get going on a random node in your cluster: | 
|  | 11 | +``` | 
|  | 12 | +KR_POD="basename $(kubectl -n kube-system get pods -l k8s-app=kube-router --output name|head -n1)" | 
|  | 13 | +kubectl -n kube-system exec -it ${KR_POD} bash | 
|  | 14 | +``` | 
|  | 15 | + | 
|  | 16 | +Use `kubectl -n kube-system get pods -l k8s-app=kube-router -o wide` to see what | 
|  | 17 | +nodes are running which pods. This will help if you want to investigate a | 
|  | 18 | +particular node. | 
|  | 19 | + | 
|  | 20 | +## Tools And Usage | 
|  | 21 | + | 
|  | 22 | +Once logged in you will see some help on using the tools in the container. | 
|  | 23 | + | 
|  | 24 | +For example: | 
|  | 25 | +```console | 
|  | 26 | +Welcome to kube-router on "node1.zbrbdl"! | 
|  | 27 | + | 
|  | 28 | +For debugging, the following tools are available: | 
|  | 29 | +- ipvsadm | Gather info about Virtual Services and Real Servers via IPVS. | 
|  | 30 | +          | Examples: | 
|  | 31 | +          |   ## Show all options | 
|  | 32 | +          |   ipvsadm --help | 
|  | 33 | +          |   ## List Services and Endpoints handled by IPVS | 
|  | 34 | +          |   ipvsadm -ln | 
|  | 35 | +          |   ## Show traffic rate information | 
|  | 36 | +          |   ipvsadm -ln --rate | 
|  | 37 | +          |   ## Show cumulative traffic | 
|  | 38 | +          |   ipvsadm -ln --stats | 
|  | 39 | + | 
|  | 40 | +- gobgp   | Get BGP related information from your nodes. | 
|  | 41 | +          | | 
|  | 42 | +          | Tab-completion is ready to use, just type "gobgp <TAB>" | 
|  | 43 | +          | to see the subcommands available. | 
|  | 44 | +          | | 
|  | 45 | +          | By default gobgp will query the Node this Pod is running | 
|  | 46 | +          | on, i.e. "node1.zbrbdl". To query a different node use | 
|  | 47 | +          | "gobgp --host node02.mydomain" as an example. | 
|  | 48 | +          | | 
|  | 49 | +          | For more examples see: https://github.com/osrg/gobgp/blob/master/docs/sources/cli-command-syntax.md | 
|  | 50 | + | 
|  | 51 | +Here's a quick look at what's happening on this Node | 
|  | 52 | +--- BGP Server Configuration --- | 
|  | 53 | +AS:        64512 | 
|  | 54 | +Router-ID: 10.10.3.2 | 
|  | 55 | +Listening Port: 179, Addresses: 0.0.0.0, :: | 
|  | 56 | + | 
|  | 57 | +--- BGP Neighbors --- | 
|  | 58 | +Peer    AS     Up/Down State       |#Received  Accepted | 
|  | 59 | + 64512 2d 01:05:07 Establ      |        1         1 | 
|  | 60 | + | 
|  | 61 | +--- BGP Route Info --- | 
|  | 62 | +   Network              Next Hop             AS_PATH                  Age        Attrs | 
|  | 63 | +*> 10.2.0.0/24          10.10.3.3            4000 400000 300000 40001 2d 01:05:20 [{Origin: i} {LocalPref: 100}] | 
|  | 64 | +*> 10.2.1.0/24          10.10.3.2            4000 400000 300000 40001 00:00:36   [{Origin: i}] | 
|  | 65 | + | 
|  | 66 | +--- IPVS Services --- | 
|  | 67 | +IP Virtual Server version 1.2.1 (size=4096) | 
|  | 68 | +Prot LocalAddress:Port Scheduler Flags | 
|  | 69 | +  -> RemoteAddress:Port           Forward Weight ActiveConn InActConn | 
|  | 70 | +TCP  10.3.0.1:443 rr persistent 10800 mask 0.0.0.0 | 
|  | 71 | +  -> 10.10.3.2:443                Masq    1      0          0 | 
|  | 72 | +TCP  10.3.0.10:53 rr | 
|  | 73 | +  -> 10.2.0.2:53                  Masq    1      0          0 | 
|  | 74 | +TCP  10.3.0.15:2379 rr | 
|  | 75 | +  -> 10.10.3.3:2379               Masq    1      45         0 | 
|  | 76 | +TCP  10.3.0.155:2379 rr | 
|  | 77 | +  -> 10.10.3.3:2379               Masq    1      0          0 | 
|  | 78 | +UDP  10.3.0.10:53 rr | 
|  | 79 | +  -> 10.2.0.2:53                  Masq    1      0          0 | 
|  | 80 | +``` | 
0 commit comments