Skip to content

Commit

Permalink
helm: enforce routing-mode when {gke,aksbyocni}.enabled is set.
Browse files Browse the repository at this point in the history
Historically, the Cilium helm chart allowed to override the routing mode
leveraged in combination with {gke,aksbyocni}.enabled. This is no longer
possible since aff16b2 ("Change routing-mode and tunnel interaction.").

According to the Cilium documentation [1,2], this appears to be the
correct behavior, as the routing mode must be respectively set to native
and tunnel in these cases. Hence, let's validate that users didn't
configure a different routing mode, to avoid falling back silently,
which may be confusing.

[1]: https://docs.cilium.io/en/stable/network/concepts/routing/#id6
[2]: https://docs.cilium.io/en/stable/gettingstarted/k8s-install-default/#install-cilium (AKS tab)

Signed-off-by: Marco Iorio <[email protected]>
  • Loading branch information
giorio94 authored and julianwiedmann committed Dec 20, 2023
1 parent d24fa08 commit babba79
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions install/kubernetes/cilium/templates/cilium-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,15 @@ data:
# - vxlan (default)
# - geneve
{{- if .Values.gke.enabled }}
{{- if ne (.Values.routingMode | default "native") "native" }}
{{- fail (printf "RoutingMode must be set to native when gke.enabled=true" )}}
{{- end }}
routing-mode: "native"
enable-endpoint-routes: "true"
{{- else if .Values.aksbyocni.enabled }}
{{- if ne (.Values.routingMode | default "tunnel") "tunnel" }}
{{- fail (printf "RoutingMode must be set to tunnel when aksbyocni.enabled=true" )}}
{{- end }}
routing-mode: "tunnel"
tunnel-protocol: "vxlan"
{{- else if .Values.routingMode }}
Expand Down

0 comments on commit babba79

Please sign in to comment.