Exam EX280 Topic 1 Question 30 Discussion

Actual exam question for RedHat's EX280 exam
Question #: 30
Topic #: 1
Create Network Policy
Task information Details:
Create a NetworkPolicy named mysql-db-conn that permits ingress to database pods only from pods matching the specified labels in namespaces labeled team=devsecops , on TCP port 3306 .

Suggested Answer:

See the solution below in Explanation.
Explanation:
Solution:
* Create a file named mysql-db-conn.yaml:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: mysql-db-conn
spec:
podSelector:
matchLabels:
networking.k8s.io/v1/network: database
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
team: devsecops
podSelector:
matchLabels:
deployment: my-web-mysql
ports:
- protocol: TCP
port: 3306
* Apply it:
oc apply -f mysql-db-conn.yaml
* Verify:
oc get networkpolicy
oc describe networkpolicy mysql-db-conn
This task tests namespace/pod label selection and application isolation using OpenShift networking policy controls.

by Sigrid at Jul 14, 2026, 01:51 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10