Exercise 6.5: Testing the Policy- Does the yaml file snippet actually answer the task required?
COPYRIGHTED CONTENT REMOVED
Sharing copyrighted training content violates the copyright rules of The Linux Foundation.
Please review the "Copyright and Usage Information" page included in the "Course Introduction" chapter.
I thought that specifying this field podSelector: {} would select all pods in that namespace and not only the nginx container as required by the task.
Could that be a typo or are we expected to infer that there is only one nginx container in that namespace?
Best Answer
-
Hi @samude,
Since the exercise only tests the policy's effect on the nginx container, it is not necessary to declare a podSelector. However, if a complex multi-tier application were the use case, then multiple policies with distinct podSelectors would be required.
Regards,
-Chris0
Answers
-
Hi @samude,
Please be aware that sharing copyrighted training content in a public forum violates the copyright rules of The Linux Foundation.
The copyrighted content shared in your post has been removed. Rephrase your question to minimize exposure of actual training content in the public forum.
Regards,
-Chris0 -
Hi @chrispokorni, first of all apologies for unintentionally sharing training content and thanks for calling my attention to that.
My question is regarding task 7 of exercise 6.5. I thought that specifying this field podSelector: {} would select all pods in that namespace and not only the nginx container as required by the task.
Could that be a typo or should one be expected to assume that there is only one nginx container in that namespace?
Regards.
0 -
Hi @samude,
An empty
podSelector: {}applies the NetworkPolicy rules to all the Pods in the Namespace, regardless of application (webserver, database, backend, etc...).
You can read more about the NetworkPolicy resource in the official Kubernetes documentation:
https://kubernetes.io/docs/concepts/services-networking/network-policies/#networkpolicy-resourceRegards,
-Chris0 -
Hi @chrispokorni, i understand this part clearly: An empty podSelector: {} applies the NetworkPolicy rules to all the Pods in the Namespace, regardless of application (webserver, database, backend, etc...). For that reason i would like to know if that yaml example would correctly select only the nginx container as intended by the task or is there a typo in the yaml as both of us has agreed that an empty podSelector: {} applies the NetworkPolicy rules to all the Pods in the Namespace and not just to the nginx container?
Thanks and regards.
0 -
Hi @samude,
An empty
podSelector: {}applies the NetworkPolicy rules to all the Pods in the Namespace, regardless of application (webserver, database, backend, etc...).To clarify, this means that the NetworkPolicy does not select any specific application Pod from the Namespace, instead, it applies the rules to all the Pods deployed in the Namespace.
Regards,
-Chris0 -
Hi @chrispokorni, from the task point of view that clearly instructs to target ONLY the nginx container, shouldn't podSelector: {} be corrected by adding a matchLabels with the pod label of the nginx container pod instead in order to select/target ONLY the nginx container pod as intended by the task?
Thanks and regards.
0 -
Hi @chrispokorni , thanks for the clarification, I would think that it’s necessary to update the task with this clarification of yours. Otherwise that will leave candidates confused especially from the exam point of view.
Thanks and regards.
0
Categories
- All Categories
- 177 LFX Mentorship
- 177 LFX Mentorship: Linux Kernel
- 754 Linux Foundation IT Professional Programs
- 374 Cloud Engineer IT Professional Program
- 170 Advanced Cloud Engineer IT Professional Program
- 74 DevOps IT Professional Program - Discontinued
- 5 DevOps & GitOps IT Professional Program
- 100 Cloud Native Developer IT Professional Program
- 7.6K Training Courses & Learning Paths
- 2 AI & ML Training
- 1 Blockchain & Decentralized Identity Training
- 5 Cloud & Containers Training
- 1 Cybersecurity Training
- 2 DevOps & Site-Reliability Training
- 1 Linux Kernel Development Training
- 1 Networking Training
- 2 Open Source Best Practice Training
- 2 System Administration Training
- 1 System Engineering Training
- 1 Web & Application Development Training
- 794 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 95 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 89 Storage
- 769 Linux Distributions
- 81 Debian
- 68 Fedora
- 22 Linux Mint
- 13 Mageia
- 24 openSUSE
- 150 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 465 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 98 Linux Security
- 78 Network Management
- 101 System Management
- 46 Web Management
- 112 Mobile Computing
- 20 Android
- 77 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 393 Off Topic
- 121 Introductions
- 182 Small Talk
- 29 Study Material
- 976 Programming and Development
- 310 Kernel Development
- 648 Software Development
- 990 Software
- 382 Applications
- 182 Command Line
- 5 Compiling/Installing
- 68 Games
- 317 Installation
- Archived
- 2 LFD140 Class Forum
- 1.4K LFS258 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)