File tree Expand file tree Collapse file tree 3 files changed +10
-13
lines changed
Expand file tree Collapse file tree 3 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ const eniOnlyCNI = `{
3939
4040const cniFilePath = "/etc/cni/net.d/10-terway.conflist"
4141const nodeCapabilitiesFile = "/var/run/eni/node_capabilities"
42- const kubeProxyCapabilitiesFile = "/var/run/kube-proxy/node_capabilities"
4342
4443type Task struct {
4544 Name string
@@ -204,18 +203,7 @@ func enableKPR(cmd *cobra.Command, args []string) error {
204203 return nil
205204 }
206205
207- kubeProxy := nodecap .NewFileNodeCapabilities (kubeProxyCapabilitiesFile )
208- err = kubeProxy .Load ()
209- if err != nil {
210- return err
211- }
212-
213- // depends on kube-proxy
214- if kubeProxy .Get (nodecap .NodeCapabilityKubeProxyReplacement ) == True {
215- store .Set (nodecap .NodeCapabilityKubeProxyReplacement , True )
216- } else {
217- store .Set (nodecap .NodeCapabilityKubeProxyReplacement , False )
218- }
206+ store .Set (nodecap .NodeCapabilityKubeProxyReplacement , True )
219207
220208 return store .Save ()
221209}
Original file line number Diff line number Diff line change @@ -225,6 +225,8 @@ func runCilium(cfg *PolicyConfig) error {
225225
226226 if cfg .EnableKPR {
227227 args = append (args , "--kube-proxy-replacement=true" )
228+ args = append (args , "--bpf-lb-sock=true" )
229+ args = append (args , "--bpf-lb-sock-hostns-only=true" )
228230 args = append (args , "--enable-node-port=true" )
229231 args = append (args , "--enable-host-port=true" )
230232 args = append (args , "--enable-external-ips=true" )
Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ cat $node_capabilities
4646sysctl -w net.ipv4.conf.eth0.rp_filter=0
4747modprobe sch_htb || true
4848
49+ if grep -qE ' \bkube_proxy_replacement\s*=\s*true\b' " $node_capabilities " ; then
50+ mkdir -p 0755 /host/var/run/cilium/cgroupv2
51+ cp -f /bin/cilium-mount /host/opt/cni/bin/cilium-mount
52+ nsenter --cgroup=/host/proc/1/ns/cgroup --mount=/host/proc/1/ns/mnt /opt/cni/bin/cilium-mount /var/run/cilium/cgroupv2;
53+ rm -f /host/opt/cni/bin/cilium-mount
54+ fi
55+
4956set +o errexit
5057
5158chroot /host systemctl disable eni.service
You can’t perform that action at this time.
0 commit comments