Skip to content

Commit 72f67ee

Browse files
committed
WIP: SignalManager API to install signal stacks.
First draft of API for initial review.
1 parent 08ec7ed commit 72f67ee

File tree

13 files changed

+1216
-23
lines changed

13 files changed

+1216
-23
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ check-jq:
4343
jq --version > /dev/null
4444

4545
.PHONY: docs
46-
docs: $(CRDOC)
46+
docs: $(CRDOC) generate-crds
4747
mkdir -p docs
4848
$(CRDOC) --resources deploy/crds/common --output docs/api.md
4949

bundle/manifests/observability-operator.clusterserviceversion.yaml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ metadata:
4141
capabilities: Basic Install
4242
categories: Monitoring
4343
certified: "false"
44-
containerImage: observability-operator:1.0.0
45-
createdAt: "2025-03-03T08:38:22Z"
44+
containerImage: grover.home:5000/alanconway/observability-operator:3.3.3
45+
createdAt: "2025-04-10T17:19:16Z"
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"
@@ -58,7 +58,7 @@ metadata:
5858
]
5959
operators.operatorframework.io/project_layout: unknown
6060
repository: https://github.com/rhobs/observability-operator
61-
name: observability-operator.v1.0.0
61+
name: observability-operator.v3.3.3
6262
namespace: placeholder
6363
spec:
6464
apiservicedefinitions: {}
@@ -511,23 +511,33 @@ spec:
511511
- apiGroups:
512512
- observability.openshift.io
513513
resources:
514-
- uiplugins
514+
- signalmanagers
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+
- signalmanagers/finalizers
523+
- signalmanagers/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:
@@ -917,7 +927,7 @@ spec:
917927
valueFrom:
918928
fieldRef:
919929
fieldPath: metadata.namespace
920-
image: observability-operator:1.0.0
930+
image: grover.home:5000/alanconway/observability-operator:3.3.3
921931
imagePullPolicy: Always
922932
livenessProbe:
923933
httpGet:
@@ -1045,7 +1055,7 @@ spec:
10451055
maturity: alpha
10461056
provider:
10471057
name: Red Hat
1048-
version: 1.0.0
1058+
version: 3.3.3
10491059
webhookdefinitions:
10501060
- admissionReviewVersions:
10511061
- v1

cmd/operator/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ var defaultImages = map[string]string{
4040
"alertmanager": "",
4141
"thanos": obopo.DefaultThanosImage,
4242
"ui-dashboards": "quay.io/openshift-observability-ui/console-dashboards-plugin:v0.4.0",
43-
"ui-troubleshooting-panel": "quay.io/openshift-observability-ui/troubleshooting-panel-console-plugin:v0.4.0",
43+
"ui-troubleshooting-panel": "grover.home:5000/alanconway/troubleshooting-panel-console-plugin:latest",
4444
"ui-distributed-tracing-pf4": "quay.io/openshift-observability-ui/distributed-tracing-console-plugin:v0.3.0",
4545
"ui-distributed-tracing": "quay.io/openshift-observability-ui/distributed-tracing-console-plugin:v0.4.0",
4646
"ui-logging-pf4": "quay.io/openshift-observability-ui/logging-view-plugin:v6.0.0",
4747
"ui-logging": "quay.io/openshift-observability-ui/logging-view-plugin:v6.1.0",
4848
"ui-monitoring": "quay.io/openshift-observability-ui/monitoring-console-plugin:release-coo-1.1",
49-
"korrel8r": "quay.io/korrel8r/korrel8r:0.7.4",
49+
"korrel8r": "grover.home:5000/alanconway/korrel8r:latest",
5050
"health-analyzer": "quay.io/openshiftanalytics/cluster-health-analyzer:v0.4.0",
5151
"perses": "quay.io/persesdev/perses:v0.50.1",
5252
}
@@ -95,7 +95,7 @@ func main() {
9595
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
9696
flag.StringVar(&healthProbeAddr, "health-probe-bind-address", ":8081", "The address the health probe endpoint binds to.")
9797
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()))
98-
flag.BoolVar(&openShiftEnabled, "openshift.enabled", false, "Enable OpenShift specific features such as Console Plugins.")
98+
flag.BoolVar(&openShiftEnabled, "openshift.enabled", true, "Enable OpenShift specific features such as Console Plugins.")
9999

100100
opts := zap.Options{
101101
Development: true,
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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: configs.observability.openshift.io
8+
spec:
9+
group: observability.openshift.io
10+
names:
11+
kind: Config
12+
listKind: ConfigList
13+
plural: configs
14+
singular: config
15+
scope: Cluster
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: |-
21+
Config defines an observability configuration that can deploy operators and resources for
22+
observability signal collectors and stores.
23+
properties:
24+
apiVersion:
25+
description: |-
26+
APIVersion defines the versioned schema of this representation of an object.
27+
Servers should convert recognized schemas to the latest internal value, and
28+
may reject unrecognized values.
29+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
30+
type: string
31+
kind:
32+
description: |-
33+
Kind is a string value representing the REST resource this object represents.
34+
Servers may infer this from the endpoint the client submits requests to.
35+
Cannot be updated.
36+
In CamelCase.
37+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
38+
type: string
39+
metadata:
40+
type: object
41+
spec:
42+
description: ConfigSpec specifies what to install.
43+
properties:
44+
defaultInstall:
45+
description: |-
46+
DefaultInstall is the default install type for signals that are not listed or
47+
are listed without an `install` field.
48+
For example, `{ defaultinstall: Default }` with no `signals` field installs all signal
49+
types with default settings.
50+
type: string
51+
installDefinitions:
52+
items:
53+
description: InstallDefinitionSpec defines a new installation type.
54+
properties:
55+
configMap:
56+
description: |-
57+
ConfigMap contains deployment bundles for the install type, with key=signal type.
58+
FIXME: which way around? install < signal or signal < install
59+
type: string
60+
install:
61+
description: Name of the installation type.
62+
type: string
63+
type: object
64+
type: array
65+
signals:
66+
description: Signals specifies what to install for each signal type.
67+
items:
68+
properties:
69+
installType:
70+
description: Install type for this signal. Optional, if absent
71+
use ..defaultInstall
72+
type: string
73+
namespace:
74+
description: |-
75+
Namespace to install to. Optional, each signal type has a default namespace.
76+
A signal can be listed multiple times with different `namespace` values,
77+
to install in multiple namespaces.
78+
type: string
79+
signal:
80+
description: Name of this signal type.
81+
type: string
82+
required:
83+
- signal
84+
type: object
85+
type: array
86+
type: object
87+
status:
88+
description: FIXME Status
89+
type: object
90+
type: object
91+
served: true
92+
storage: true
93+
subresources:
94+
status: {}
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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: signalmanagers.observability.openshift.io
8+
spec:
9+
group: observability.openshift.io
10+
names:
11+
kind: SignalManager
12+
listKind: SignalManagerList
13+
plural: signalmanagers
14+
singular: signalmanager
15+
scope: Cluster
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: "SignalManager is a custom resource to enable observability in
21+
the cluster.\n\nEach type of observability signal (logs, metrics, network
22+
events, ...) requires operators to be\ninstalled and resources created to
23+
configure collection, processing, and storage of signal data.\n\nThe SignalManager
24+
automatically installs the operators, custom resource definitions, and\nresources
25+
to enable all the desired observability signals in a cluster with default\nconfigurations.\n\nThis
26+
means you can get observability up and running quickly and easily,\nbut
27+
still customize the details if and when you need to.\n\n## Pattern\n\nA
28+
\"Pattern\" is a named set of configurations for each of the observability
29+
signals.\nChoosing a pattern automatically installs required operators (if
30+
needed) _and_ creates\nworking resources so you have complete, working,
31+
observability stacks.\n\nThe following patterns are always available, others
32+
may be made available.\n\n - Default:\n Installs operators and resources
33+
suitable for the most common use cases.\n The operator owns and manages
34+
the resources, and keeps them in the default state.\n - Custom:\n Installs
35+
operators, but does not create any live resources.\n The user can create
36+
customized resources, they will not be modified by this operator.\n - Disabled:
37+
Do not install any operators, resource definitions, or resources.\n\nCustom
38+
patterns can be defined in `spec.patterns`.\n\n## Examples\n\nEnable all
39+
observability components with default settings.\n\n\tkind: SignalManager\n\tspec:\n\t
40+
\ pattern: Default\n\nDisable all observability components except for logging.\n\n\tkind:
41+
SignalManager\n\tspec:\n\t pattern: Disabled\n\t signals:\n\t name:
42+
Log\n\t pattern: Default\n\nEnable most components with defaults, install
43+
the logging operators,\nbut use custom logging resources (created separately)\n\n\tkind:
44+
SignalManager\n\tspec:\n\t pattern: Default\n\t signals:\n\t name:
45+
log\n\t pattern: Custom\n\n## Lifecycle and ownership\n\nOwnership of
46+
resources depends on the pattern:\n\n - None: No operators installed, no
47+
resources created or reconciled.\n - Custom: Operators installed but no
48+
resources created. User is free to create resources\n they are not owned
49+
or reconciled by this operator.\n - Default, or any other defined configuration:\n
50+
\ This operator creates, owns, and reconciles resources to keep them consistent
51+
with the chosen\n pattern.\n\nFIXME: Operator may reconcile only part
52+
of the resource and allow user to tweak other parts.\nNeeds consideration.
53+
COO already uses server-side-apply to do this in some cases.\n\nFIXME: Patterns
54+
may need to be \"parameterized\" e.g. with sizing data.\nHow to include
55+
such parameters without duplicating existing CRs?\n\nFIXME: Define behavior
56+
on spec changes: deleting, re-creating, updating resources.\nChange to Custom
57+
should leave resources in place so user can eddit.\nWhat to do on change
58+
_from_ Custom?"
59+
properties:
60+
apiVersion:
61+
description: |-
62+
APIVersion defines the versioned schema of this representation of an object.
63+
Servers should convert recognized schemas to the latest internal value, and
64+
may reject unrecognized values.
65+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
66+
type: string
67+
kind:
68+
description: |-
69+
Kind is a string value representing the REST resource this object represents.
70+
Servers may infer this from the endpoint the client submits requests to.
71+
Cannot be updated.
72+
In CamelCase.
73+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
74+
type: string
75+
metadata:
76+
type: object
77+
spec:
78+
description: Lists signals and the pattern to deploy them.
79+
properties:
80+
pattern:
81+
description: The default pattern for signals that are not listed or
82+
have no `pattern` field.
83+
type: string
84+
patterns:
85+
description: Patterns is a list of custom pattern definitions.
86+
items:
87+
description: |-
88+
PatternSpec defines a custom pattern.
89+
90+
on the cluster. Simplest format is a flat YAML file, but we may need more structure
91+
to store kustomize scripts, multi-stage deployments, health checks, metadata etc....
92+
Possible storage formats: ConfigMap, PersistentVolume, container image...
93+
94+
Patterns should also be usable directly, without depending on this API.
95+
Preferably using only kubectl and kustomize.
96+
properties:
97+
pattern:
98+
description: Name of the pattern.
99+
type: string
100+
required:
101+
- pattern
102+
type: object
103+
type: array
104+
signals:
105+
description: Signals is a list of signal types with the desired pattern.
106+
items:
107+
properties:
108+
name:
109+
description: Signal name
110+
type: string
111+
namespace:
112+
description: |-
113+
Namespace to install to.
114+
115+
Optional, each signal type has a default namespace.
116+
type: string
117+
pattern:
118+
description: Pattern for this signal. Optional, if absent use
119+
the 'Default' pattern.
120+
type: string
121+
required:
122+
- name
123+
type: object
124+
type: array
125+
required:
126+
- pattern
127+
type: object
128+
status:
129+
description: Status of the signal manager.
130+
type: object
131+
type: object
132+
served: true
133+
storage: true
134+
subresources:
135+
status: {}

deploy/olm/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ resources:
1212

1313
images:
1414
- name: observability-operator
15-
newName: observability-operator
16-
newTag: 1.0.0
15+
newName: grover.home:5000/alanconway/observability-operator
16+
newTag: 3.3.3
1717

1818
patches:
1919
- patch: |-

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+
- signalmanagers
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+
- signalmanagers/finalizers
238+
- signalmanagers/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:

0 commit comments

Comments
 (0)