Skip to content

Commit

Permalink
Add .spec.hashRing.memberlist.enableIPv6 option to enable IPv6 suppor…
Browse files Browse the repository at this point in the history
…t in memberlist (#704)

Resolves the following on IPv6-only clusters:
```
level=warn ts=2023-12-01T13:30:43.329585331Z caller=netutil.go:90 msg="error getting addresses for interface" inf=en0 err="route ip+net: no such network interface"
level=error ts=2023-12-01T13:30:43.32960865Z caller=main.go:121 msg="error running Tempo" err="failed to init module services: error initialising module: compactor: failed to create compactor: no useable address found for interfaces [eth0 en0]"
```

```
level=error ts=2023-12-01T13:30:27.331892495Z caller=main.go:121 msg="error running Tempo" err="failed to init module services: error initialising module: ingester: failed to create ingester: NewLifecycler failed: no useable address found for interfaces [eth0]"
```

Signed-off-by: Andreas Gerstmayr <[email protected]>
  • Loading branch information
andreasgerstmayr authored Dec 7, 2023
1 parent e4444fe commit 5a79e61
Show file tree
Hide file tree
Showing 17 changed files with 599 additions and 6 deletions.
16 changes: 16 additions & 0 deletions .chloggen/ipv6_support.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. operator, github action)
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add .spec.hashRing.memberlist.enableIPv6 option to enable IPv6 support

# One or more tracking issues related to the change
issues: [704]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
27 changes: 27 additions & 0 deletions apis/tempo/v1alpha1/tempostack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ type TempoStackSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Search configuration options"
SearchSpec SearchSpec `json:"search,omitempty"`

// HashRing defines the spec for the distributed hash ring configuration.
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors="urn:alm:descriptor:com.tectonic.ui:advanced",displayName="Hash Ring"
HashRing HashRingSpec `json:"hashRing,omitempty"`

// Template defines requirements for a set of tempo components.
//
// +optional
Expand Down Expand Up @@ -412,6 +419,26 @@ type ObjectStorageTLSSpec struct {
CA string `json:"caName,omitempty"`
}

// MemberListSpec defines the configuration for the memberlist based hash ring.
type MemberListSpec struct {
// EnableIPv6 enables IPv6 support for the memberlist based hash ring.
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch",displayName="Enable IPv6"
EnableIPv6 *bool `json:"enableIPv6,omitempty"`
}

// HashRingSpec defines the hash ring configuration.
type HashRingSpec struct {
// MemberList configuration spec
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Memberlist Config"
MemberList MemberListSpec `json:"memberlist,omitempty"`
}

// ReceiversTLSSpec is the TLS configuration for the receivers.
type ReceiversTLSSpec struct {
Enabled bool `json:"enabled"`
Expand Down
8 changes: 8 additions & 0 deletions apis/tempo/v1alpha1/tempostack_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"

"github.com/grafana/tempo-operator/apis/config/v1alpha1"
"github.com/grafana/tempo-operator/internal/autodetect"
"github.com/grafana/tempo-operator/internal/manifests/naming"
)

Expand Down Expand Up @@ -123,6 +124,13 @@ func (d *Defaulter) Default(ctx context.Context, obj runtime.Object) error {
r.Spec.Template.QueryFrontend.JaegerQuery.Ingress.Route.Termination = defaultUITLSTermination
}

// Enable IPv6 if the operator pod (and therefore most likely all other pods) only have IPv6 addresses assigned
if r.Spec.HashRing.MemberList.EnableIPv6 == nil {
if autodetect.DetectIPv6Only([]string{"eth0", "en0"}) {
r.Spec.HashRing.MemberList.EnableIPv6 = ptr.To(true)
}
}

return nil
}

Expand Down
37 changes: 37 additions & 0 deletions apis/tempo/v1alpha1/zz_generated.deepcopy.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 @@ -42,7 +42,7 @@ metadata:
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator
createdAt: "2023-12-07T18:57:13Z"
createdAt: "2023-12-07T19:15:22Z"
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
Expand Down Expand Up @@ -87,6 +87,20 @@ spec:
name: ""
version: v1
specDescriptors:
- description: HashRing defines the spec for the distributed hash ring configuration.
displayName: Hash Ring
path: hashRing
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: MemberList configuration spec
displayName: Memberlist Config
path: hashRing.memberlist
- description: EnableIPv6 enables IPv6 support for the memberlist based hash
ring.
displayName: Enable IPv6
path: hashRing.memberlist.enableIPv6
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Images defines the image for each container.
displayName: Container Images
path: images
Expand Down
13 changes: 13 additions & 0 deletions bundle/community/manifests/tempo.grafana.com_tempostacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ spec:
spec:
description: TempoStackSpec defines the desired state of TempoStack.
properties:
hashRing:
description: HashRing defines the spec for the distributed hash ring
configuration.
properties:
memberlist:
description: MemberList configuration spec
properties:
enableIPv6:
description: EnableIPv6 enables IPv6 support for the memberlist
based hash ring.
type: boolean
type: object
type: object
images:
description: Images defines the image for each container.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ metadata:
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator
createdAt: "2023-12-07T18:32:18Z"
createdAt: "2023-12-07T19:15:21Z"
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
Expand Down Expand Up @@ -87,6 +87,20 @@ spec:
name: ""
version: v1
specDescriptors:
- description: HashRing defines the spec for the distributed hash ring configuration.
displayName: Hash Ring
path: hashRing
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: MemberList configuration spec
displayName: Memberlist Config
path: hashRing.memberlist
- description: EnableIPv6 enables IPv6 support for the memberlist based hash
ring.
displayName: Enable IPv6
path: hashRing.memberlist.enableIPv6
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Images defines the image for each container.
displayName: Container Images
path: images
Expand Down
13 changes: 13 additions & 0 deletions bundle/openshift/manifests/tempo.grafana.com_tempostacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ spec:
spec:
description: TempoStackSpec defines the desired state of TempoStack.
properties:
hashRing:
description: HashRing defines the spec for the distributed hash ring
configuration.
properties:
memberlist:
description: MemberList configuration spec
properties:
enableIPv6:
description: EnableIPv6 enables IPv6 support for the memberlist
based hash ring.
type: boolean
type: object
type: object
images:
description: Images defines the image for each container.
properties:
Expand Down
13 changes: 13 additions & 0 deletions config/crd/bases/tempo.grafana.com_tempostacks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ spec:
spec:
description: TempoStackSpec defines the desired state of TempoStack.
properties:
hashRing:
description: HashRing defines the spec for the distributed hash ring
configuration.
properties:
memberlist:
description: MemberList configuration spec
properties:
enableIPv6:
description: EnableIPv6 enables IPv6 support for the memberlist
based hash ring.
type: boolean
type: object
type: object
images:
description: Images defines the image for each container.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ spec:
name: ""
version: v1
specDescriptors:
- description: HashRing defines the spec for the distributed hash ring configuration.
displayName: Hash Ring
path: hashRing
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: MemberList configuration spec
displayName: Memberlist Config
path: hashRing.memberlist
- description: EnableIPv6 enables IPv6 support for the memberlist based hash
ring.
displayName: Enable IPv6
path: hashRing.memberlist.enableIPv6
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Images defines the image for each container.
displayName: Container Images
path: images
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ spec:
name: ""
version: v1
specDescriptors:
- description: HashRing defines the spec for the distributed hash ring configuration.
displayName: Hash Ring
path: hashRing
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: MemberList configuration spec
displayName: Memberlist Config
path: hashRing.memberlist
- description: EnableIPv6 enables IPv6 support for the memberlist based hash
ring.
displayName: Enable IPv6
path: hashRing.memberlist.enableIPv6
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- description: Images defines the image for each container.
displayName: Container Images
path: images
Expand Down
Loading

0 comments on commit 5a79e61

Please sign in to comment.