Add networkPolicies for alertmanager, grafana, prometheus-operator and prometheus
Signed-off-by: GitHub <noreply@github.com> (cherry picked from commit 86e16b539cc57710b50f4692848cab5645e3d2bc)
This commit is contained in:
committed by
ArthurSens
parent
030dec7656
commit
ea158da23f
@@ -72,6 +72,32 @@ function(params)
|
||||
},
|
||||
},
|
||||
|
||||
networkPolicy: {
|
||||
apiVersion: 'networking.k8s.io/v1',
|
||||
kind: 'NetworkPolicy',
|
||||
metadata: po.service.metadata,
|
||||
spec: {
|
||||
podSelector: {
|
||||
matchLabels: po._config.selectorLabels,
|
||||
},
|
||||
policyTypes: ['Egress', 'Ingress'],
|
||||
egress: [{}],
|
||||
ingress: [{
|
||||
from: [{
|
||||
podSelector: {
|
||||
matchLabels: {
|
||||
'app.kubernetes.io/name': 'prometheus',
|
||||
},
|
||||
},
|
||||
}],
|
||||
ports: std.map(function(o) {
|
||||
port: o.port,
|
||||
protocol: 'TCP',
|
||||
}, po.service.spec.ports),
|
||||
}],
|
||||
},
|
||||
},
|
||||
|
||||
service+: {
|
||||
spec+: {
|
||||
ports: [
|
||||
|
||||
Reference in New Issue
Block a user