Skip to content

Commit

Permalink
Remove tunnel from cilium template (aws#9214)
Browse files Browse the repository at this point in the history
  • Loading branch information
2ez4szliu authored Jan 31, 2025
1 parent 58bb49c commit 5583d64
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
6 changes: 4 additions & 2 deletions pkg/networking/cilium/templater.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ func templateValues(spec *cluster.Spec, versionsBundle *cluster.VersionsBundle)
"enabled": true,
},
"rollOutCiliumPods": true,
"tunnel": "geneve",
"routing-mode": "tunnel",
"tunnel-protocol": "geneve",
"image": values{
"repository": versionsBundle.Cilium.Cilium.Image(),
"tag": versionsBundle.Cilium.Cilium.Tag(),
Expand Down Expand Up @@ -236,7 +237,8 @@ func templateValues(spec *cluster.Spec, versionsBundle *cluster.VersionsBundle)
}

if spec.Cluster.Spec.ClusterNetwork.CNIConfig.Cilium.RoutingMode == anywherev1.CiliumRoutingModeDirect {
val["tunnel"] = "disabled"
val["routing-mode"] = "native"
delete(val, "tunnel-protocol")

if spec.Cluster.Spec.ClusterNetwork.CNIConfig.Cilium.IPv4NativeRoutingCIDR == "" &&
spec.Cluster.Spec.ClusterNetwork.CNIConfig.Cilium.IPv6NativeRoutingCIDR == "" {
Expand Down
19 changes: 12 additions & 7 deletions pkg/networking/cilium/templater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ func TestTemplaterGenerateUpgradePreflightManifestSuccess(t *testing.T) {
"enabled": true,
},
"rollOutCiliumPods": true,
"tunnel": "geneve",
"routing-mode": "tunnel",
"tunnel-protocol": "geneve",
"image": map[string]interface{}{
"repository": "public.ecr.aws/isovalent/cilium",
"tag": "v1.9.11-eksa.1",
Expand Down Expand Up @@ -189,7 +190,8 @@ func TestTemplaterGenerateManifestSuccess(t *testing.T) {
"enabled": true,
},
"rollOutCiliumPods": true,
"tunnel": "geneve",
"routing-mode": "tunnel",
"tunnel-protocol": "geneve",
"image": map[string]interface{}{
"repository": "public.ecr.aws/isovalent/cilium",
"tag": "v1.9.11-eksa.1",
Expand Down Expand Up @@ -226,7 +228,8 @@ func TestTemplaterGenerateManifestPolicyEnforcementModeSuccess(t *testing.T) {
"enabled": true,
},
"rollOutCiliumPods": true,
"tunnel": "geneve",
"routing-mode": "tunnel",
"tunnel-protocol": "geneve",
"image": map[string]interface{}{
"repository": "public.ecr.aws/isovalent/cilium",
"tag": "v1.9.11-eksa.1",
Expand Down Expand Up @@ -268,7 +271,8 @@ func TestTemplaterGenerateManifestEgressMasqueradeInterfacesSuccess(t *testing.T
"enabled": true,
},
"rollOutCiliumPods": true,
"tunnel": "geneve",
"routing-mode": "tunnel",
"tunnel-protocol": "geneve",
"image": map[string]interface{}{
"repository": "public.ecr.aws/isovalent/cilium",
"tag": "v1.9.11-eksa.1",
Expand Down Expand Up @@ -308,7 +312,7 @@ func TestTemplaterGenerateManifestDirectRouteModeSuccess(t *testing.T) {
"enabled": true,
},
"rollOutCiliumPods": true,
"tunnel": "disabled",
"routing-mode": "native",
"autoDirectNodeRoutes": "true",
"image": map[string]interface{}{
"repository": "public.ecr.aws/isovalent/cilium",
Expand Down Expand Up @@ -347,7 +351,7 @@ func TestTemplaterGenerateManifestDirectModeManualIPCIDRSuccess(t *testing.T) {
"enabled": true,
},
"rollOutCiliumPods": true,
"tunnel": "disabled",
"routing-mode": "native",
"ipv4NativeRoutingCIDR": "192.168.0.0/24",
"ipv6NativeRoutingCIDR": "2001:db8::/32",
"image": map[string]interface{}{
Expand Down Expand Up @@ -455,7 +459,8 @@ func wantUpgradeValues() map[string]interface{} {
"enabled": true,
},
"rollOutCiliumPods": true,
"tunnel": "geneve",
"routing-mode": "tunnel",
"tunnel-protocol": "geneve",
"image": map[string]interface{}{
"repository": "public.ecr.aws/isovalent/cilium",
"tag": "v1.9.11-eksa.1",
Expand Down
3 changes: 2 additions & 1 deletion pkg/networking/cilium/testdata/cilium_manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ data:
# - disabled
# - vxlan (default)
# - geneve
tunnel: geneve
routing-mode: "tunnel"
tunnel-protocol: "geneve"
# Enables L7 proxy for L7 policy enforcement and visibility
enable-l7-proxy: "true"

Expand Down

0 comments on commit 5583d64

Please sign in to comment.