diff --git a/.chloggen/ipv6_support.yaml b/.chloggen/ipv6_support.yaml new file mode 100755 index 000000000..97540a58d --- /dev/null +++ b/.chloggen/ipv6_support.yaml @@ -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: diff --git a/apis/tempo/v1alpha1/tempostack_types.go b/apis/tempo/v1alpha1/tempostack_types.go index fd61d8bbf..2e70d382b 100644 --- a/apis/tempo/v1alpha1/tempostack_types.go +++ b/apis/tempo/v1alpha1/tempostack_types.go @@ -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 @@ -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"` diff --git a/apis/tempo/v1alpha1/tempostack_webhook.go b/apis/tempo/v1alpha1/tempostack_webhook.go index dfeb843a2..36d78aa96 100644 --- a/apis/tempo/v1alpha1/tempostack_webhook.go +++ b/apis/tempo/v1alpha1/tempostack_webhook.go @@ -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" ) @@ -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 } diff --git a/apis/tempo/v1alpha1/zz_generated.deepcopy.go b/apis/tempo/v1alpha1/zz_generated.deepcopy.go index 1c43f274d..c6870d8e1 100644 --- a/apis/tempo/v1alpha1/zz_generated.deepcopy.go +++ b/apis/tempo/v1alpha1/zz_generated.deepcopy.go @@ -197,6 +197,22 @@ func (in *GrafanaConfigSpec) DeepCopy() *GrafanaConfigSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HashRingSpec) DeepCopyInto(out *HashRingSpec) { + *out = *in + in.MemberList.DeepCopyInto(&out.MemberList) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HashRingSpec. +func (in *HashRingSpec) DeepCopy() *HashRingSpec { + if in == nil { + return nil + } + out := new(HashRingSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IngestionLimitSpec) DeepCopyInto(out *IngestionLimitSpec) { *out = *in @@ -315,6 +331,26 @@ func (in *LimitSpec) DeepCopy() *LimitSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MemberListSpec) DeepCopyInto(out *MemberListSpec) { + *out = *in + if in.EnableIPv6 != nil { + in, out := &in.EnableIPv6, &out.EnableIPv6 + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberListSpec. +func (in *MemberListSpec) DeepCopy() *MemberListSpec { + if in == nil { + return nil + } + out := new(MemberListSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MetricsConfigSpec) DeepCopyInto(out *MetricsConfigSpec) { *out = *in @@ -826,6 +862,7 @@ func (in *TempoStackSpec) DeepCopyInto(out *TempoStackSpec) { out.Storage = in.Storage in.Retention.DeepCopyInto(&out.Retention) in.SearchSpec.DeepCopyInto(&out.SearchSpec) + in.HashRing.DeepCopyInto(&out.HashRing) in.Template.DeepCopyInto(&out.Template) if in.Tenants != nil { in, out := &in.Tenants, &out.Tenants diff --git a/bundle/community/manifests/tempo-operator.clusterserviceversion.yaml b/bundle/community/manifests/tempo-operator.clusterserviceversion.yaml index 7c1e623a2..ec116d436 100644 --- a/bundle/community/manifests/tempo-operator.clusterserviceversion.yaml +++ b/bundle/community/manifests/tempo-operator.clusterserviceversion.yaml @@ -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" @@ -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 diff --git a/bundle/community/manifests/tempo.grafana.com_tempostacks.yaml b/bundle/community/manifests/tempo.grafana.com_tempostacks.yaml index 65268a8f6..f220ce08c 100644 --- a/bundle/community/manifests/tempo.grafana.com_tempostacks.yaml +++ b/bundle/community/manifests/tempo.grafana.com_tempostacks.yaml @@ -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: diff --git a/bundle/openshift/manifests/tempo-operator.clusterserviceversion.yaml b/bundle/openshift/manifests/tempo-operator.clusterserviceversion.yaml index c72ff7b77..7823c12df 100644 --- a/bundle/openshift/manifests/tempo-operator.clusterserviceversion.yaml +++ b/bundle/openshift/manifests/tempo-operator.clusterserviceversion.yaml @@ -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" @@ -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 diff --git a/bundle/openshift/manifests/tempo.grafana.com_tempostacks.yaml b/bundle/openshift/manifests/tempo.grafana.com_tempostacks.yaml index 65268a8f6..f220ce08c 100644 --- a/bundle/openshift/manifests/tempo.grafana.com_tempostacks.yaml +++ b/bundle/openshift/manifests/tempo.grafana.com_tempostacks.yaml @@ -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: diff --git a/config/crd/bases/tempo.grafana.com_tempostacks.yaml b/config/crd/bases/tempo.grafana.com_tempostacks.yaml index 95d817acd..f1c62b73b 100644 --- a/config/crd/bases/tempo.grafana.com_tempostacks.yaml +++ b/config/crd/bases/tempo.grafana.com_tempostacks.yaml @@ -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: diff --git a/config/manifests/community/bases/tempo-operator.clusterserviceversion.yaml b/config/manifests/community/bases/tempo-operator.clusterserviceversion.yaml index 1758e4ef3..1c3e00cd5 100644 --- a/config/manifests/community/bases/tempo-operator.clusterserviceversion.yaml +++ b/config/manifests/community/bases/tempo-operator.clusterserviceversion.yaml @@ -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 diff --git a/config/manifests/openshift/bases/tempo-operator.clusterserviceversion.yaml b/config/manifests/openshift/bases/tempo-operator.clusterserviceversion.yaml index 1758e4ef3..1c3e00cd5 100644 --- a/config/manifests/openshift/bases/tempo-operator.clusterserviceversion.yaml +++ b/config/manifests/openshift/bases/tempo-operator.clusterserviceversion.yaml @@ -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 diff --git a/docs/operator/api.md b/docs/operator/api.md index 97c8a532f..c98cb5645 100644 --- a/docs/operator/api.md +++ b/docs/operator/api.md @@ -651,6 +651,66 @@ Kubernetes meta/v1.LabelSelector +## HashRingSpec { #tempo-grafana-com-v1alpha1-HashRingSpec } + +
+ +(Appears on:TempoStackSpec) + +
+ +HashRingSpec defines the hash ring configuration.
+ +Field | + +Description | + +
---|---|
+
+memberlist + + + + + +MemberListSpec + + + + + + |
+
+
+
+(Optional)
+
+ MemberList configuration spec + + |
+
@@ -1310,6 +1370,62 @@ reconciled by the operator.
+## MemberListSpec { #tempo-grafana-com-v1alpha1-MemberListSpec } + ++ +(Appears on:HashRingSpec) + +
+ +MemberListSpec defines the configuration for the memberlist based hash ring.
+ +Field | + +Description | + +
---|---|
+
+enableIPv6 + + + +bool + + + + |
+
+
+
+(Optional)
+
+ EnableIPv6 enables IPv6 support for the memberlist based hash ring. + + |
+
@@ -3903,6 +4019,33 @@ SearchSpec
hashRing
HashRing defines the spec for the distributed hash ring configuration.
+ +template