Skip to content

Commit 3b5f246

Browse files
committed
feat: add CRD scaffolding for cluster observability / signal manager
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
1 parent a3d2d47 commit 3b5f246

File tree

7 files changed

+316
-11
lines changed

7 files changed

+316
-11
lines changed

bundle/manifests/observability-operator.clusterserviceversion.yaml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ metadata:
4242
categories: Monitoring
4343
certified: "false"
4444
containerImage: observability-operator:1.2.0
45-
createdAt: "2025-05-19T10:04:30Z"
45+
createdAt: "2025-05-22T15:10:07Z"
4646
description: A Go based Kubernetes operator to setup and manage highly available
4747
Monitoring Stack using Prometheus, Alertmanager and Thanos Querier.
4848
operatorframework.io/cluster-monitoring: "true"
@@ -511,23 +511,33 @@ spec:
511511
- apiGroups:
512512
- observability.openshift.io
513513
resources:
514-
- uiplugins
514+
- clusterobservability
515515
verbs:
516-
- create
517-
- delete
518516
- get
519517
- list
520-
- patch
521-
- update
522518
- watch
523519
- apiGroups:
524520
- observability.openshift.io
525521
resources:
522+
- clusterobservability/finalizers
523+
- clusterobservability/status
526524
- uiplugins/finalizers
527525
- uiplugins/status
528526
verbs:
529527
- get
530528
- update
529+
- apiGroups:
530+
- observability.openshift.io
531+
resources:
532+
- uiplugins
533+
verbs:
534+
- create
535+
- delete
536+
- get
537+
- list
538+
- patch
539+
- update
540+
- watch
531541
- apiGroups:
532542
- operator.openshift.io
533543
resources:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.16.2
7+
name: clusterobservabilities.observability.openshift.io
8+
spec:
9+
group: observability.openshift.io
10+
names:
11+
kind: ClusterObservability
12+
listKind: ClusterObservabilityList
13+
plural: clusterobservabilities
14+
singular: clusterobservability
15+
scope: Cluster
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: ClusterObservability defines the desired state of the observability
21+
stack.
22+
properties:
23+
apiVersion:
24+
description: |-
25+
APIVersion defines the versioned schema of this representation of an object.
26+
Servers should convert recognized schemas to the latest internal value, and
27+
may reject unrecognized values.
28+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
29+
type: string
30+
kind:
31+
description: |-
32+
Kind is a string value representing the REST resource this object represents.
33+
Servers may infer this from the endpoint the client submits requests to.
34+
Cannot be updated.
35+
In CamelCase.
36+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
37+
type: string
38+
metadata:
39+
type: object
40+
spec:
41+
description: Spec defines the desired state of the cluster observability.
42+
type: object
43+
status:
44+
description: Status of the signal manager.
45+
type: object
46+
type: object
47+
served: true
48+
storage: true
49+
subresources:
50+
status: {}

deploy/operator/observability-operator-cluster-role.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,23 +226,33 @@ rules:
226226
- apiGroups:
227227
- observability.openshift.io
228228
resources:
229-
- uiplugins
229+
- clusterobservability
230230
verbs:
231-
- create
232-
- delete
233231
- get
234232
- list
235-
- patch
236-
- update
237233
- watch
238234
- apiGroups:
239235
- observability.openshift.io
240236
resources:
237+
- clusterobservability/finalizers
238+
- clusterobservability/status
241239
- uiplugins/finalizers
242240
- uiplugins/status
243241
verbs:
244242
- get
245243
- update
244+
- apiGroups:
245+
- observability.openshift.io
246+
resources:
247+
- uiplugins
248+
verbs:
249+
- create
250+
- delete
251+
- get
252+
- list
253+
- patch
254+
- update
255+
- watch
246256
- apiGroups:
247257
- operator.openshift.io
248258
resources:

docs/api.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3984,11 +3984,66 @@ Reference to the TLS private key for the web server.
39843984

39853985
Resource Types:
39863986

3987+
- [ClusterObservability](#clusterobservability)
3988+
39873989
- [UIPlugin](#uiplugin)
39883990

39893991

39903992

39913993

3994+
## ClusterObservability
3995+
<sup><sup>[↩ Parent](#observabilityopenshiftiov1alpha1 )</sup></sup>
3996+
3997+
3998+
3999+
4000+
4001+
4002+
ClusterObservability defines the desired state of the observability stack.
4003+
4004+
<table>
4005+
<thead>
4006+
<tr>
4007+
<th>Name</th>
4008+
<th>Type</th>
4009+
<th>Description</th>
4010+
<th>Required</th>
4011+
</tr>
4012+
</thead>
4013+
<tbody><tr>
4014+
<td><b>apiVersion</b></td>
4015+
<td>string</td>
4016+
<td>observability.openshift.io/v1alpha1</td>
4017+
<td>true</td>
4018+
</tr>
4019+
<tr>
4020+
<td><b>kind</b></td>
4021+
<td>string</td>
4022+
<td>ClusterObservability</td>
4023+
<td>true</td>
4024+
</tr>
4025+
<tr>
4026+
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#objectmeta-v1-meta">metadata</a></b></td>
4027+
<td>object</td>
4028+
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td>
4029+
<td>true</td>
4030+
</tr><tr>
4031+
<td><b>spec</b></td>
4032+
<td>object</td>
4033+
<td>
4034+
Spec defines the desired state of the cluster observability.<br/>
4035+
</td>
4036+
<td>false</td>
4037+
</tr><tr>
4038+
<td><b>status</b></td>
4039+
<td>object</td>
4040+
<td>
4041+
Status of the signal manager.<br/>
4042+
</td>
4043+
<td>false</td>
4044+
</tr></tbody>
4045+
</table>
4046+
39924047
## UIPlugin
39934048
<sup><sup>[↩ Parent](#observabilityopenshiftiov1alpha1 )</sup></sup>
39944049

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// +kubebuilder:object:generate=true
2+
// +groupName=observability.openshift.io
3+
package v1alpha1
4+
5+
import (
6+
"k8s.io/apimachinery/pkg/runtime/schema"
7+
"sigs.k8s.io/controller-runtime/pkg/scheme"
8+
)
9+
10+
var (
11+
// GroupVersion is group version used to register these objects
12+
GroupVersion = schema.GroupVersion{Group: "observability.openshift.io", Version: "v1alpha1"}
13+
14+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
15+
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
16+
17+
// AddToScheme adds the types in this group-version to the given scheme.
18+
AddToScheme = SchemeBuilder.AddToScheme
19+
)
20+
21+
func init() {
22+
SchemeBuilder.Register(&ClusterObservability{}, &ClusterObservabilityList{})
23+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// +groupName=observability.openshift.io
2+
// +kubebuilder:rbac:groups=observability.openshift.io,resources=clusterobservability,verbs=list;get;watch
3+
// +kubebuilder:rbac:groups=observability.openshift.io,resources=clusterobservability/status;clusterobservability/finalizers,verbs=get;update
4+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
5+
6+
package v1alpha1
7+
8+
import (
9+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
10+
)
11+
12+
// ClusterObservability defines the desired state of the observability stack.
13+
//
14+
// +k8s:openapi-gen=true
15+
// +kubebuilder:object:root=true
16+
// +kubebuilder:resource:shortName=clobs;clobs
17+
// +kubebuilder:resource:scope=Cluster
18+
// +kubebuilder:subresource:status
19+
// +operator-sdk:csv:customresourcedefinitions:displayName="Cluster Observability"
20+
type ClusterObservability struct {
21+
metav1.TypeMeta `json:",inline"`
22+
metav1.ObjectMeta `json:"metadata,omitempty"`
23+
24+
// Spec defines the desired state of the cluster observability.
25+
Spec ClusterObservabilitySpec `json:"spec,omitempty"`
26+
27+
// Status of the signal manager.
28+
Status ClusterObservabilityStatus `json:"status,omitempty"`
29+
}
30+
31+
// +kubebuilder:resource
32+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
33+
type ClusterObservabilityList struct {
34+
metav1.TypeMeta `json:",inline"`
35+
metav1.ListMeta `json:"metadata,omitempty"`
36+
Items []ClusterObservability `json:"items"`
37+
}
38+
39+
type ClusterObservabilitySpec struct {
40+
}
41+
42+
// ClusterObservabilityStatus defines the observed state of ClusterObservability.
43+
type ClusterObservabilityStatus struct{}

pkg/apis/observability/v1alpha1/zz_generated.deepcopy.go

Lines changed: 114 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)