📘

Raspberry pi 4 で cilium-envoy がクラッシュする

に公開

自分用メモ

問題

kubesprayによるクラスタアップグレード時にciliumを再インストールしたら、Raspberry pi 4でだけcilium-envoy Podが起動しない

$ k get po -n kube-system -o wide
NAME                                   READY   STATUS                  RESTARTS         AGE     IP              NODE           NOMINATED NODE   READINESS GATES
cilium-envoy-28phn                     1/1     Running                 0                174m    192.168.1.118   node2-worker   <none>           <none>
cilium-envoy-95l79                     0/1     CrashLoopBackOff        38 (4m6s ago)    174m    192.168.1.137   node1-master   <none>           <none>
cilium-envoy-ldw4v                     1/1     Running                 0                174m    192.168.1.99    nucboxg3-1     <none>           <none>

以下のログを吐いて異常終了している

external/com_github_google_tcmalloc/tcmalloc/system-alloc.cc:625] MmapAligned() failed - unable to allocate with tag (hint, size, alignment) - is something limiting address placement? 0x17e1c0000000 1073741824 1073741824 @ 0x5567c24ec4 0x5567c21300 0x5567c20c08 0x5567c00210 0x5567c1e900 0x5567c1e6d4 0x5567bf59c8 0x5567b083d4 0x5567b050f0 0x7fae498614
external/com_github_google_tcmalloc/tcmalloc/arena.cc:58] FATAL ERROR: Out of memory trying to allocate internal tcmalloc data (bytes, object-size); is something preventing mmap from succeeding (sandbox, VSS limitations)? 131072 632 @ 0x5567c25234 0x5567c002a0 0x5567c1e900 0x5567c1e6d4 0x5567bf59c8 0x5567b083d4 0x5567b050f0 0x7fae498614```

環境

  • Kubernetes v1.32.6
  • Cilium v1.17.3
  • Raspberry Pi 4
    • 6.6.62+rpt-pri-v8 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64

解決方法(workaround)

Envoyを cilium-envoy DaemonSetではなく、cilium Pod内の別プロセスとして動かす。
Helm install時に envoy.enabledfalse にすると cilium-envoy DaemonSet が作成されない

$ helm upgrade cilium cilium/cilium                         
    --namespace kube-system \
    --reuse-values \
    --set envoy.enabled=false \
    --version 1.17.3

背景など

https://github.com/envoyproxy/envoy/issues/23339

このIssueによると、envoyはカーネルの設定が対応してないからRaspberry pi OS on Raspberry pi 4で起動できない(?)と書かれている気がした。

そもそもcilium-envoyって何?って調べたが、これをdisableするとDaemonSetではなくcilium Podの中で別プロセスとしてEnvoyを起動するらしい。

When Cilium L7 functionality (Ingress, Gateway API, Network Policies with L7 functionality, L7 Protocol Visibility) is enabled or installed in a Kubernetes cluster, the Cilium agent starts an Envoy proxy as separate process within the Cilium agent pod.

That Envoy proxy instance becomes responsible for proxying all matching L7 requests on that node. As a result, L7 traffic targeted by policies depends on the availability of the Cilium agent pod.

Alternatively, it’s possible to deploy the Envoy proxy as independently life-cycled DaemonSet called cilium-envoy instead of running it from within the Cilium Agent Pod.

前はこんなDaemonSetなかった気がするのと、OS再インストールはあまりやりたくないのでcilium Podの中に入れることにした。

To enable the dedicated Envoy proxy DaemonSet, install Cilium with the Helm value envoy.enabled set to true.

kubesprayのtemplate
を見るとenvoy.enabledがconfigurableでなさそう。
cilium以外動いているので、他のansible playbookを動かすのは避けたい(30分かかるし)。
そこで、valuesを更新してciliumのchartをupgradeすることにした。

まずdry run

$ helm upgrade cilium cilium/cilium
    --namespace kube-system \
    --reuse-values \
    --set envoy.enabled=false \
    --version 1.17.3 \
    --dry-run \
    --debug

envoy.enabledfalseになってそうだったので、

$ helm upgrade cilium cilium/cilium
    --namespace kube-system \
    --reuse-values \
    --set envoy.enabled=false \
    --version 1.17.3

これでcilium-envoyが消えてようやく全て動いた。

Discussion