ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 15 - CKAD discussion

Report
Export

Context

Task

You have rolled out a new pod to your infrastructure and now you need to allow it to communicate with the web and storage pods but nothing else. Given the running pod kdsn00201 -newpod edit it to use a network policy that will allow it to send and receive traffic only to and from the web and storage pods.

A.
See the solution below.
Answers
A.
See the solution below.
Suggested answer: A

Explanation:

apiVersion: networking.k8s.i o/v1
kind: NetworkPolicy
metadata:
name: internal-policy
namespace: default
spec:
podSelector:
matchLabels:
name: internal
policyTypes:
- Egress
- Egress
ingress:
- {}
egress:
- to:
- podSelector:
matchLabels:
name: mysql
ports:
- protocol: TCP
port: 3306
- to:
- podSelector:
matchLabels:
name: payroll
ports:
- protocol: TCP
port: 8080
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP


asked 18/09/2024
Matt Harrold
44 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first