Merge pull request #11333 from bjhaid/master

Add support for configuring Cilium enable-host-reachable-services.
This commit is contained in:
Kubernetes Prow Robot 2021-04-27 11:41:39 -07:00 committed by GitHub
commit e035decbfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 0 deletions

View File

@ -3459,6 +3459,12 @@ spec:
description: 'EnableEncryption enables Cilium Encryption.
Default: false'
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:
description: 'EnableNodePort replaces kube-proxy with Cilium''s
BPF implementation. Requires spec.kubeProxy.enabled be set

View File

@ -471,6 +471,11 @@ type CiliumNetworkingSpec struct {
// AutoDirectNodeRoutes adds automatic L2 routing between nodes.
// Default: false
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.
// Requires spec.kubeProxy.enabled be set to false.
// Default: false

View File

@ -469,6 +469,11 @@ type CiliumNetworkingSpec struct {
// AutoDirectNodeRoutes adds automatic L2 routing between nodes.
// Default: false
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.
// Requires spec.kubeProxy.enabled be set to false.
// Default: false

View File

@ -1729,6 +1729,7 @@ func autoConvert_v1alpha2_CiliumNetworkingSpec_To_kops_CiliumNetworkingSpec(in *
out.Ipam = in.Ipam
out.IPTablesRulesNoinstall = in.IPTablesRulesNoinstall
out.AutoDirectNodeRoutes = in.AutoDirectNodeRoutes
out.EnableHostReachableServices = in.EnableHostReachableServices
out.EnableNodePort = in.EnableNodePort
out.EtcdManaged = in.EtcdManaged
out.EnableRemoteNodeIdentity = in.EnableRemoteNodeIdentity
@ -1823,6 +1824,7 @@ func autoConvert_kops_CiliumNetworkingSpec_To_v1alpha2_CiliumNetworkingSpec(in *
out.Ipam = in.Ipam
out.IPTablesRulesNoinstall = in.IPTablesRulesNoinstall
out.AutoDirectNodeRoutes = in.AutoDirectNodeRoutes
out.EnableHostReachableServices = in.EnableHostReachableServices
out.EnableNodePort = in.EnableNodePort
out.EtcdManaged = in.EtcdManaged
out.EnableRemoteNodeIdentity = in.EnableRemoteNodeIdentity

View File

@ -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{
"cluster.spec.networking.cilium.enableNodePort=true",

View File

@ -173,6 +173,9 @@ data:
masquerade: "{{- if .DisableMasquerade -}}false{{- else -}}true{{- end -}}"
install-iptables-rules: "{{- if .IPTablesRulesNoinstall -}}false{{- else -}}true{{- end -}}"
auto-direct-node-routes: "{{ .AutoDirectNodeRoutes }}"
{{ if .EnableHostReachableServices }}
enable-host-reachable-services: "{{ .EnableHostReachableServices }}"
{{ end }}
enable-node-port: "{{ .EnableNodePort }}"
kube-proxy-replacement: "{{- if .EnableNodePort -}}strict{{- else -}}partial{{- end -}}"
enable-remote-node-identity: "{{ .EnableRemoteNodeIdentity -}}"