Skip to content
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
87 changes: 87 additions & 0 deletions bundle/manifests/observability-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ spec:
kind: ThanosRuler
name: thanosrulers.monitoring.rhobs
version: v1
- description: UIPlugin defines a console plugin for observability
displayName: UIPlugin
kind: UIPlugin
name: uiplugins.observability.openshift.io
version: v1alpha1
description: |2+

Observability Operator is a Go based Kubernetes operator to setup and manage highly available Monitoring stack using Prometheus, Alertmanager and Thanos Querier.
Expand Down Expand Up @@ -262,6 +267,20 @@ spec:
- use
serviceAccountName: obo-prometheus-operator-admission-webhook
- rules:
- apiGroups:
- ""
resources:
- configmaps
- serviceaccounts
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -296,6 +315,26 @@ spec:
- patch
- update
- watch
- apiGroups:
- config.openshift.io
resources:
- clusterversions
verbs:
- get
- list
- watch
- apiGroups:
- console.openshift.io
resources:
- consoleplugins
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -391,6 +430,42 @@ spec:
- get
- patch
- update
- apiGroups:
- observability.openshift.io
resources:
- uiplugins
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- observability.openshift.io
resources:
- uiplugins/finalizers
- uiplugins/status
verbs:
- get
- update
- apiGroups:
- observability.openshift.io
resources:
- uiplugins/status
verbs:
- get
- update
- apiGroups:
- operator.openshift.io
resources:
- consoles
verbs:
- get
- list
- patch
- watch
- apiGroups:
- policy
resources:
Expand All @@ -416,6 +491,18 @@ spec:
- patch
- update
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
- roles
verbs:
- create
- delete
- list
- patch
- update
- watch
- apiGroups:
- security.openshift.io
resourceNames:
Expand Down
127 changes: 127 additions & 0 deletions bundle/manifests/observability.openshift.io_uiplugins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
creationTimestamp: null
name: uiplugins.observability.openshift.io
spec:
group: observability.openshift.io
names:
kind: UIPlugin
listKind: UIPluginList
plural: uiplugins
singular: uiplugin
scope: Cluster
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: UIPlugin defines an observability console plugin.
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: UIPluginSpec is the specification for desired state of UIPlugin.
properties:
type:
description: Type defines the UI plugin.
enum:
- Dashboards
type: string
required:
- type
type: object
status:
description: |-
UIPluginStatus defines the observed state of UIPlugin.
It should always be reconstructable from the state of the cluster and/or outside world.
properties:
conditions:
description: Conditions provide status information about the plugin.
items:
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
enum:
- "True"
- "False"
- Unknown
- Degraded
type: string
type:
description: |-
type of condition in CamelCase or in foo.example.com/CamelCase.
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
x-kubernetes-list-type: atomic
required:
- conditions
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: null
storedVersions: null
22 changes: 16 additions & 6 deletions cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ import (
// prometheus-operator. For thanos we use the default version from
// prometheus-operator.
var defaultImages = map[string]string{
"prometheus": "",
"alertmanager": "",
"thanos": obopo.DefaultThanosImage,
"prometheus": "",
"alertmanager": "",
"thanos": obopo.DefaultThanosImage,
"ui-dashboards": "quay.io/openshift-observability-ui/console-dashboards-plugin:v0.1.0",
}

func imagesUsed() []string {
Expand Down Expand Up @@ -72,9 +73,10 @@ func validateImages(images *k8sflag.MapStringString) (map[string]string, error)

func main() {
var (
namespace string
metricsAddr string
healthProbeAddr string
namespace string
metricsAddr string
healthProbeAddr string
openShiftEnabled bool

setupLog = ctrl.Log.WithName("setup")
)
Expand All @@ -84,6 +86,8 @@ func main() {
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
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.")

opts := zap.Options{
Development: true,
TimeEncoder: zapcore.RFC3339TimeEncoder,
Expand Down Expand Up @@ -112,6 +116,12 @@ func main() {
operator.WithAlertmanagerImage(imgMap["alertmanager"]),
operator.WithThanosSidecarImage(imgMap["thanos"]),
operator.WithThanosQuerierImage(imgMap["thanos"]),
operator.WithUIPlugins(namespace, imgMap),
operator.WithFeatureGates(operator.FeatureGates{
OpenShift: operator.OpenShiftFeatureGates{
Enabled: openShiftEnabled,
},
}),
))
if err != nil {
setupLog.Error(err, "cannot create a new operator")
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 @@ -4,3 +4,4 @@ kind: Kustomization
resources:
- monitoring.rhobs_monitoringstacks.yaml
- monitoring.rhobs_thanosqueriers.yaml
- observability.openshift.io_uiplugins.yaml
Loading