diff --git a/class/defaults.yml b/class/defaults.yml index 7717ca9..2f538e4 100644 --- a/class/defaults.yml +++ b/class/defaults.yml @@ -1,12 +1,5 @@ parameters: openshift4_logging: - =_openshift4_console: - "True": - config: - plugins: - - "logging-view-plugin" - "False": {} - namespace: openshift-logging version: '6.1' @@ -88,5 +81,3 @@ parameters: ingester_fix: schedule: '*/10 * * * *' sleep_time: 2m - - openshift4_console: ${openshift4_logging:_openshift4_console:${openshift4_logging:components:lokistack:enabled}} diff --git a/component/log_lokistack.libsonnet b/component/log_lokistack.libsonnet index a06bca5..3b9da34 100644 --- a/component/log_lokistack.libsonnet +++ b/component/log_lokistack.libsonnet @@ -117,6 +117,26 @@ 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 { @@ -124,6 +144,7 @@ if loki.enabled then '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( diff --git a/component/main.jsonnet b/component/main.jsonnet index 146d87c..40fe3aa 100644 --- a/component/main.jsonnet +++ b/component/main.jsonnet @@ -69,9 +69,23 @@ local lokistack = if lokiEnabled then operatorlib.managedSubscription( }, }; +local observability = if lokiEnabled then operatorlib.namespacedSubscription( + 'openshift-operators', + 'cluster-observability-operator', + 'development', + 'openshift-operators-redhat' +) { + 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); diff --git a/tests/console-patch.jsonnet b/tests/console-patch.jsonnet deleted file mode 100644 index b5ef686..0000000 --- a/tests/console-patch.jsonnet +++ /dev/null @@ -1,9 +0,0 @@ -local com = import 'lib/commodore.libjsonnet'; -local kap = import 'lib/kapitan.libjsonnet'; - -local inv = kap.inventory(); -local params = inv.parameters.openshift4_console; - -{ - openshift4_console_params: params, -} diff --git a/tests/defaults.yml b/tests/defaults.yml index fc9eccd..42e121d 100644 --- a/tests/defaults.yml +++ b/tests/defaults.yml @@ -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 diff --git a/tests/forwardingonly.yml b/tests/forwardingonly.yml index 1d72626..38dd99a 100644 --- a/tests/forwardingonly.yml +++ b/tests/forwardingonly.yml @@ -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 diff --git a/tests/golden/defaults/openshift4-logging/console-patching/openshift4_console_params.yaml b/tests/golden/defaults/openshift4-logging/console-patching/openshift4_console_params.yaml deleted file mode 100644 index f71555a..0000000 --- a/tests/golden/defaults/openshift4-logging/console-patching/openshift4_console_params.yaml +++ /dev/null @@ -1,3 +0,0 @@ -config: - plugins: - - logging-view-plugin diff --git a/tests/golden/defaults/openshift4-logging/openshift4-logging/20_subscriptions.yaml b/tests/golden/defaults/openshift4-logging/openshift4-logging/20_subscriptions.yaml index 15b0b8c..846ad1f 100644 --- a/tests/golden/defaults/openshift4-logging/openshift4-logging/20_subscriptions.yaml +++ b/tests/golden/defaults/openshift4-logging/openshift4-logging/20_subscriptions.yaml @@ -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 +spec: + channel: development + installPlanApproval: Automatic + name: cluster-observability-operator + source: openshift-operators-redhat + sourceNamespace: openshift-operators-redhat diff --git a/tests/golden/defaults/openshift4-logging/openshift4-logging/30_loki_plugin.yaml b/tests/golden/defaults/openshift4-logging/openshift4-logging/30_loki_plugin.yaml new file mode 100644 index 0000000..3128c2f --- /dev/null +++ b/tests/golden/defaults/openshift4-logging/openshift4-logging/30_loki_plugin.yaml @@ -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 diff --git a/tests/golden/forwardingonly/openshift4-logging/console-patching/openshift4_console_params.yaml b/tests/golden/forwardingonly/openshift4-logging/console-patching/openshift4_console_params.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/tests/golden/master/openshift4-logging/console-patching/openshift4_console_params.yaml b/tests/golden/master/openshift4-logging/console-patching/openshift4_console_params.yaml deleted file mode 100644 index f71555a..0000000 --- a/tests/golden/master/openshift4-logging/console-patching/openshift4_console_params.yaml +++ /dev/null @@ -1,3 +0,0 @@ -config: - plugins: - - logging-view-plugin diff --git a/tests/golden/master/openshift4-logging/openshift4-logging/20_subscriptions.yaml b/tests/golden/master/openshift4-logging/openshift4-logging/20_subscriptions.yaml index 59a6100..2ba8dad 100644 --- a/tests/golden/master/openshift4-logging/openshift4-logging/20_subscriptions.yaml +++ b/tests/golden/master/openshift4-logging/openshift4-logging/20_subscriptions.yaml @@ -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 +spec: + channel: development + installPlanApproval: Automatic + name: cluster-observability-operator + source: openshift-operators-redhat + sourceNamespace: openshift-operators-redhat diff --git a/tests/golden/master/openshift4-logging/openshift4-logging/30_loki_plugin.yaml b/tests/golden/master/openshift4-logging/openshift4-logging/30_loki_plugin.yaml new file mode 100644 index 0000000..3128c2f --- /dev/null +++ b/tests/golden/master/openshift4-logging/openshift4-logging/30_loki_plugin.yaml @@ -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 diff --git a/tests/golden/multilineerr/openshift4-logging/console-patching/openshift4_console_params.yaml b/tests/golden/multilineerr/openshift4-logging/console-patching/openshift4_console_params.yaml deleted file mode 100644 index f71555a..0000000 --- a/tests/golden/multilineerr/openshift4-logging/console-patching/openshift4_console_params.yaml +++ /dev/null @@ -1,3 +0,0 @@ -config: - plugins: - - logging-view-plugin diff --git a/tests/golden/multilineerr/openshift4-logging/openshift4-logging/20_subscriptions.yaml b/tests/golden/multilineerr/openshift4-logging/openshift4-logging/20_subscriptions.yaml index 15b0b8c..846ad1f 100644 --- a/tests/golden/multilineerr/openshift4-logging/openshift4-logging/20_subscriptions.yaml +++ b/tests/golden/multilineerr/openshift4-logging/openshift4-logging/20_subscriptions.yaml @@ -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 +spec: + channel: development + installPlanApproval: Automatic + name: cluster-observability-operator + source: openshift-operators-redhat + sourceNamespace: openshift-operators-redhat diff --git a/tests/golden/multilineerr/openshift4-logging/openshift4-logging/30_loki_plugin.yaml b/tests/golden/multilineerr/openshift4-logging/openshift4-logging/30_loki_plugin.yaml new file mode 100644 index 0000000..3128c2f --- /dev/null +++ b/tests/golden/multilineerr/openshift4-logging/openshift4-logging/30_loki_plugin.yaml @@ -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 diff --git a/tests/master.yml b/tests/master.yml index 8d248eb..1918d66 100644 --- a/tests/master.yml +++ b/tests/master.yml @@ -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 diff --git a/tests/multilineerr.yml b/tests/multilineerr.yml index b91a325..6641719 100644 --- a/tests/multilineerr.yml +++ b/tests/multilineerr.yml @@ -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