目录

cilium-bugtool的作用

概述

cilium-bugtool 可以打印 cilium-agent 相关的一些信息,用于排查问题。

使用

使用之前建议通过 cilium-bugtool -h 查看帮助信息。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# cilium-bugtool
Unable to dump envoy config: Get "http://admin/config_dump?include_eds": dial unix /var/run/cilium/envoy/sockets/admin.sock: connect: no such file or directory
Unable to retrieve envoy prometheus metrics: Get "http://admin/stats/prometheus": dial unix /var/run/cilium/envoy/sockets/admin.sock: connect: no such file or directory
Deleted empty directory /tmp/cilium-bugtool-20240202-075114.06+0000-UTC-3156387203/cmd
Deleted empty directory /tmp/cilium-bugtool-20240202-075114.06+0000-UTC-3156387203/conf
Skipping directory cilium-bugtool-20240202-075114.06+0000-UTC-3156387203
Skipping directory cmd
Skipping directory state
Skipping directory 770
Failed to open /tmp/cilium-bugtool-20240202-075114.06+0000-UTC-3156387203/cmd/state/770/template.o: open /tmp/cilium-bugtool-20240202-075114.06+0000-UTC-3156387203/cmd/state/770/template.o: no such file or directory
Skipping directory 770_next_fail
Skipping directory globals
Skipping directory templates
Skipping directory 36c24a25b6845b19ba7fcb81a605579f9daec19428c9547489fc55ff6d2db5a4
Skipping directory conf

ARCHIVE at /tmp/cilium-bugtool-20240202-075114.06+0000-UTC-3156387203.tar
DISCLAIMER
This tool has copied information about your environment.
If you are going to register a issue on GitHub, please
only provide files from the archive you have reviewed
for sensitive information.

从输出的日志可以看到,cilium-bugtool 会通过 Envoy 和 Prometheus 的 API 去获取一些信息,另外日志中也提示了,保存了一个 tar 文件,打开之后大概如下。

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# tree
.
|-- cmd
|   |-- bpftool-cgroup-tree--run-cilium-cgroupv2.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_auth_map.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_call_policy.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_calls_overlay_2.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_calls_xdp.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_capture4_rules.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_capture6_rules.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_capture_cache.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_ct4_global.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_ct6_global.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_ct_any4_global.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_ct_any6_global.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_egress_gw_policy_v4.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_encrypt_state.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_events.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_ipcache.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_ipmasq_v4.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_ipmasq_v6.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_ipv4_frag_datagrams.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_ktime_cache.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_l2_responder_v4.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb4_affinity.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb4_backends.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb4_backends_v2.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb4_backends_v3.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb4_health.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb4_maglev.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb4_reverse_nat.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb4_reverse_sk.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb4_services_v2.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb4_source_range.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb6_affinity.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb6_backends.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb6_backends_v2.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb6_backends_v3.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb6_health.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb6_maglev.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb6_reverse_nat.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb6_reverse_sk.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb6_services_v2.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb6_source_range.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lb_affinity_match.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_lxc.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_metrics.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_nodeport_neigh4.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_nodeport_neigh6.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_runtime_config.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_signals.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_snat_v4_external.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_snat_v6_external.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_srv6_policy_v4.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_srv6_policy_v6.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_srv6_sid.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_srv6_state_v4.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_srv6_state_v6.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_srv6_vrf_v4.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_srv6_vrf_v6.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_throttle.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_tunnel_map.md
|   |-- bpftool-map-dump-pinned--sys-fs-bpf-tc-globals-cilium_vtep_map.md
|   |-- bpftool-map-show.md
|   |-- bpftool-net-show.md
|   |-- bpftool-prog-show.md
|   |-- cat--etc-resolv.conf.md
|   |-- cat--proc-kallsyms.md
|   |-- cat--proc-net-xfrm_stat.md
|   |-- cat--proc-sys-net-core-bpf_jit_enable.md
|   |-- cat--u--proc-net-xfrm_stat.md
|   |-- cilium-bpf-auth-list.md
|   |-- cilium-bpf-bandwidth-list.md
|   |-- cilium-bpf-config-list.md
|   |-- cilium-bpf-ct-list-global.md
|   |-- cilium-bpf-egress-list.md
|   |-- cilium-bpf-endpoint-list.md
|   |-- cilium-bpf-fs-show.md
|   |-- cilium-bpf-ipcache-list.md
|   |-- cilium-bpf-ipmasq-list.md
|   |-- cilium-bpf-lb-list---backends.md
|   |-- cilium-bpf-lb-list---frontends.md
|   |-- cilium-bpf-lb-list---revnat.md
|   |-- cilium-bpf-lb-list---source-ranges.md
|   |-- cilium-bpf-lb-list.md
|   |-- cilium-bpf-lb-maglev-list.md
|   |-- cilium-bpf-nat-list.md
|   |-- cilium-bpf-nodeid-list.md
|   |-- cilium-bpf-policy-get---all---numeric.md
|   |-- cilium-bpf-recorder-list.md
|   |-- cilium-bpf-sha-list.md
|   |-- cilium-bpf-tunnel-list.md
|   |-- cilium-bpf-vtep-list.md
|   |-- cilium-cgroups-list--o-json.md
|   |-- cilium-config--a.md
|   |-- cilium-debuginfo---output=markdown,json--f---output-directory=-tmp-cilium-bugtool-20240404-113031.784+0000-UTC-435746211-cmd.md
|   |-- cilium-encrypt-status.md
|   |-- cilium-endpoint-list.md
|   |-- cilium-fqdn-cache-list.md
|   |-- cilium-health-status---verbose.md
|   |-- cilium-health-status--o-json.md
|   |-- cilium-identity-list.md
|   |-- cilium-ip-list--n--o-json.md
|   |-- cilium-lrp-list.md
|   |-- cilium-map-events-cilium_ipcache--o-json.md
|   |-- cilium-map-events-cilium_lb4_backends_v2--o-json.md
|   |-- cilium-map-events-cilium_lb4_backends_v3--o-json.md
|   |-- cilium-map-events-cilium_lb4_services_v2--o-json.md
|   |-- cilium-map-events-cilium_lb6_backends_v2--o-json.md
|   |-- cilium-map-events-cilium_lb6_backends_v3--o-json.md
|   |-- cilium-map-events-cilium_lb6_services_v2--o-json.md
|   |-- cilium-map-events-cilium_lxc--o-json.md
|   |-- cilium-map-events-cilium_tunnel_map--o-json.md
|   |-- cilium-map-list---verbose.md
|   |-- cilium-metrics-list.md
|   |-- cilium-node-list--o-json.md
|   |-- cilium-node-list.md
|   |-- cilium-policy-get.md
|   |-- cilium-policy-selectors--o-json.md
|   |-- cilium-recorder-list.md
|   |-- cilium-service-list--o-json.md
|   |-- cilium-service-list.md
|   |-- cilium-statedb-dump.md
|   |-- cilium-status---verbose.md
|   |-- cp--proc-config.gz--tmp-cilium-bugtool-20240404-113031.784+0000-UTC-435746211-conf-kernel-config.gz.md
|   |-- cp--r--var-run-cilium-state--tmp-cilium-bugtool-20240404-113031.784+0000-UTC-435746211-cmd-state.md
|   |-- dmesg---time-format=iso.md
|   |-- envoy-config.json
|   |-- envoy-metrics.txt
|   |-- gops-memstats-$(pidof-cilium-agent).md
|   |-- gops-stack-$(pidof-cilium-agent).md
|   |-- gops-stats-$(pidof-cilium-agent).md
|   |-- hostname.md
|   |-- ip--4-n.md
|   |-- ip--4-r.md
|   |-- ip--4-route-show-table-2004.md
|   |-- ip--6-n.md
|   |-- ip--6-r.md
|   |-- ip--6-route-show-table-2004.md
|   |-- ip--d--s-l.md
|   |-- ip--d-rule.md
|   |-- ip--s-xfrm-policy.md
|   |-- ip--s-xfrm-state.md
|   |-- ip-a.md
|   |-- ip6tables-legacy-save--c.md
|   |-- ip6tables-nft-save--c.md
|   |-- ip6tables-save--c.md
|   |-- ipset-list.md
|   |-- iptables-legacy-save--c.md
|   |-- iptables-nft-save--c.md
|   |-- iptables-save--c.md
|   |-- ls--la--proc-$(pidof-cilium-agent)-fd.md
|   |-- lsmod.md
|   |-- ps-auxfw.md
|   |-- ss--t--p--a--i--s--n--e.md
|   |-- ss--u--p--a--i--s--n--e.md
|   |-- state
|   |   |-- 1053
|   |   |   |-- bpf_host.o
|   |   |   |-- bpf_host_cilium_net.o
|   |   |   |-- bpf_netdev_eth0.o
|   |   |   |-- bpf_netdev_flannel.1.o
|   |   |   |-- ep_config.h
|   |   |   `-- template.o
|   |   |-- agent-runtime-config-1.json
|   |   |-- agent-runtime-config-2.json
|   |   |-- agent-runtime-config.json
|   |   |-- bpf_alignchecker.o
|   |   |-- bpf_overlay.o
|   |   |-- endpoint-policy.log
|   |   |-- globals
|   |   |   `-- node_config.h
|   |   |-- netdev_config.h
|   |   |-- templates
|   |   |   `-- d10b932da793f8a121df0ee9aa71fd9c6e3e941cef5c15311759ffb72ba080ca
|   |   |       |-- bpf_host.asm
|   |   |       |-- bpf_host.c
|   |   |       |-- bpf_host.dbg.o
|   |   |       |-- bpf_host.o
|   |   |       `-- ep_config.h
|   |   |-- viper-agent-config-1.yaml
|   |   |-- viper-agent-config-2.yaml
|   |   `-- viper-agent-config.yaml
|   |-- sysctl--a.md
|   |-- taskset--pc-1.md
|   |-- tc--d--s-qdisc-show.md
|   |-- tc--s-qdisc.md
|   |-- tc-chain-show-dev-cilium_host.md
|   |-- tc-chain-show-dev-cilium_net.md
|   |-- tc-chain-show-dev-cilium_vxlan.md
|   |-- tc-chain-show-dev-cni0.md
|   |-- tc-chain-show-dev-contivh0.md
|   |-- tc-chain-show-dev-docker0.md
|   |-- tc-chain-show-dev-eth0.md
|   |-- tc-chain-show-dev-flannel.1.md
|   |-- tc-chain-show-dev-lo.md
|   |-- tc-chain-show-dev-ovs-system.md
|   |-- tc-chain-show-dev-vethdb6d89e3.md
|   |-- tc-chain-show-dev-vethe9171127.md
|   |-- tc-class-show-dev-cilium_host.md
|   |-- tc-class-show-dev-cilium_net.md
|   |-- tc-class-show-dev-cilium_vxlan.md
|   |-- tc-class-show-dev-cni0.md
|   |-- tc-class-show-dev-contivh0.md
|   |-- tc-class-show-dev-docker0.md
|   |-- tc-class-show-dev-eth0.md
|   |-- tc-class-show-dev-flannel.1.md
|   |-- tc-class-show-dev-lo.md
|   |-- tc-class-show-dev-ovs-system.md
|   |-- tc-class-show-dev-vethdb6d89e3.md
|   |-- tc-class-show-dev-vethe9171127.md
|   |-- tc-filter-show-dev-cilium_host-egress.md
|   |-- tc-filter-show-dev-cilium_host-ingress.md
|   |-- tc-filter-show-dev-cilium_net-egress.md
|   |-- tc-filter-show-dev-cilium_net-ingress.md
|   |-- tc-filter-show-dev-cilium_vxlan-egress.md
|   |-- tc-filter-show-dev-cilium_vxlan-ingress.md
|   |-- tc-filter-show-dev-cni0-egress.md
|   |-- tc-filter-show-dev-cni0-ingress.md
|   |-- tc-filter-show-dev-contivh0-egress.md
|   |-- tc-filter-show-dev-contivh0-ingress.md
|   |-- tc-filter-show-dev-docker0-egress.md
|   |-- tc-filter-show-dev-docker0-ingress.md
|   |-- tc-filter-show-dev-eth0-egress.md
|   |-- tc-filter-show-dev-eth0-ingress.md
|   |-- tc-filter-show-dev-flannel.1-egress.md
|   |-- tc-filter-show-dev-flannel.1-ingress.md
|   |-- tc-filter-show-dev-lo-egress.md
|   |-- tc-filter-show-dev-lo-ingress.md
|   |-- tc-filter-show-dev-ovs-system-egress.md
|   |-- tc-filter-show-dev-ovs-system-ingress.md
|   |-- tc-filter-show-dev-vethdb6d89e3-egress.md
|   |-- tc-filter-show-dev-vethdb6d89e3-ingress.md
|   |-- tc-filter-show-dev-vethe9171127-egress.md
|   |-- tc-filter-show-dev-vethe9171127-ingress.md
|   |-- tc-qdisc-show.md
|   |-- top--b--n-1.md
|   |-- uname--a.md
|   `-- uptime.md
`-- conf
    `-- kernel-config.gz

7 directories, 232 files

可以看出,cilium-bugtool 还会保存 Cilium 以及系统参数,方便回溯,如果怀疑 Cilium 的问题的话,不妨通过 cilium-bugtool 将所有配置和参数的 dump 出来看看。。

参考资料

  1. Cilium官方文档
注意
本文最后更新于 2024年4月1日,文中内容可能已过时,请谨慎参考。