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 21794f4
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 1 deletion.
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: '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
1 change: 0 additions & 1 deletion tests/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parameters:
input_paths:
- tests/console-patch.jsonnet
output_path: console-patching/

openshift4_operators:
defaultInstallPlanApproval: Automatic
defaultSource: openshift-operators-redhat
Expand Down
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: loki
timeout: 30s
type: Logging
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: loki
timeout: 30s
type: Logging
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: loki
timeout: 30s
type: Logging

0 comments on commit 21794f4

Please sign in to comment.