Skip to content

Commit

Permalink
Add status field to TempoMonolithic CR (#787)
Browse files Browse the repository at this point in the history
* Add status field to TempoMonolithic CR

Signed-off-by: Andreas Gerstmayr <[email protected]>

* add changelog entry

Signed-off-by: Andreas Gerstmayr <[email protected]>

* add tests for getStatefulSetStatus

Signed-off-by: Andreas Gerstmayr <[email protected]>

* create ca configmap before tempo

Signed-off-by: Andreas Gerstmayr <[email protected]>

---------

Signed-off-by: Andreas Gerstmayr <[email protected]>
  • Loading branch information
andreasgerstmayr authored Feb 12, 2024
1 parent 46c037b commit 5d01d0a
Show file tree
Hide file tree
Showing 24 changed files with 1,244 additions and 95 deletions.
16 changes: 16 additions & 0 deletions .chloggen/monolithic_status.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: Expose operand status in TempoMonolithic CR

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

# (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:
5 changes: 5 additions & 0 deletions apis/tempo/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package v1alpha1

import corev1 "k8s.io/api/core/v1"

// PodStatusMap defines the type for mapping pod status to pod name.
type PodStatusMap map[corev1.PodPhase][]string

// TLSSpec is the TLS configuration.
type TLSSpec struct {
// Enabled defines if TLS is enabled.
Expand Down
22 changes: 20 additions & 2 deletions apis/tempo/v1alpha1/tempomonolithic_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,28 @@ type MonolithicJaegerUIRouteSpec struct {
Termination TLSRouteTerminationType `json:"termination,omitempty"`
}

// MonolithicComponentStatus defines the status of each component.
type MonolithicComponentStatus struct {
// Tempo is a map of the pod status of the Tempo pods.
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Tempo",xDescriptors="urn:alm:descriptor:com.tectonic.ui:podStatuses"
Tempo PodStatusMap `json:"tempo"`
}

// TempoMonolithicStatus defines the observed state of TempoMonolithic.
type TempoMonolithicStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
// Components provides summary of all Tempo pod status, grouped per component.
//
// +kubebuilder:validation:Optional
Components MonolithicComponentStatus `json:"components,omitempty"`

// Conditions of the Tempo deployment health.
//
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors="urn:alm:descriptor:io.kubernetes.conditions"
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down
5 changes: 1 addition & 4 deletions apis/tempo/v1alpha1/tempostack_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@ type GrafanaConfigSpec struct {
InstanceSelector metav1.LabelSelector `json:"instanceSelector,omitempty"`
}

// PodStatusMap defines the type for mapping pod status to pod name.
type PodStatusMap map[corev1.PodPhase][]string

// ComponentStatus defines the status of each component.
type ComponentStatus struct {
// Compactor is a map to the pod status of the compactor pod.
Expand Down Expand Up @@ -260,7 +257,7 @@ type ComponentStatus struct {
//
// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors="urn:alm:descriptor:com.tectonic.ui:podStatuses",displayName="Query Frontend",order=4
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors="urn:alm:descriptor:com.tectonic.ui:podStatuses",displayName="Gateway",order=6
Gateway PodStatusMap `json:"gateway"`
}

Expand Down
40 changes: 39 additions & 1 deletion 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 @@ -74,7 +74,7 @@ metadata:
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.8.0
createdAt: "2024-02-02T17:31:35Z"
createdAt: "2024-02-08T13:27:01Z"
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
Expand Down Expand Up @@ -321,6 +321,17 @@ spec:
path: storage.traces.size
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
statusDescriptors:
- description: Tempo is a map of the pod status of the Tempo pods.
displayName: Tempo
path: components.tempo
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podStatuses
- description: Conditions of the Tempo deployment health.
displayName: Conditions
path: conditions
x-descriptors:
- urn:alm:descriptor:io.kubernetes.conditions
version: v1alpha1
- description: TempoStack manages a Tempo deployment in microservices mode.
displayName: TempoStack
Expand Down Expand Up @@ -864,12 +875,6 @@ spec:
path: components.querier
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podStatuses
- description: Gateway is a map to the per pod status of the query frontend
deployment
displayName: Query Frontend
path: components.gateway
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podStatuses
- description: QueryFrontend is a map to the per pod status of the query frontend
deployment
displayName: Query Frontend
Expand All @@ -881,6 +886,12 @@ spec:
path: components.compactor
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podStatuses
- description: Gateway is a map to the per pod status of the query frontend
deployment
displayName: Gateway
path: components.gateway
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podStatuses
- description: Conditions of the Tempo deployment health.
displayName: Conditions
path: conditions
Expand Down
82 changes: 82 additions & 0 deletions bundle/community/manifests/tempo.grafana.com_tempomonolithics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,88 @@ spec:
type: object
status:
description: TempoMonolithicStatus defines the observed state of TempoMonolithic.
properties:
components:
description: Components provides summary of all Tempo pod status,
grouped per component.
properties:
tempo:
additionalProperties:
items:
type: string
type: array
description: Tempo is a map of the pod status of the Tempo pods.
type: object
type: object
conditions:
description: Conditions of the Tempo deployment health.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
use as an array at the field path .status.conditions. For example,
\n type FooStatus struct{ // Represents the observations of a
foo's current state. // Known .status.conditions.type are: \"Available\",
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
// +listType=map // +listMapKey=type Conditions []metav1.Condition
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be when
the underlying condition changed. If that is not known, then
using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating
details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if .metadata.generation
is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the current
state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition. Producers
of specific condition types may define expected values and
meanings for this field, and whether the values are considered
a guaranteed API. The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ metadata:
capabilities: Deep Insights
categories: Logging & Tracing,Monitoring
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.8.0
createdAt: "2024-02-02T17:31:33Z"
createdAt: "2024-02-08T13:26:59Z"
description: Create and manage deployments of Tempo, a high-scale distributed
tracing backend.
operatorframework.io/cluster-monitoring: "true"
Expand Down Expand Up @@ -321,6 +321,17 @@ spec:
path: storage.traces.size
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
statusDescriptors:
- description: Tempo is a map of the pod status of the Tempo pods.
displayName: Tempo
path: components.tempo
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podStatuses
- description: Conditions of the Tempo deployment health.
displayName: Conditions
path: conditions
x-descriptors:
- urn:alm:descriptor:io.kubernetes.conditions
version: v1alpha1
- description: TempoStack manages a Tempo deployment in microservices mode.
displayName: TempoStack
Expand Down Expand Up @@ -864,12 +875,6 @@ spec:
path: components.querier
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podStatuses
- description: Gateway is a map to the per pod status of the query frontend
deployment
displayName: Query Frontend
path: components.gateway
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podStatuses
- description: QueryFrontend is a map to the per pod status of the query frontend
deployment
displayName: Query Frontend
Expand All @@ -881,6 +886,12 @@ spec:
path: components.compactor
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podStatuses
- description: Gateway is a map to the per pod status of the query frontend
deployment
displayName: Gateway
path: components.gateway
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:podStatuses
- description: Conditions of the Tempo deployment health.
displayName: Conditions
path: conditions
Expand Down
Loading

0 comments on commit 5d01d0a

Please sign in to comment.