Skip to content

Commit

Permalink
Merge pull request #215 from projectsyn/fix-monitoring-networkpolicy
Browse files Browse the repository at this point in the history
Fix monitoring network policy to use component-prometheus
  • Loading branch information
megian authored Jun 9, 2023
2 parents 6bf790a + 86979de commit c3a74c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
11 changes: 4 additions & 7 deletions component/prometheus-netpol.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ local inv = kap.inventory();
local params = inv.parameters.keycloak;

local prometheus_namespace =
if std.objectHas(inv.parameters, 'rancher_monitoring') then
inv.parameters.rancher_monitoring.namespace
else
'syn-synsights';
'syn-infra-monitoring';
local prometheus_name = 'prometheus';

local keycloak_namespace = params.namespace;
local keycloak_name = params.name;
local keycloak_name = 'keycloakx';

local name = prometheus_name + '-' + prometheus_namespace + '-to-' + keycloak_name;

Expand All @@ -32,14 +29,14 @@ local netpol =
},
podSelector: {
matchLabels: {
app: prometheus_name,
'app.kubernetes.io/component': prometheus_name,
},
},
},
],
ports: [
{
port: 9990,
port: 8080,
protocol: 'TCP',
},
],
Expand Down
14 changes: 7 additions & 7 deletions tests/golden/builtin/builtin/builtin/40_netpol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ kind: NetworkPolicy
metadata:
annotations: {}
labels:
name: prometheus-syn-synsights-to-keycloak
name: prometheus-syn-synsights-to-keycloak
name: prometheus-syn-infra-monitoring-to-keycloakx
name: prometheus-syn-infra-monitoring-to-keycloakx
namespace: syn-builtin
spec:
egress: []
ingress:
- from:
- namespaceSelector:
matchLabels:
name: syn-synsights
name: syn-infra-monitoring
podSelector:
matchLabels:
app: prometheus
app.kubernetes.io/component: prometheus
ports:
- port: 9990
- port: 8080
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/instance: keycloak
app.kubernetes.io/name: keycloak
app.kubernetes.io/instance: keycloakx
app.kubernetes.io/name: keycloakx
policyTypes:
- Ingress

0 comments on commit c3a74c0

Please sign in to comment.