mirror of https://github.com/kubernetes/kops.git
Add support to configure Cilium CNI chaining
CNI chaining allows to use Cilium in combination with other CNI plugins. With Cilium CNI chaining, the base network connectivity and IP address management is managed by the non-Cilium CNI plugin, but Cilium attaches eBPF programs to the network devices created by the non-Cilium plugin to provide L3/L4 network visibility, policy enforcement and other advanced features. https://docs.cilium.io/en/v1.9/gettingstarted/cni-chaining/#cni-chaining In our case, to be able to use the `HostPort` feature in our cluster, we need to enable the `portmap` plugin.
This commit is contained in:
parent
fbff2a14d9
commit
5e814f465d
|
@ -3585,6 +3585,15 @@ spec:
|
||||||
description: BPFRoot is not implemented and may be removed
|
description: BPFRoot is not implemented and may be removed
|
||||||
in the future. Setting this has no effect.
|
in the future. Setting this has no effect.
|
||||||
type: string
|
type: string
|
||||||
|
chainingMode:
|
||||||
|
description: 'ChainingMode allows to use Cilium in combination
|
||||||
|
with other CNI plugins. With Cilium CNI chaining, the base
|
||||||
|
network connectivity and IP address management is managed
|
||||||
|
by the non-Cilium CNI plugin, but Cilium attaches eBPF programs
|
||||||
|
to the network devices created by the non-Cilium plugin
|
||||||
|
to provide L3/L4 network visibility, policy enforcement
|
||||||
|
and other advanced features. Default: none'
|
||||||
|
type: string
|
||||||
clusterName:
|
clusterName:
|
||||||
description: ClusterName is the name of the cluster. It is
|
description: ClusterName is the name of the cluster. It is
|
||||||
only relevant when building a mesh of clusters.
|
only relevant when building a mesh of clusters.
|
||||||
|
|
|
@ -299,6 +299,13 @@ type CiliumNetworkingSpec struct {
|
||||||
// BPFRoot is not implemented and may be removed in the future.
|
// BPFRoot is not implemented and may be removed in the future.
|
||||||
// Setting this has no effect.
|
// Setting this has no effect.
|
||||||
BPFRoot string `json:"bpfRoot,omitempty"`
|
BPFRoot string `json:"bpfRoot,omitempty"`
|
||||||
|
// ChainingMode allows to use Cilium in combination with other CNI plugins.
|
||||||
|
// With Cilium CNI chaining, the base network connectivity and IP address management is managed
|
||||||
|
// by the non-Cilium CNI plugin, but Cilium attaches eBPF programs to the network devices created
|
||||||
|
// by the non-Cilium plugin to provide L3/L4 network visibility, policy enforcement and other advanced features.
|
||||||
|
// Setting this has no effect.
|
||||||
|
// Default: none
|
||||||
|
ChainingMode string `json:"chainingMode,omitempty"`
|
||||||
// ContainerRuntime is not implemented and may be removed in the future.
|
// ContainerRuntime is not implemented and may be removed in the future.
|
||||||
// Setting this has no effect.
|
// Setting this has no effect.
|
||||||
ContainerRuntime []string `json:"containerRuntime,omitempty"`
|
ContainerRuntime []string `json:"containerRuntime,omitempty"`
|
||||||
|
|
|
@ -299,6 +299,13 @@ type CiliumNetworkingSpec struct {
|
||||||
// BPFRoot is not implemented and may be removed in the future.
|
// BPFRoot is not implemented and may be removed in the future.
|
||||||
// Setting this has no effect.
|
// Setting this has no effect.
|
||||||
BPFRoot string `json:"bpfRoot,omitempty"`
|
BPFRoot string `json:"bpfRoot,omitempty"`
|
||||||
|
// ChainingMode allows to use Cilium in combination with other CNI plugins.
|
||||||
|
// With Cilium CNI chaining, the base network connectivity and IP address management is managed
|
||||||
|
// by the non-Cilium CNI plugin, but Cilium attaches eBPF programs to the network devices created
|
||||||
|
// by the non-Cilium plugin to provide L3/L4 network visibility, policy enforcement and other advanced features.
|
||||||
|
// Setting this has no effect.
|
||||||
|
// Default: none
|
||||||
|
ChainingMode string `json:"chainingMode,omitempty"`
|
||||||
// ContainerRuntime is not implemented and may be removed in the future.
|
// ContainerRuntime is not implemented and may be removed in the future.
|
||||||
// Setting this has no effect.
|
// Setting this has no effect.
|
||||||
ContainerRuntime []string `json:"containerRuntime,omitempty"`
|
ContainerRuntime []string `json:"containerRuntime,omitempty"`
|
||||||
|
|
|
@ -1803,6 +1803,7 @@ func autoConvert_v1alpha2_CiliumNetworkingSpec_To_kops_CiliumNetworkingSpec(in *
|
||||||
out.AllowLocalhost = in.AllowLocalhost
|
out.AllowLocalhost = in.AllowLocalhost
|
||||||
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
||||||
out.BPFRoot = in.BPFRoot
|
out.BPFRoot = in.BPFRoot
|
||||||
|
out.ChainingMode = in.ChainingMode
|
||||||
out.ContainerRuntime = in.ContainerRuntime
|
out.ContainerRuntime = in.ContainerRuntime
|
||||||
out.ContainerRuntimeEndpoint = in.ContainerRuntimeEndpoint
|
out.ContainerRuntimeEndpoint = in.ContainerRuntimeEndpoint
|
||||||
out.Debug = in.Debug
|
out.Debug = in.Debug
|
||||||
|
@ -1911,6 +1912,7 @@ func autoConvert_kops_CiliumNetworkingSpec_To_v1alpha2_CiliumNetworkingSpec(in *
|
||||||
out.AllowLocalhost = in.AllowLocalhost
|
out.AllowLocalhost = in.AllowLocalhost
|
||||||
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
out.AutoIpv6NodeRoutes = in.AutoIpv6NodeRoutes
|
||||||
out.BPFRoot = in.BPFRoot
|
out.BPFRoot = in.BPFRoot
|
||||||
|
out.ChainingMode = in.ChainingMode
|
||||||
out.ContainerRuntime = in.ContainerRuntime
|
out.ContainerRuntime = in.ContainerRuntime
|
||||||
out.ContainerRuntimeEndpoint = in.ContainerRuntimeEndpoint
|
out.ContainerRuntimeEndpoint = in.ContainerRuntimeEndpoint
|
||||||
out.Debug = in.Debug
|
out.Debug = in.Debug
|
||||||
|
|
|
@ -127,6 +127,10 @@ data:
|
||||||
# backend and affinity maps. (default 65536)
|
# backend and affinity maps. (default 65536)
|
||||||
bpf-lb-map-max: "{{ .BPFLBMapMax }}"
|
bpf-lb-map-max: "{{ .BPFLBMapMax }}"
|
||||||
|
|
||||||
|
{{ if .ChainingMode }}
|
||||||
|
cni-chaining-mode: "{{ .ChainingMode }}"
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
# enable-bpf-masquerade enables masquerading packets from endpoints leaving
|
# enable-bpf-masquerade enables masquerading packets from endpoints leaving
|
||||||
# the host with BPF instead of iptables. (default false)
|
# the host with BPF instead of iptables. (default false)
|
||||||
enable-bpf-masquerade: "{{ .EnableBPFMasquerade }}"
|
enable-bpf-masquerade: "{{ .EnableBPFMasquerade }}"
|
||||||
|
|
|
@ -139,6 +139,10 @@ data:
|
||||||
# backend and affinity maps. (default 65536)
|
# backend and affinity maps. (default 65536)
|
||||||
bpf-lb-map-max: "{{ .BPFLBMapMax }}"
|
bpf-lb-map-max: "{{ .BPFLBMapMax }}"
|
||||||
|
|
||||||
|
{{ if .ChainingMode }}
|
||||||
|
cni-chaining-mode: "{{ .ChainingMode }}"
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
# enable-bpf-masquerade enables masquerading packets from endpoints leaving
|
# enable-bpf-masquerade enables masquerading packets from endpoints leaving
|
||||||
# the host with BPF instead of iptables. (default false)
|
# the host with BPF instead of iptables. (default false)
|
||||||
enable-bpf-masquerade: "{{ .EnableBPFMasquerade }}"
|
enable-bpf-masquerade: "{{ .EnableBPFMasquerade }}"
|
||||||
|
|
Loading…
Reference in New Issue