Skip to content

Commit

Permalink
Merge pull request #11333 from bjhaid/master
Browse files Browse the repository at this point in the history
Add support for configuring Cilium enable-host-reachable-services.
  • Loading branch information
k8s-ci-robot authored Apr 27, 2021
2 parents 3430c52 + 88ed9f6 commit e035dec
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/kops/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha2/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions pkg/commands/set_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}"
Expand Down

0 comments on commit e035dec

Please sign in to comment.