Skip to content

feat: add controller for clusterobservability #784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ metadata:
categories: Monitoring
certified: "false"
containerImage: observability-operator:1.2.0
createdAt: "2025-05-26T07:04:40Z"
createdAt: "2025-06-20T11:57:18Z"
description: A Go based Kubernetes operator to setup and manage highly available
Monitoring Stack using Prometheus, Alertmanager and Thanos Querier.
operatorframework.io/cluster-monitoring: "true"
Expand Down Expand Up @@ -293,6 +293,7 @@ spec:
- ""
resources:
- configmaps
- namespaces
- secrets
- serviceaccounts
- services
Expand All @@ -309,7 +310,6 @@ spec:
resources:
- endpoints
- events
- namespaces
- nodes
- persistentvolumeclaims
- persistentvolumes
Expand Down Expand Up @@ -511,25 +511,38 @@ spec:
- apiGroups:
- observability.openshift.io
resources:
- clusterobservability
- clusterobservabilities
- uiplugins
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- observability.openshift.io
resources:
- clusterobservability/finalizers
- clusterobservability/status
- clusterobservabilities/finalizers
- clusterobservabilities/status
verbs:
- delete
- get
- patch
- update
- apiGroups:
- observability.openshift.io
resources:
- uiplugins/finalizers
- uiplugins/status
verbs:
- get
- update
- apiGroups:
- observability.openshift.io
- opentelemetry.io
resources:
- uiplugins
- opentelemetrycollectors
verbs:
- create
- delete
Expand All @@ -538,6 +551,14 @@ spec:
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors/status
verbs:
- get
- list
- watch
- apiGroups:
- operator.openshift.io
resources:
Expand All @@ -547,6 +568,19 @@ spec:
- list
- patch
- watch
- apiGroups:
- operators.coreos.com
resources:
- clusterserviceversions
- subscriptions
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- perses.dev
resources:
Expand Down Expand Up @@ -624,13 +658,40 @@ spec:
- get
- list
- watch
- apiGroups:
- tempo.grafana.com
resourceNames:
- traces
resources:
- prod
verbs:
- create
- apiGroups:
- tempo.grafana.com
resources:
- tempomonolithics
verbs:
- list
- apiGroups:
- tempo.grafana.com
resources:
- tempostacks
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- tempo.grafana.com
resources:
- tempostacks/status
verbs:
- get
- list
- watch
serviceAccountName: observability-operator-sa
- rules:
- apiGroups:
Expand Down
14 changes: 14 additions & 0 deletions cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ import (
"github.com/rhobs/observability-operator/pkg/operator"
)

const (
opentelemetryCSV = "opentelemetry-operator.v0.127.0-1"
tempoCSV = "tempo-operator.v0.16.0-1"
)

// The default values we use. Prometheus and Alertmanager are handled by
// prometheus-operator. For thanos we use the default version from
// prometheus-operator.
Expand Down Expand Up @@ -88,6 +93,8 @@ func main() {
metricsAddr string
healthProbeAddr string
openShiftEnabled bool
otelCSVName string
tempoCSVName string

setupLog = ctrl.Log.WithName("setup")
)
Expand All @@ -98,6 +105,8 @@ func main() {
flag.StringVar(&healthProbeAddr, "health-probe-bind-address", ":8081", "The address the health probe endpoint binds to.")
flag.Var(images, "images", fmt.Sprintf("Full images refs to use for containers managed by the operator. E.g thanos=quay.io/thanos/thanos:v0.33.0. Images used are %v", imagesUsed()))
flag.BoolVar(&openShiftEnabled, "openshift.enabled", false, "Enable OpenShift specific features such as Console Plugins.")
flag.StringVar(&otelCSVName, "opentelemetry-csv", opentelemetryCSV, "OpenTelemetry Operator starting CSV name. This is used to install the OpenTelemetry Operator in the cluster.")
flag.StringVar(&tempoCSVName, "tempo-csv", tempoCSV, "Tempo Operator starting CSV name. This is used to install the Tempo Operator in the cluster.")

opts := zap.Options{
Development: true,
Expand Down Expand Up @@ -134,6 +143,11 @@ func main() {
operator.WithThanosSidecarImage(imgMap["thanos"]),
operator.WithThanosQuerierImage(imgMap["thanos"]),
operator.WithUIPluginImages(imgMap),
operator.WithClusterObservability(operator.ClusterObservabilityConfiguration{
COONamespace: os.Getenv("NAMESPACE"),
OpenTelemetryCSV: otelCSVName,
TempoCSV: tempoCSVName,
}),
operator.WithFeatureGates(operator.FeatureGates{
OpenShift: operator.OpenShiftFeatureGates{
Enabled: openShiftEnabled,
Expand Down
1 change: 1 addition & 0 deletions deploy/crds/common/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ resources:
- monitoring.rhobs_monitoringstacks.yaml
- monitoring.rhobs_thanosqueriers.yaml
- observability.openshift.io_uiplugins.yaml
# - observability.openshift.io_clusterobservabilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ spec:
singular: clusterobservability
scope: Cluster
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.opentelemetry
name: OpenTelemetry
type: string
- jsonPath: .status.tempo
name: Tempo
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: ClusterObservability defines the desired state of the observability
Expand Down Expand Up @@ -49,9 +56,8 @@ spec:
description: OpenTelemetry defines the OpenTelemetry capabilities.
properties:
enabled:
default: false
description: |-
Enabled indicates whether the capability is enabled and it operator should deploy an instance.
Enabled indicates whether the capability is enabled and whether the operator should deploy an instance.
By default, it is set to false.
type: boolean
exporter:
Expand All @@ -78,9 +84,8 @@ spec:
description: Tracing defines the tracing capabilities.
properties:
enabled:
default: false
description: |-
Enabled indicates whether the capability is enabled and it operator should deploy an instance.
Enabled indicates whether the capability is enabled and whether the operator should deploy an instance.
By default, it is set to false.
type: boolean
operators:
Expand All @@ -105,11 +110,31 @@ spec:
name:
description: Name is the name of the secret for the storage.
type: string
type:
description: Type is the type of the secret for the storage.
type: string
type: object
type: object
type: object
status:
description: Status of the signal manager.
properties:
conditions:
description: Conditions provide status information about the instance.
items:
properties:
message:
type: string
type: object
type: array
x-kubernetes-list-type: atomic
opentelemetry:
description: OpenTelemetry defines the status of the OpenTelemetry
capability.
type: string
tempo:
description: Tempo defines the status of the Tempo capability.
type: string
type: object
type: object
served: true
Expand Down
73 changes: 67 additions & 6 deletions deploy/operator/observability-operator-cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rules:
- ""
resources:
- configmaps
- namespaces
- secrets
- serviceaccounts
- services
Expand All @@ -24,7 +25,6 @@ rules:
resources:
- endpoints
- events
- namespaces
- nodes
- persistentvolumeclaims
- persistentvolumes
Expand Down Expand Up @@ -226,25 +226,38 @@ rules:
- apiGroups:
- observability.openshift.io
resources:
- clusterobservability
- clusterobservabilities
- uiplugins
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- observability.openshift.io
resources:
- clusterobservability/finalizers
- clusterobservability/status
- clusterobservabilities/finalizers
- clusterobservabilities/status
verbs:
- delete
- get
- patch
- update
- apiGroups:
- observability.openshift.io
resources:
- uiplugins/finalizers
- uiplugins/status
verbs:
- get
- update
- apiGroups:
- observability.openshift.io
- opentelemetry.io
resources:
- uiplugins
- opentelemetrycollectors
verbs:
- create
- delete
Expand All @@ -253,6 +266,14 @@ rules:
- patch
- update
- watch
- apiGroups:
- opentelemetry.io
resources:
- opentelemetrycollectors/status
verbs:
- get
- list
- watch
- apiGroups:
- operator.openshift.io
resources:
Expand All @@ -262,6 +283,19 @@ rules:
- list
- patch
- watch
- apiGroups:
- operators.coreos.com
resources:
- clusterserviceversions
- subscriptions
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- perses.dev
resources:
Expand Down Expand Up @@ -339,10 +373,37 @@ rules:
- get
- list
- watch
- apiGroups:
- tempo.grafana.com
resourceNames:
- traces
resources:
- prod
verbs:
- create
- apiGroups:
- tempo.grafana.com
resources:
- tempomonolithics
verbs:
- list
- apiGroups:
- tempo.grafana.com
resources:
- tempostacks
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- tempo.grafana.com
resources:
- tempostacks/status
verbs:
- get
- list
- watch
Loading
Loading