Skip to content

Add CRD scaffolding for cluster observability / signal manager #748

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

Merged
merged 1 commit into from
May 22, 2025
Merged
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-19T10:04:30Z"
createdAt: "2025-05-22T15:10:07Z"
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 @@ -511,23 +511,33 @@ spec:
- apiGroups:
- observability.openshift.io
resources:
- uiplugins
- clusterobservability
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- observability.openshift.io
resources:
- clusterobservability/finalizers
- clusterobservability/status
- uiplugins/finalizers
- uiplugins/status
verbs:
- get
- update
- apiGroups:
- observability.openshift.io
resources:
- uiplugins
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- operator.openshift.io
resources:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.2
name: clusterobservabilities.observability.openshift.io
spec:
group: observability.openshift.io
names:
kind: ClusterObservability
listKind: ClusterObservabilityList
plural: clusterobservabilities
singular: clusterobservability
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: ClusterObservability defines the desired state of the observability
stack.
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: Spec defines the desired state of the cluster observability.
type: object
status:
description: Status of the signal manager.
type: object
type: object
served: true
storage: true
subresources:
status: {}
20 changes: 15 additions & 5 deletions deploy/operator/observability-operator-cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,23 +226,33 @@ rules:
- apiGroups:
- observability.openshift.io
resources:
- uiplugins
- clusterobservability
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- observability.openshift.io
resources:
- clusterobservability/finalizers
- clusterobservability/status
- uiplugins/finalizers
- uiplugins/status
verbs:
- get
- update
- apiGroups:
- observability.openshift.io
resources:
- uiplugins
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- operator.openshift.io
resources:
Expand Down
55 changes: 55 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3984,11 +3984,66 @@ Reference to the TLS private key for the web server.

Resource Types:

- [ClusterObservability](#clusterobservability)

- [UIPlugin](#uiplugin)




## ClusterObservability
<sup><sup>[↩ Parent](#observabilityopenshiftiov1alpha1 )</sup></sup>






ClusterObservability defines the desired state of the observability stack.

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>apiVersion</b></td>
<td>string</td>
<td>observability.openshift.io/v1alpha1</td>
<td>true</td>
</tr>
<tr>
<td><b>kind</b></td>
<td>string</td>
<td>ClusterObservability</td>
<td>true</td>
</tr>
<tr>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#objectmeta-v1-meta">metadata</a></b></td>
<td>object</td>
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td>
<td>true</td>
</tr><tr>
<td><b>spec</b></td>
<td>object</td>
<td>
Spec defines the desired state of the cluster observability.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>status</b></td>
<td>object</td>
<td>
Status of the signal manager.<br/>
</td>
<td>false</td>
</tr></tbody>
</table>

## UIPlugin
<sup><sup>[↩ Parent](#observabilityopenshiftiov1alpha1 )</sup></sup>

Expand Down
23 changes: 23 additions & 0 deletions pkg/apis/observability/v1alpha1/register.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// +kubebuilder:object:generate=true
// +groupName=observability.openshift.io
package v1alpha1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "observability.openshift.io", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)

func init() {
SchemeBuilder.Register(&ClusterObservability{}, &ClusterObservabilityList{})
}
43 changes: 43 additions & 0 deletions pkg/apis/observability/v1alpha1/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// +groupName=observability.openshift.io
// +kubebuilder:rbac:groups=observability.openshift.io,resources=clusterobservability,verbs=list;get;watch
// +kubebuilder:rbac:groups=observability.openshift.io,resources=clusterobservability/status;clusterobservability/finalizers,verbs=get;update
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// ClusterObservability defines the desired state of the observability stack.
//
// +k8s:openapi-gen=true
// +kubebuilder:object:root=true
// +kubebuilder:resource:shortName=clobs;clobs
// +kubebuilder:resource:scope=Cluster
// +kubebuilder:subresource:status
// +operator-sdk:csv:customresourcedefinitions:displayName="Cluster Observability"
type ClusterObservability struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Spec defines the desired state of the cluster observability.
Spec ClusterObservabilitySpec `json:"spec,omitempty"`

// Status of the signal manager.
Status ClusterObservabilityStatus `json:"status,omitempty"`
}

// +kubebuilder:resource
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ClusterObservabilityList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterObservability `json:"items"`
}

type ClusterObservabilitySpec struct {
}

// ClusterObservabilityStatus defines the observed state of ClusterObservability.
type ClusterObservabilityStatus struct{}
114 changes: 114 additions & 0 deletions pkg/apis/observability/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading