Cluster:qa-cluster Master node:masterWorker node:worker1 You can switch the cluster/configuration context using the following command: [desk@cli] $kubectl config use-context qa-cluster Task: Create a NetworkPolicy namedrestricted-policyto restrict access to Podproductrunning in namespacedev. Only allow the following Pods to connect to Pod products-service: 1. Pods in the namespaceqa 2. Pods with labelenvironment: stage, in any namespace
Suggested Answer: A
Get Premium CKS Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
29 comments · newest first
JO
Jovita
12 months ago
But what if we need to allow more Pods later? Seems too strict.
ED
Edison
1 year ago
I think restricting access like this is a good security practice.
JO
Jordan
1 year ago
Wait, does this mean Pods in other namespaces can't connect at all?
AL
Alpha
1 year ago
Totally agree, that command is essential for managing multiple clusters!
OR
Oretha
1 year ago
Just a reminder, the command to switch context is `kubectl config use-context qa-cluster`.
JO
Joanna
1 year ago
I think we can use the `podSelector` and `namespaceSelector` for this task, but I’m not 100% confident about how to combine them for the labels.
BL
Blossom
1 year ago
I feel a bit confused about the order of the rules in the NetworkPolicy. Do we need to define the ingress and egress separately?
AY
Ayesha
1 year ago
This question seems similar to one we did in class about restricting access based on labels. I think I need to recall how to specify the pod selectors correctly.
SH
Shenika
1 year ago
I remember we practiced creating NetworkPolicies, but I'm not entirely sure about the syntax for allowing specific namespaces and labels.
CA
Casie
1 year ago
Hmm, this looks like a Snowflake-specific question. I'll need to think carefully about the different ways to interact with a stage and directory in Snowflake.
IS
Isreal
1 year ago
Hmm, this is a tricky one. I'll need to carefully review the information about Commvault IntelliSnap and NetApp SnapCenter to determine how they handle SQL Server transaction logs.
AL
Alline
1 year ago
Hmm, I'm a bit unsure about this one. The different code segments seem similar, but I need to make sure I understand the nuances of how each one handles the error. Let me re-read the question and options closely.
DA
Dante
1 year ago
Hmm, I'm a bit unsure about this one. I know SSH is used for secure remote access, but I can't remember the default port off the top of my head. I'll have to think this through carefully.
NA
Natalie
1 year ago
Hmm, this is an interesting question. I'll need to think carefully about the different options and what a rotating pattern could apply to.
HE
Heike
1 year ago
This question is a piece of cake! Option B is the way to go. Now, where's the coffee machine in this testing center?
BE
Benton
1 year ago
I was a bit confused at first, but after reading through the options, B is the clear winner. Time to move on to the next question!
HU
Hubert
1 year ago
Haha, I bet the exam writers were feeling pretty clever with this one. But option B is the way to go, no doubt about it.
DE
Delisa
1 year ago
Yeah, option B is the most logical and secure choice for creating the NetworkPolicy.
FR
Francisca
1 year ago
The exam writers did try to make it tricky, but option B stands out as the correct answer.
SH
Sharmaine
1 year ago
I agree, option B covers all the requirements perfectly.
EL
Elfriede
1 year ago
Option B is definitely the best choice for this scenario.
XO
Xochitl
1 year ago
Option B seems to be the correct answer. The question clearly states the requirements, and that's what the NetworkPolicy in option B is addressing.
BE
Bettye
1 year ago
Yes, option B aligns perfectly with the conditions mentioned in the task. It's the most suitable solution.
TH
Theola
1 year ago
I agree, option B is the best choice for creating the NetworkPolicy to restrict access as per the given criteria.
CA
Carman
1 year ago
Option B is indeed the correct answer. It meets the requirements specified in the question.
JO
Joye
2 years ago
This looks straightforward, I'll go with option B. Restricting access to the 'products-service' Pod based on the specified criteria.
AS
Ashleigh
2 years ago
I feel confident about this, I have practiced similar scenarios.
JA
Janna
2 years ago
I agree, it requires a good understanding of NetworkPolicy.
BR
Brandon
2 years ago
I think this question is tricky.