Skip to content

Commit

Permalink
Merge pull request #9967 from olemarkus/cilium-hubble-pointer
Browse files Browse the repository at this point in the history
Cilium hubble pointer
  • Loading branch information
k8s-ci-robot authored Sep 30, 2020
2 parents b992151 + b9111c7 commit 13cbd84
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 17 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/kops/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ type CiliumNetworkingSpec struct {
// Default: false
EnableRemoteNodeIdentity *bool `json:"enableRemoteNodeIdentity,omitempty"`
// Hubble configures the Hubble service on the Cilium agent.
Hubble HubbleSpec `json:"hubble,omitempty"`
Hubble *HubbleSpec `json:"hubble,omitempty"`

// RemoveCbrBridge is not implemented and may be removed in the future.
// Setting this has no effect.
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/kops/v1alpha2/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ type CiliumNetworkingSpec struct {
// Default: false
EnableRemoteNodeIdentity *bool `json:"enableRemoteNodeIdentity,omitempty"`
// Hubble configures the Hubble service on the Cilium agent.
Hubble HubbleSpec `json:"hubble,omitempty"`
Hubble *HubbleSpec `json:"hubble,omitempty"`

// RemoveCbrBridge is not implemented and may be removed in the future.
// Setting this has no effect.
Expand Down
20 changes: 16 additions & 4 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.

6 changes: 5 additions & 1 deletion pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion pkg/apis/kops/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ func validateNetworkingCilium(cluster *kops.Cluster, v *kops.CiliumNetworkingSpe
allErrs = append(allErrs, field.Forbidden(versionFld, "Version 1.8 requires kubernetesVersion 1.12 or newer"))
}

if fi.BoolValue(v.Hubble.Enabled) {
if v.Hubble != nil && fi.BoolValue(v.Hubble.Enabled) {
if version.Minor < 8 {
allErrs = append(allErrs, field.Forbidden(fldPath.Root().Child("hubble", "enabled"), "Hubble requires Cilium 1.8 or newer"))
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/kops/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ func Test_Validate_Cilium(t *testing.T) {
{
Cilium: kops.CiliumNetworkingSpec{
Version: "v1.7.0",
Hubble: kops.HubbleSpec{
Hubble: &kops.HubbleSpec{
Enabled: fi.Bool(true),
},
},
Expand All @@ -639,7 +639,7 @@ func Test_Validate_Cilium(t *testing.T) {
{
Cilium: kops.CiliumNetworkingSpec{
Version: "v1.8.0",
Hubble: kops.HubbleSpec{
Hubble: &kops.HubbleSpec{
Enabled: fi.Bool(true),
},
},
Expand Down
6 changes: 5 additions & 1 deletion pkg/apis/kops/zz_generated.deepcopy.go

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

11 changes: 11 additions & 0 deletions pkg/model/components/cilium.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ func (b *CiliumOptionsBuilder) BuildOptions(o interface{}) error {
c.EnableRemoteNodeIdentity = fi.Bool(true)
}

hubble := c.Hubble
if hubble != nil {
if hubble.Enabled == nil {
hubble.Enabled = fi.Bool(true)
}
} else {
c.Hubble = &kops.HubbleSpec{
Enabled: fi.Bool(false),
}
}

return nil

}
4 changes: 2 additions & 2 deletions upup/models/bindata.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ data:
{{ end }}
{{ end }}

{{ if .Hubble.Enabled }}
{{ if WithDefaultBool .Hubble.Enabled false }}
# Enable Hubble gRPC service.
enable-hubble: "true"
# UNIX domain socket for Hubble server to listen to.
Expand Down Expand Up @@ -835,7 +835,7 @@ spec:
{{ end }}
{{ end }}

{{ if .Networking.Cilium.Hubble.Enabled }}
{{ if WithDefaultBool .Networking.Cilium.Hubble.Enabled false }}
---
# Source: cilium/charts/hubble-relay/templates/service.yaml
kind: Service
Expand Down
2 changes: 0 additions & 2 deletions upup/pkg/fi/cloudup/new_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ func TestSetupNetworking(t *testing.T) {
Networking: &api.NetworkingSpec{
Cilium: &api.CiliumNetworkingSpec{
EnableNodePort: true,
Hubble: api.HubbleSpec{},
},
},
},
Expand All @@ -295,7 +294,6 @@ func TestSetupNetworking(t *testing.T) {
Cilium: &api.CiliumNetworkingSpec{
EnableNodePort: true,
EtcdManaged: true,
Hubble: api.HubbleSpec{},
},
},
},
Expand Down

0 comments on commit 13cbd84

Please sign in to comment.