Skip to content

Commit

Permalink
Migrate console-plugin to observability operator
Browse files Browse the repository at this point in the history
  • Loading branch information
DebakelOrakel committed Dec 23, 2024
1 parent 6530a39 commit 23fb6fe
Show file tree
Hide file tree
Showing 18 changed files with 121 additions and 47 deletions.
9 changes: 0 additions & 9 deletions class/defaults.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
parameters:
openshift4_logging:
=_openshift4_console:
"True":
config:
plugins:
- "logging-view-plugin"
"False": {}

namespace: openshift-logging

version: '6.1'
Expand Down Expand Up @@ -88,5 +81,3 @@ parameters:
ingester_fix:
schedule: '*/10 * * * *'
sleep_time: 2m

openshift4_console: ${openshift4_logging:_openshift4_console:${openshift4_logging:components:lokistack:enabled}}
21 changes: 21 additions & 0 deletions component/log_lokistack.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,34 @@ local aggregate_loki_log_access = kube.ClusterRole('syn:loki:cluster-reader') {
],
};

// Console Log Plugin
local console_plugin = kube._Object('observability.openshift.io/v1alpha1', 'UIPlugin', 'logging') {
metadata: {
labels: {
name: 'logging',
},
name: 'logging',
},
spec: {
type: 'Logging',
logging: {
lokiStack: {
name: 'logging-loki',
},
logsLimit: 50,
timeout: '30s',
},
},
};

// Define outputs below
if loki.enabled then
{
'30_loki_stack': lokistack,
'30_loki_logstore': logstore,
'30_loki_netpol': [ netpol_viewplugin, netpol_lokigateway ],
'30_loki_rbac': [ aggregate_loki_log_access ],
'30_loki_plugin': console_plugin,
}
else
std.trace(
Expand Down
13 changes: 13 additions & 0 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,22 @@ local lokistack = if lokiEnabled then operatorlib.managedSubscription(
},
};

local observability = if lokiEnabled then operatorlib.managedSubscription(
'openshift-operators-redhat',
'cluster-observability-operator',
'development'
) {
metadata+: {
annotations+: {
'argocd.argoproj.io/sync-wave': '-80',
},
},
};

local subscriptions = std.filter(function(it) it != null, [
logging,
lokistack,
observability,
]);

local secrets = com.generateResources(params.secrets, kube.Secret);
Expand Down
9 changes: 0 additions & 9 deletions tests/console-patch.jsonnet

This file was deleted.

5 changes: 0 additions & 5 deletions tests/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ parameters:
- type: https
source: https://raw.githubusercontent.com/appuio/component-openshift4-monitoring/v2.9.0/lib/openshift4-monitoring-alert-patching.libsonnet
output_path: vendor/lib/alert-patching.libsonnet
compile:
- input_type: jsonnet
input_paths:
- tests/console-patch.jsonnet
output_path: console-patching/

openshift4_operators:
defaultInstallPlanApproval: Automatic
Expand Down
5 changes: 0 additions & 5 deletions tests/forwardingonly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ parameters:
- type: https
source: https://raw.githubusercontent.com/appuio/component-openshift4-monitoring/v2.9.0/lib/openshift4-monitoring-alert-patching.libsonnet
output_path: vendor/lib/alert-patching.libsonnet
compile:
- input_type: jsonnet
input_paths:
- tests/console-patch.jsonnet
output_path: console-patching/

openshift4_operators:
defaultInstallPlanApproval: Automatic
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,19 @@ spec:
name: loki-operator
source: openshift-operators-redhat
sourceNamespace: openshift-operators-redhat
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
annotations:
argocd.argoproj.io/sync-wave: '-80'
labels:
name: cluster-observability-operator
name: cluster-observability-operator
namespace: openshift-operators-redhat
spec:
channel: development
installPlanApproval: Automatic
name: cluster-observability-operator
source: openshift-operators-redhat
sourceNamespace: openshift-operators-redhat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: observability.openshift.io/v1alpha1
kind: UIPlugin
metadata:
labels:
name: logging
name: logging
spec:
logging:
logsLimit: 50
lokiStack:
name: logging-loki
timeout: 30s
type: Logging
Empty file.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,19 @@ spec:
name: loki-operator
source: openshift-operators-redhat
sourceNamespace: openshift-operators-redhat
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
annotations:
argocd.argoproj.io/sync-wave: '-80'
labels:
name: cluster-observability-operator
name: cluster-observability-operator
namespace: openshift-operators-redhat
spec:
channel: development
installPlanApproval: Automatic
name: cluster-observability-operator
source: openshift-operators-redhat
sourceNamespace: openshift-operators-redhat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: observability.openshift.io/v1alpha1
kind: UIPlugin
metadata:
labels:
name: logging
name: logging
spec:
logging:
logsLimit: 50
lokiStack:
name: logging-loki
timeout: 30s
type: Logging

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,19 @@ spec:
name: loki-operator
source: openshift-operators-redhat
sourceNamespace: openshift-operators-redhat
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
annotations:
argocd.argoproj.io/sync-wave: '-80'
labels:
name: cluster-observability-operator
name: cluster-observability-operator
namespace: openshift-operators-redhat
spec:
channel: development
installPlanApproval: Automatic
name: cluster-observability-operator
source: openshift-operators-redhat
sourceNamespace: openshift-operators-redhat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: observability.openshift.io/v1alpha1
kind: UIPlugin
metadata:
labels:
name: logging
name: logging
spec:
logging:
logsLimit: 50
lokiStack:
name: logging-loki
timeout: 30s
type: Logging
5 changes: 0 additions & 5 deletions tests/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ parameters:
- type: https
source: https://raw.githubusercontent.com/appuio/component-openshift4-monitoring/v2.9.0/lib/openshift4-monitoring-alert-patching.libsonnet
output_path: vendor/lib/alert-patching.libsonnet
compile:
- input_type: jsonnet
input_paths:
- tests/console-patch.jsonnet
output_path: console-patching/

openshift4_operators:
defaultInstallPlanApproval: Automatic
Expand Down
5 changes: 0 additions & 5 deletions tests/multilineerr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ parameters:
- type: https
source: https://raw.githubusercontent.com/appuio/component-openshift4-monitoring/v2.9.0/lib/openshift4-monitoring-alert-patching.libsonnet
output_path: vendor/lib/alert-patching.libsonnet
compile:
- input_type: jsonnet
input_paths:
- tests/console-patch.jsonnet
output_path: console-patching/

openshift4_operators:
defaultInstallPlanApproval: Automatic
Expand Down

0 comments on commit 23fb6fe

Please sign in to comment.