Skip to content

Commit

Permalink
Change monitoring labels for Prometheus
Browse files Browse the repository at this point in the history
SYNMonitoring is no longer relevant and has been removed.
Support for component-prometheus and OpenShift 4 has been added.
  • Loading branch information
Gabriel Mainberger committed Jun 2, 2023
1 parent 8f3f306 commit 519bfa0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
22 changes: 16 additions & 6 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@ local k8up = import 'lib/backup-k8up.libjsonnet';
local com = import 'lib/commodore.libjsonnet';
local kap = import 'lib/kapitan.libjsonnet';
local kube = import 'lib/kube.libjsonnet';
local prometheus = import 'lib/prometheus.libjsonnet';
local inv = kap.inventory();
// The hiera parameters for the component
local params = inv.parameters.keycloak;

local namespace = kube.Namespace(params.namespace) {
metadata+: {
labels+: {
SYNMonitoring: 'main',
} + com.makeMergeable(params.namespaceLabels),
},
local namespace = (
if params.monitoring.enabled && std.member(inv.applications, 'prometheus') then
prometheus.RegisterNamespace(kube.Namespace(params.namespace))
else if params.monitoring.enabled && inv.parameters.facts.distribution == 'openshift4' then
kube.Namespace(params.namespace) {
metadata+: {
labels+: { 'openshift.io/cluster-monitoring': 'true' },
},
}
else
kube.Namespace(params.namespace)
) {
metadata+: {
labels+: com.makeMergeable(params.namespaceLabels),
},
};

local networkpolicy_infinispan_labels = {
Expand Down
1 change: 0 additions & 1 deletion tests/golden/builtin/builtin/builtin/00_namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: Namespace
metadata:
annotations: {}
labels:
SYNMonitoring: main
name: syn-builtin
test: testing
name: syn-builtin

0 comments on commit 519bfa0

Please sign in to comment.