Skip to content

Commit

Permalink
Support creating Ingress and Route objects in the TempoMonolithic CR (#…
Browse files Browse the repository at this point in the history
…755)

Signed-off-by: Andreas Gerstmayr <[email protected]>
  • Loading branch information
andreasgerstmayr authored Jan 31, 2024
1 parent 37ac629 commit 5f2a83c
Show file tree
Hide file tree
Showing 14 changed files with 644 additions and 8 deletions.
6 changes: 6 additions & 0 deletions apis/tempo/v1alpha1/tempomonolithic_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,10 @@ func (r *TempoMonolithic) Default() {
Enabled: true,
}
}

if r.Spec.JaegerUI != nil && r.Spec.JaegerUI.Enabled &&
r.Spec.JaegerUI.Route != nil && r.Spec.JaegerUI.Route.Enabled &&
r.Spec.JaegerUI.Route.Termination == "" {
r.Spec.JaegerUI.Route.Termination = "edge"
}
}
33 changes: 33 additions & 0 deletions apis/tempo/v1alpha1/tempomonolithic_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,23 @@ type MonolithicJaegerUIIngressSpec struct {
//
// +kubebuilder:validation:Required
Enabled bool `json:"enabled"`

// Annotations defines the annotations of the Ingress object.
//
// +kubebuilder:validation:Optional
Annotations map[string]string `json:"annotations,omitempty"`

// Host defines the hostname of the Ingress object.
//
// +kubebuilder:validation:Optional
Host string `json:"host,omitempty"`

// IngressClassName is the name of an IngressClass cluster resource. Ingress
// controller implementations use this field to know whether they should be
// serving this Ingress resource.
//
// +kubebuilder:validation:Optional
IngressClassName *string `json:"ingressClassName,omitempty"`
}

// MonolithicJaegerUIRouteSpec defines the settings for the Jaeger UI route.
Expand All @@ -165,6 +182,22 @@ type MonolithicJaegerUIRouteSpec struct {
//
// +kubebuilder:validation:Required
Enabled bool `json:"enabled"`

// Annotations defines the annotations of the Route object.
//
// +kubebuilder:validation:Optional
Annotations map[string]string `json:"annotations,omitempty"`

// Host defines the hostname of the Route object.
//
// +kubebuilder:validation:Optional
Host string `json:"host,omitempty"`

// Termination specifies the termination type. Default: edge.
//
// +kubebuilder:validation:Optional
// +kubebuilder:default=edge
Termination TLSRouteTerminationType `json:"termination,omitempty"`
}

// MonolithicObservabilitySpec defines the observability settings of the Tempo deployment.
Expand Down
23 changes: 21 additions & 2 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 @@ -56,7 +56,7 @@ metadata:
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.7.0
createdAt: "2024-01-26T12:10:07Z"
createdAt: "2024-01-26T16:53:19Z"
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
Expand Down
34 changes: 34 additions & 0 deletions bundle/community/manifests/tempo.grafana.com_tempomonolithics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,55 @@ spec:
description: Ingress defines the ingress configuration for Jaeger
UI
properties:
annotations:
additionalProperties:
type: string
description: Annotations defines the annotations of the Ingress
object.
type: object
enabled:
description: Enabled defines if an Ingress object should be
created for Jaeger UI
type: boolean
host:
description: Host defines the hostname of the Ingress object.
type: string
ingressClassName:
description: IngressClassName is the name of an IngressClass
cluster resource. Ingress controller implementations use
this field to know whether they should be serving this Ingress
resource.
type: string
required:
- enabled
type: object
route:
description: Route defines the route configuration for Jaeger
UI
properties:
annotations:
additionalProperties:
type: string
description: Annotations defines the annotations of the Route
object.
type: object
enabled:
description: Enabled defines if a Route object should be created
for Jaeger UI
type: boolean
host:
description: Host defines the hostname of the Route object.
type: string
termination:
default: edge
description: 'Termination specifies the termination type.
Default: edge.'
enum:
- insecure
- edge
- passthrough
- reencrypt
type: string
required:
- enabled
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ metadata:
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.7.0
createdAt: "2024-01-26T12:10:06Z"
createdAt: "2024-01-26T16:53:17Z"
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
Expand Down
34 changes: 34 additions & 0 deletions bundle/openshift/manifests/tempo.grafana.com_tempomonolithics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,55 @@ spec:
description: Ingress defines the ingress configuration for Jaeger
UI
properties:
annotations:
additionalProperties:
type: string
description: Annotations defines the annotations of the Ingress
object.
type: object
enabled:
description: Enabled defines if an Ingress object should be
created for Jaeger UI
type: boolean
host:
description: Host defines the hostname of the Ingress object.
type: string
ingressClassName:
description: IngressClassName is the name of an IngressClass
cluster resource. Ingress controller implementations use
this field to know whether they should be serving this Ingress
resource.
type: string
required:
- enabled
type: object
route:
description: Route defines the route configuration for Jaeger
UI
properties:
annotations:
additionalProperties:
type: string
description: Annotations defines the annotations of the Route
object.
type: object
enabled:
description: Enabled defines if a Route object should be created
for Jaeger UI
type: boolean
host:
description: Host defines the hostname of the Route object.
type: string
termination:
default: edge
description: 'Termination specifies the termination type.
Default: edge.'
enum:
- insecure
- edge
- passthrough
- reencrypt
type: string
required:
- enabled
type: object
Expand Down
34 changes: 34 additions & 0 deletions config/crd/bases/tempo.grafana.com_tempomonolithics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,55 @@ spec:
description: Ingress defines the ingress configuration for Jaeger
UI
properties:
annotations:
additionalProperties:
type: string
description: Annotations defines the annotations of the Ingress
object.
type: object
enabled:
description: Enabled defines if an Ingress object should be
created for Jaeger UI
type: boolean
host:
description: Host defines the hostname of the Ingress object.
type: string
ingressClassName:
description: IngressClassName is the name of an IngressClass
cluster resource. Ingress controller implementations use
this field to know whether they should be serving this Ingress
resource.
type: string
required:
- enabled
type: object
route:
description: Route defines the route configuration for Jaeger
UI
properties:
annotations:
additionalProperties:
type: string
description: Annotations defines the annotations of the Route
object.
type: object
enabled:
description: Enabled defines if a Route object should be created
for Jaeger UI
type: boolean
host:
description: Host defines the hostname of the Route object.
type: string
termination:
default: edge
description: 'Termination specifies the termination type.
Default: edge.'
enum:
- insecure
- edge
- passthrough
- reencrypt
type: string
required:
- enabled
type: object
Expand Down
11 changes: 8 additions & 3 deletions controllers/tempo/tempomonolithic_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,16 @@ func (r *TempoMonolithicReconciler) getOwnedObjects(ctx context.Context, tempo v

// SetupWithManager sets up the controller with the Manager.
func (r *TempoMonolithicReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
builder := ctrl.NewControllerManagedBy(mgr).
For(&v1alpha1.TempoMonolithic{}).
Owns(&corev1.ConfigMap{}).
Owns(&corev1.Service{}).
Owns(&appsv1.StatefulSet{}).
Owns(&networkingv1.Ingress{}).
Complete(r)
Owns(&networkingv1.Ingress{})

if r.CtrlConfig.Gates.OpenShift.OpenShiftRoute {
builder = builder.Owns(&routev1.Route{})
}

return builder.Complete(r)
}
Loading

0 comments on commit 5f2a83c

Please sign in to comment.