mirror of https://github.com/kubernetes/kops.git
Add support for configuring Cilium enable-host-reachable-services.
After upgrading Cilium to 1.8 via kops one of our clusters had a total outage due to cilium reporting errors as below: ``` level=error msg="endpoint regeneration failed" containerID= datapathPolicyRevision=0 desiredPolicyRevision=1 endpointID=592 error="Failed to load tc filter: exit status 1" identity=40147 ipv4= ipv6= k8sPodName=/ subsys=endpoint ``` upon searching Cilium slack we found the below thread: https://cilium.slack.com/archives/C1MATJ5U5/p1616400216167600 which recommended setting `enable-host-reachable-services` to true will address the problems. We set the field and it fixed our issues too, however we observed that kops does not have a means to configure this hence this PR. We will like to have this backported after it has been merged.
This commit is contained in:
parent
3430c52fcc
commit
88ed9f68bd
|
|
@ -3459,6 +3459,12 @@ spec:
|
||||||
description: 'EnableEncryption enables Cilium Encryption.
|
description: 'EnableEncryption enables Cilium Encryption.
|
||||||
Default: false'
|
Default: false'
|
||||||
type: boolean
|
type: boolean
|
||||||
|
enableHostReachableServices:
|
||||||
|
description: 'EnableHostReachableServices configures Cilium
|
||||||
|
to enable services to be reached from the host namespace
|
||||||
|
in addition to pod namespaces. https://docs.cilium.io/en/v1.9/gettingstarted/host-services/
|
||||||
|
Default: false'
|
||||||
|
type: boolean
|
||||||
enableNodePort:
|
enableNodePort:
|
||||||
description: 'EnableNodePort replaces kube-proxy with Cilium''s
|
description: 'EnableNodePort replaces kube-proxy with Cilium''s
|
||||||
BPF implementation. Requires spec.kubeProxy.enabled be set
|
BPF implementation. Requires spec.kubeProxy.enabled be set
|
||||||
|
|
|
||||||
|
|
@ -471,6 +471,11 @@ type CiliumNetworkingSpec struct {
|
||||||
// AutoDirectNodeRoutes adds automatic L2 routing between nodes.
|
// AutoDirectNodeRoutes adds automatic L2 routing between nodes.
|
||||||
// Default: false
|
// Default: false
|
||||||
AutoDirectNodeRoutes bool `json:"autoDirectNodeRoutes,omitempty"`
|
AutoDirectNodeRoutes bool `json:"autoDirectNodeRoutes,omitempty"`
|
||||||
|
// EnableHostReachableServices configures Cilium to enable services to be
|
||||||
|
// reached from the host namespace in addition to pod namespaces.
|
||||||
|
// https://docs.cilium.io/en/v1.9/gettingstarted/host-services/
|
||||||
|
// Default: false
|
||||||
|
EnableHostReachableServices bool `json:"enableHostReachableServices,omitempty"`
|
||||||
// EnableNodePort replaces kube-proxy with Cilium's BPF implementation.
|
// EnableNodePort replaces kube-proxy with Cilium's BPF implementation.
|
||||||
// Requires spec.kubeProxy.enabled be set to false.
|
// Requires spec.kubeProxy.enabled be set to false.
|
||||||
// Default: false
|
// Default: false
|
||||||
|
|
|
||||||
|
|
@ -469,6 +469,11 @@ type CiliumNetworkingSpec struct {
|
||||||
// AutoDirectNodeRoutes adds automatic L2 routing between nodes.
|
// AutoDirectNodeRoutes adds automatic L2 routing between nodes.
|
||||||
// Default: false
|
// Default: false
|
||||||
AutoDirectNodeRoutes bool `json:"autoDirectNodeRoutes,omitempty"`
|
AutoDirectNodeRoutes bool `json:"autoDirectNodeRoutes,omitempty"`
|
||||||
|
// EnableHostReachableServices configures Cilium to enable services to be
|
||||||
|
// reached from the host namespace in addition to pod namespaces.
|
||||||
|
// https://docs.cilium.io/en/v1.9/gettingstarted/host-services/
|
||||||
|
// Default: false
|
||||||
|
EnableHostReachableServices bool `json:"enableHostReachableServices,omitempty"`
|
||||||
// EnableNodePort replaces kube-proxy with Cilium's BPF implementation.
|
// EnableNodePort replaces kube-proxy with Cilium's BPF implementation.
|
||||||
// Requires spec.kubeProxy.enabled be set to false.
|
// Requires spec.kubeProxy.enabled be set to false.
|
||||||
// Default: false
|
// Default: false
|
||||||
|
|
|
||||||
|
|
@ -1729,6 +1729,7 @@ func autoConvert_v1alpha2_CiliumNetworkingSpec_To_kops_CiliumNetworkingSpec(in *
|
||||||
out.Ipam = in.Ipam
|
out.Ipam = in.Ipam
|
||||||
out.IPTablesRulesNoinstall = in.IPTablesRulesNoinstall
|
out.IPTablesRulesNoinstall = in.IPTablesRulesNoinstall
|
||||||
out.AutoDirectNodeRoutes = in.AutoDirectNodeRoutes
|
out.AutoDirectNodeRoutes = in.AutoDirectNodeRoutes
|
||||||
|
out.EnableHostReachableServices = in.EnableHostReachableServices
|
||||||
out.EnableNodePort = in.EnableNodePort
|
out.EnableNodePort = in.EnableNodePort
|
||||||
out.EtcdManaged = in.EtcdManaged
|
out.EtcdManaged = in.EtcdManaged
|
||||||
out.EnableRemoteNodeIdentity = in.EnableRemoteNodeIdentity
|
out.EnableRemoteNodeIdentity = in.EnableRemoteNodeIdentity
|
||||||
|
|
@ -1823,6 +1824,7 @@ func autoConvert_kops_CiliumNetworkingSpec_To_v1alpha2_CiliumNetworkingSpec(in *
|
||||||
out.Ipam = in.Ipam
|
out.Ipam = in.Ipam
|
||||||
out.IPTablesRulesNoinstall = in.IPTablesRulesNoinstall
|
out.IPTablesRulesNoinstall = in.IPTablesRulesNoinstall
|
||||||
out.AutoDirectNodeRoutes = in.AutoDirectNodeRoutes
|
out.AutoDirectNodeRoutes = in.AutoDirectNodeRoutes
|
||||||
|
out.EnableHostReachableServices = in.EnableHostReachableServices
|
||||||
out.EnableNodePort = in.EnableNodePort
|
out.EnableNodePort = in.EnableNodePort
|
||||||
out.EtcdManaged = in.EtcdManaged
|
out.EtcdManaged = in.EtcdManaged
|
||||||
out.EnableRemoteNodeIdentity = in.EnableRemoteNodeIdentity
|
out.EnableRemoteNodeIdentity = in.EnableRemoteNodeIdentity
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,21 @@ func TestSetClusterFields(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Fields: []string{
|
||||||
|
"cluster.spec.networking.cilium.enableHostReachableServices=true",
|
||||||
|
},
|
||||||
|
Input: kops.Cluster{},
|
||||||
|
Output: kops.Cluster{
|
||||||
|
Spec: kops.ClusterSpec{
|
||||||
|
Networking: &kops.NetworkingSpec{
|
||||||
|
Cilium: &kops.CiliumNetworkingSpec{
|
||||||
|
EnableHostReachableServices: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Fields: []string{
|
Fields: []string{
|
||||||
"cluster.spec.networking.cilium.enableNodePort=true",
|
"cluster.spec.networking.cilium.enableNodePort=true",
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,9 @@ data:
|
||||||
masquerade: "{{- if .DisableMasquerade -}}false{{- else -}}true{{- end -}}"
|
masquerade: "{{- if .DisableMasquerade -}}false{{- else -}}true{{- end -}}"
|
||||||
install-iptables-rules: "{{- if .IPTablesRulesNoinstall -}}false{{- else -}}true{{- end -}}"
|
install-iptables-rules: "{{- if .IPTablesRulesNoinstall -}}false{{- else -}}true{{- end -}}"
|
||||||
auto-direct-node-routes: "{{ .AutoDirectNodeRoutes }}"
|
auto-direct-node-routes: "{{ .AutoDirectNodeRoutes }}"
|
||||||
|
{{ if .EnableHostReachableServices }}
|
||||||
|
enable-host-reachable-services: "{{ .EnableHostReachableServices }}"
|
||||||
|
{{ end }}
|
||||||
enable-node-port: "{{ .EnableNodePort }}"
|
enable-node-port: "{{ .EnableNodePort }}"
|
||||||
kube-proxy-replacement: "{{- if .EnableNodePort -}}strict{{- else -}}partial{{- end -}}"
|
kube-proxy-replacement: "{{- if .EnableNodePort -}}strict{{- else -}}partial{{- end -}}"
|
||||||
enable-remote-node-identity: "{{ .EnableRemoteNodeIdentity -}}"
|
enable-remote-node-identity: "{{ .EnableRemoteNodeIdentity -}}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue