Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
83 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
4b8c7ec
update PR based on comments
juzhao Oct 17, 2025
7cb2edd
remove no needed NetworkPolicy check for node-exporter
juzhao Oct 17, 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
25 changes: 25 additions & 0 deletions assets/admission-webhook/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: prometheus-operator-admission-webhook-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus-operator-admission-webhook # Label must match your prometheus-operator-admission-webhook pod
policyTypes:
- Ingress
- Egress
ingress:
# Allow access to port 8443
- ports:
- port: 8443
protocol: TCP
egress:
# Allow curl 8443 and return result from any pod under any namespace
- {}
32 changes: 32 additions & 0 deletions assets/alertmanager/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: alertmanager-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: alertmanager # Label must match your alertmanager pod
policyTypes:
- Ingress
- Egress
# Allow access to ports 9092(tenancy)/9094(service)/9095(web)/9097(metrics) from all pods in all namespaces for ingress and egress
ingress:
- ports:
- port: 9092
protocol: TCP
- port: 9094
protocol: TCP
- port: 9094
protocol: UDP
- port: 9095
protocol: TCP
- port: 9097
protocol: TCP
egress:
- {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: cluster-monitoring-operator-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: cluster-monitoring-operator
policyTypes:
- Ingress
- Egress
ingress:
# Allow access to port 8443
- ports:
- port: 8443
protocol: TCP
egress:
# Allow curl 8443 and return result from any pod under any namespace
- {}
15 changes: 15 additions & 0 deletions assets/cluster-monitoring-operator/default-deny-networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: default-deny
namespace: openshift-monitoring
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
26 changes: 26 additions & 0 deletions assets/kube-state-metrics/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: kube-state-metrics-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: kube-state-metrics # Label must match your kube-state-metrics pod
policyTypes:
- Ingress
- Egress
# Allow access to ports 8443(https-main)/9443(https-self)
ingress:
- ports:
- port: 8443
protocol: TCP
- port: 9443
protocol: TCP
egress:
- {}
24 changes: 24 additions & 0 deletions assets/metrics-server/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: metrics-server-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: metrics-server # Label must match your metrics-server pod
policyTypes:
- Ingress
- Egress
# Allow access to ports 10250
ingress:
- ports:
- port: 10250
protocol: TCP
egress:
- {}
24 changes: 24 additions & 0 deletions assets/monitoring-plugin/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: monitoring-plugin-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: monitoring-plugin # Label must match your monitoring-plugin pod
policyTypes:
- Ingress
- Egress
ingress:
# Allow access to port 9443
- ports:
- port: 9443
protocol: TCP
egress:
- {}
26 changes: 26 additions & 0 deletions assets/openshift-state-metrics/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: openshift-state-metrics-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: openshift-state-metrics # Label must match your openshift-state-metrics pod
policyTypes:
- Ingress
- Egress
# Allow access to ports 8443(https-main)/9443(https-self)
ingress:
- ports:
- port: 8443
protocol: TCP
- port: 9443
protocol: TCP
egress:
- {}
33 changes: 33 additions & 0 deletions assets/prometheus-k8s/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: prometheus-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus # Label must match your Prometheus pod
policyTypes:
- Ingress
- Egress
ingress:
# Allow access to ports 9091(svc port)/9092(metrics port)
- ports:
- port: 9091
protocol: TCP
- port: 9092
protocol: TCP
# grpc port 10901
- port: 10901
protocol: TCP
# thanos-proxy port 10903 for prometheus thanos-sidecar target
- port: 10903
protocol: TCP
# allow to access targert port to check target health and scrape from target
egress:
- {}
25 changes: 25 additions & 0 deletions assets/prometheus-operator/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: prometheus-operator-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: prometheus-operator # Label must match your prometheus-operator pod
policyTypes:
- Ingress
- Egress
ingress:
# Allow access to port 8443
- ports:
- port: 8443
protocol: TCP
egress:
# Allow curl 8443 and return result from any pod under any namespace
- {}
24 changes: 24 additions & 0 deletions assets/telemeter-client/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: telemeter-client-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: telemeter-client # Label must match your telemeter-client pod
policyTypes:
- Ingress
- Egress
ingress:
# Allow access to port 8443
- ports:
- port: 8443
protocol: TCP
egress:
- {}
25 changes: 25 additions & 0 deletions assets/thanos-querier/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
annotations:
include.release.openshift.io/hypershift: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
name: thanos-querier-access
namespace: openshift-monitoring
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: thanos-query # Label must match your thanos-query pod
policyTypes:
- Ingress
- Egress
# Allow access to ports 9091(svc)/9092(tenancy)/9093(tenancy-rules)/9094(metrics) from all pods in all namespaces for ingress and egress
ingress:
- ports:
- port: 9091
endPort: 9094
protocol: TCP
egress:
- {}
38 changes: 38 additions & 0 deletions jsonnet/components/admission-webhook.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,42 @@ function(params)
},
],
},
networkPolicy: {
apiVersion: 'networking.k8s.io/v1',
kind: 'NetworkPolicy',
metadata: {
annotations: {
'include.release.openshift.io/hypershift': 'true',
'include.release.openshift.io/ibm-cloud-managed': 'true',
'include.release.openshift.io/self-managed-high-availability': 'true',
'include.release.openshift.io/single-node-developer': 'true',
},
name: 'prometheus-operator-access',
namespace: 'openshift-monitoring',
},
spec: {
podSelector: {
matchLabels: {
'app.kubernetes.io/name': 'prometheus-operator',
},
},
policyTypes: [
'Ingress',
'Egress',
],
ingress: [
{
ports: [
{
port: '8443',
protocol: 'TCP',
},
],
},
],
egress: [
{},
],
},
},
}
Loading