Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
de2f821
add networkpolicy settings for in-cluster monitoring
juzhao Sep 1, 2025
91b04be
update thanos-querier.libsonnet for networkpolicy
juzhao Sep 1, 2025
d39c22f
update admission-webhook.libsonnet
juzhao Sep 1, 2025
d029248
fix typo in admission-webhook.libsonnet prometheus-operator.libsonnet
juzhao Sep 2, 2025
506f269
update monitoring-plugin.libsonnet and gofmt manifests.go
juzhao Sep 2, 2025
10baeed
update format
juzhao Sep 2, 2025
d881999
update alertmanager.libsonnet
juzhao Sep 2, 2025
0da4120
update manifests.go to add ThanosQuerierNetworkPolicy func
juzhao Sep 2, 2025
02c48aa
remove networkpolicy.yaml file under each component
juzhao Sep 4, 2025
7f5102e
add networkpolicy files back
juzhao Sep 5, 2025
d34d3d5
update main.jsonnet to remove removeNetworkPolicy
juzhao Sep 8, 2025
aa26831
fix error
juzhao Sep 8, 2025
5ca639d
fix errors
juzhao Sep 8, 2025
0222586
remove resources.adoc resources.md
juzhao Sep 8, 2025
13f0e13
add back resources.adoc resources.md main.jsonnet
juzhao Sep 8, 2025
cfe85fd
revert change in resources.adoc resources.md
juzhao Sep 8, 2025
7cde663
update networkpolicy files
juzhao Sep 8, 2025
57c710c
add renameNetworkPolicy to rename networkPolicy to networkPolicyDowns…
juzhao Sep 9, 2025
a6f8845
update libsonnet
juzhao Sep 10, 2025
f07312b
OCPBUGS-58475: Enforce secure TLS settings in CMO server
danielmellado Aug 17, 2025
514ba77
OCPBUGS-34568,OCPBUGS-35095: non-HA alert cases
rexagod Jul 29, 2025
ec6e88e
bugfix: opt-out of multi-cluster control plane rules
rexagod Aug 12, 2025
54f2baf
chore: `make generate`
rexagod Aug 12, 2025
153245c
chore: `make jsonnet-fmt`
rexagod Aug 12, 2025
f90f401
chore: Indicate added alerts in CHANGELOG
rexagod Aug 12, 2025
dae3f9a
OCPBUGS-56158: Bump prometheus-operator to v0.85.0
slashpai Aug 28, 2025
0c3c073
add networkpolicy settings for in-cluster monitoring
juzhao Sep 1, 2025
b15d04c
update thanos-querier.libsonnet for networkpolicy
juzhao Sep 1, 2025
1a3e9e7
update admission-webhook.libsonnet
juzhao Sep 1, 2025
1a6d431
fix typo in admission-webhook.libsonnet prometheus-operator.libsonnet
juzhao Sep 2, 2025
8d80d31
update monitoring-plugin.libsonnet and gofmt manifests.go
juzhao Sep 2, 2025
4b8855e
update format
juzhao Sep 2, 2025
bbccdbe
update alertmanager.libsonnet
juzhao Sep 2, 2025
d865f4c
update manifests.go to add ThanosQuerierNetworkPolicy func
juzhao Sep 2, 2025
13d2f86
remove networkpolicy.yaml file under each component
juzhao Sep 4, 2025
8cd29d0
add networkpolicy files back
juzhao Sep 5, 2025
353b2bd
update main.jsonnet to remove removeNetworkPolicy
juzhao Sep 8, 2025
306701e
fix error
juzhao Sep 8, 2025
b0c3a9c
fix errors
juzhao Sep 8, 2025
e2f71ca
remove resources.adoc resources.md
juzhao Sep 8, 2025
5da0328
add back resources.adoc resources.md main.jsonnet
juzhao Sep 8, 2025
bdc8872
revert change in resources.adoc resources.md
juzhao Sep 8, 2025
a0e618f
update networkpolicy files
juzhao Sep 8, 2025
bfb85d0
add renameNetworkPolicy to rename networkPolicy to networkPolicyDowns…
juzhao Sep 9, 2025
acf789a
Revert "add renameNetworkPolicy to rename networkPolicy to networkPol…
juzhao Sep 11, 2025
9721b3f
revert change
juzhao Sep 11, 2025
afffb62
revert change
juzhao Sep 11, 2025
04ff8a3
fix typo
juzhao Sep 11, 2025
082ccd1
remove remame-network-policy.libsonnet, file name is wrong
juzhao Sep 11, 2025
ab2f2c2
fix code error
juzhao Sep 11, 2025
437118e
rename networkpolicy file name
juzhao Sep 11, 2025
ec7737e
add labels for networkpolicy files to let generate job pass
juzhao Sep 11, 2025
eceb453
add default deny networkpolicy to cluster-monitoring-operator.libsonnet
juzhao Sep 11, 2025
2250fb9
change libsonnet format
juzhao Sep 12, 2025
1c41a83
split networkpolicy
juzhao Sep 12, 2025
f85cb8c
rename default deny networkpolicy file name
juzhao Sep 12, 2025
a8a8484
update networkpolicy yaml file format
juzhao Sep 12, 2025
8a285a2
rename networkpolicy file name to component name
juzhao Sep 15, 2025
9f897bd
add code to deploy networkpolicy files for in-cluster monitoring
juzhao Sep 17, 2025
1dfafc4
fix type check error to use NetworkingV1 func
juzhao Sep 18, 2025
bb3c93d
fix error
juzhao Sep 18, 2025
bc02f97
fix error
juzhao Sep 18, 2025
f3bc4b3
Merge remote-tracking branch 'upstream/main' into networkpolicy_in-cl…
juzhao Sep 19, 2025
39c0741
fix error
juzhao Sep 19, 2025
4ee6ccb
grant sa cluster-monitoring-operator get networkpolicies permission
juzhao Sep 19, 2025
28d5b12
update 0000_50_cluster-monitoring-operator_02-role.yaml
juzhao Sep 19, 2025
96a1213
update 0000_50_cluster-monitoring-operator_02-role.yaml
juzhao Sep 19, 2025
6e850ef
update component clsuter-role yaml to grant access to networkpolicy
juzhao Sep 19, 2025
0b624dd
update component libsonnet to add networkpolicy permission
juzhao Sep 19, 2025
a8022c0
update CMO 02-namespaced-cluster-role.yaml and 02-role.yaml
juzhao Sep 19, 2025
39e419a
update permission
juzhao Sep 20, 2025
8dae2d3
remove unnecessary component networkpolicy permission
juzhao Sep 20, 2025
63867a8
change deploy networkpolicy task to beginning of each task
juzhao Sep 22, 2025
1fa06d0
update prometheus 10901 port from UDP to TCP
juzhao Sep 23, 2025
010c7e9
update code and add e2e tests for alertmanager
juzhao Sep 28, 2025
910c61b
fix error
juzhao Sep 28, 2025
facd3a4
add e2e cases and update libsonnet and yaml files to reference port n…
juzhao Oct 10, 2025
a473694
remove annotations from libsonnet and yaml files
juzhao Oct 10, 2025
8c65a39
remove comments
juzhao Oct 10, 2025
2ec8ce5
fix error
juzhao Oct 10, 2025
a6ee40b
remvove egress for admission-webhook
juzhao Oct 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions assets/admission-webhook/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: prometheus-operator-admission-webhook
namespace: openshift-monitoring
spec:
ingress:
- ports:
- port: https
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus-operator-admission-webhook
policyTypes:
- Ingress
29 changes: 29 additions & 0 deletions assets/alertmanager/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: alertmanager
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: tenancy
protocol: TCP
- port: tcp-mesh
protocol: TCP
- port: udp-mesh
protocol: UDP
- port: web
protocol: TCP
- port: metrics
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: alertmanager
policyTypes:
- Ingress
- Egress
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: default-deny
namespace: openshift-monitoring
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
21 changes: 21 additions & 0 deletions assets/cluster-monitoring-operator/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: cluster-monitoring-operator
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: https
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: cluster-monitoring-operator
policyTypes:
- Ingress
- Egress
23 changes: 23 additions & 0 deletions assets/kube-state-metrics/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: kube-state-metrics
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: https-main
protocol: TCP
- port: https-self
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: kube-state-metrics
policyTypes:
- Ingress
- Egress
21 changes: 21 additions & 0 deletions assets/metrics-server/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: metrics-server
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: https
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: metrics-server
policyTypes:
- Ingress
- Egress
21 changes: 21 additions & 0 deletions assets/monitoring-plugin/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: monitoring-plugin
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: https
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: monitoring-plugin
policyTypes:
- Ingress
- Egress
21 changes: 21 additions & 0 deletions assets/node-exporter/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: node-exporter
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: https
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: node-exporter
policyTypes:
- Ingress
- Egress
23 changes: 23 additions & 0 deletions assets/openshift-state-metrics/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: openshift-state-metrics
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: https-main
protocol: TCP
- port: https-self
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: openshift-state-metrics
policyTypes:
- Ingress
- Egress
27 changes: 27 additions & 0 deletions assets/prometheus-k8s/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: prometheus
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: web
protocol: TCP
- port: metrics
protocol: TCP
- port: grpc
protocol: TCP
- port: thanos-proxy
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus
policyTypes:
- Ingress
- Egress
21 changes: 21 additions & 0 deletions assets/prometheus-operator/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: prometheus-operator
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: https
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus-operator
policyTypes:
- Ingress
- Egress
21 changes: 21 additions & 0 deletions assets/telemeter-client/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: telemeter-client
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: https
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: telemeter-client
policyTypes:
- Ingress
- Egress
27 changes: 27 additions & 0 deletions assets/thanos-querier/network-policy-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
labels:
app.kubernetes.io/managed-by: cluster-monitoring-operator
app.kubernetes.io/part-of: openshift-monitoring
name: thanos-querier
namespace: openshift-monitoring
spec:
egress:
- {}
ingress:
- ports:
- port: web
protocol: TCP
- port: tenancy
protocol: TCP
- port: tenancy-rules
protocol: TCP
- port: metrics
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: thanos-query
policyTypes:
- Ingress
- Egress
29 changes: 29 additions & 0 deletions jsonnet/components/admission-webhook.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,33 @@ function(params)
},
],
},
// Allow access to prometheus-operator-admission-webhook 8443(port name is https) port
networkPolicyDownstream: {
apiVersion: 'networking.k8s.io/v1',
kind: 'NetworkPolicy',
metadata: {
name: 'prometheus-operator-admission-webhook',
namespace: 'openshift-monitoring',
},
spec: {
podSelector: {
matchLabels: {
'app.kubernetes.io/name': 'prometheus-operator-admission-webhook',
},
},
policyTypes: [
'Ingress',
],
ingress: [
{
ports: [
{
port: 'https',
protocol: 'TCP',
},
],
},
],
},
},
}
50 changes: 50 additions & 0 deletions jsonnet/components/alertmanager.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,54 @@ function(params)
],
},
},
// Allow access to alertmanager 9092(port name: tenancy)/9095(port name: web)/9097(port name: metrics)
// and 9094(port name: udp-mesh for UDP, port name: tcp-mesh for TCP) ports
networkPolicyDownstream: {
apiVersion: 'networking.k8s.io/v1',
kind: 'NetworkPolicy',
metadata: {
name: 'alertmanager',
namespace: cfg.namespace,
},
spec: {
podSelector: {
matchLabels: {
'app.kubernetes.io/name': 'alertmanager',
},
},
policyTypes: [
'Ingress',
'Egress',
],
ingress: [
{
ports: [
{
port: 'tenancy',
protocol: 'TCP',
},
{
port: 'tcp-mesh',
protocol: 'TCP',
},
{
port: 'udp-mesh',
protocol: 'UDP',
},
{
port: 'web',
protocol: 'TCP',
},
{
port: 'metrics',
protocol: 'TCP',
},
],
},
],
egress: [
{},
],
},
},
}
Loading