Skip to content

Commit

Permalink
helm: allow multiple default routes (#3344)
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev authored Sep 10, 2024
1 parent 3e37819 commit 98f359e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,14 @@ spec:
- -exc
- |
pref=32
interface=$(ip route | awk '/^default/ { print $5 }')
tc qdisc add dev "${interface}" clsact || true
tc filter del dev "${interface}" ingress pref "${pref}" 2>/dev/null || true
handle=0
for cidr in ${POD_CIDRS}; do
handle=$((handle + 1))
tc filter replace dev "${interface}" ingress pref "${pref}" handle "${handle}" protocol ip flower dst_ip "${cidr}" action drop
for interface in $(ip route | awk '/^default/ { print $5 }'); do
tc qdisc add dev "${interface}" clsact || true
tc filter del dev "${interface}" ingress pref "${pref}" 2>/dev/null || true
handle=0
for cidr in ${POD_CIDRS}; do
handle=$((handle + 1))
tc filter replace dev "${interface}" ingress pref "${pref}" handle "${handle}" protocol ip flower dst_ip "${cidr}" action drop
done
done
env:
- name: POD_CIDRS
Expand Down
29 changes: 27 additions & 2 deletions internal/constellation/helm/cilium.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/install/kubernetes/cilium/Chart.yaml b/install/kubernetes/cilium/Chart.yaml
index 256a79542..3f3fc714b 100644
index 4df10f166b..9f079933b2 100644
--- a/install/kubernetes/cilium/Chart.yaml
+++ b/install/kubernetes/cilium/Chart.yaml
@@ -2,8 +2,8 @@ apiVersion: v2
Expand All @@ -13,4 +13,29 @@ index 256a79542..3f3fc714b 100644
kubeVersion: ">= 1.16.0-0"
icon: https://cdn.jsdelivr.net/gh/cilium/[email protected]/Documentation/images/logo-solo.svg
description: eBPF-based Networking, Security, and Observability

diff --git a/install/kubernetes/cilium/templates/cilium-agent/daemonset.yaml b/install/kubernetes/cilium/templates/cilium-agent/daemonset.yaml
index ffd5935ba1..e2b8ccff6c 100644
--- a/install/kubernetes/cilium/templates/cilium-agent/daemonset.yaml
+++ b/install/kubernetes/cilium/templates/cilium-agent/daemonset.yaml
@@ -764,13 +764,14 @@ spec:
- -exc
- |
pref=32
- interface=$(ip route | awk '/^default/ { print $5 }')
- tc qdisc add dev "${interface}" clsact || true
- tc filter del dev "${interface}" ingress pref "${pref}" 2>/dev/null || true
- handle=0
- for cidr in ${POD_CIDRS}; do
- handle=$((handle + 1))
- tc filter replace dev "${interface}" ingress pref "${pref}" handle "${handle}" protocol ip flower dst_ip "${cidr}" action drop
+ for interface in $(ip route | awk '/^default/ { print $5 }'); do
+ tc qdisc add dev "${interface}" clsact || true
+ tc filter del dev "${interface}" ingress pref "${pref}" 2>/dev/null || true
+ handle=0
+ for cidr in ${POD_CIDRS}; do
+ handle=$((handle + 1))
+ tc filter replace dev "${interface}" ingress pref "${pref}" handle "${handle}" protocol ip flower dst_ip "${cidr}" action drop
+ done
done
env:
- name: POD_CIDRS

0 comments on commit 98f359e

Please sign in to comment.