Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Certified Kubernetes Administrator (CKA) Exam Guide

You're reading from   Certified Kubernetes Administrator (CKA) Exam Guide Validate your knowledge of Kubernetes and implement it in a real-life production environment

Arrow left icon
Product type Paperback
Published in Nov 2022
Publisher Packt
ISBN-13 9781803238265
Length 322 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Mélony Qin Mélony Qin
Author Profile Icon Mélony Qin
Mélony Qin
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Part 1: Cluster Architecture, Installation, and Configuration
2. Chapter 1: Kubernetes Overview FREE CHAPTER 3. Chapter 2: Installing and Configuring Kubernetes Clusters 4. Chapter 3: Maintaining Kubernetes Clusters 5. Part 2: Managing Kubernetes
6. Chapter 4: Application Scheduling and Lifecycle Management 7. Chapter 5: Demystifying Kubernetes Storage 8. Chapter 6: Securing Kubernetes 9. Chapter 7: Demystifying Kubernetes Networking 10. Part 3: Troubleshooting
11. Chapter 8: Monitoring and Logging Kubernetes Clusters and Applications 12. Chapter 9: Troubleshooting Cluster Components and Applications 13. Chapter 10: Troubleshooting Security and Networking 14. Index 15. Other Books You May Enjoy Appendix - Mock CKA scenario-based practice test resolutions

Managing the security of Kubernetes applications

A securityContext field defines the privilege and access control settings for a Pod in the Pod YAML specification. We need to configure the security context in case a Pod or container needs to interact with the security mechanisms of the underlying operating system unconventionally, and in this section, we’ll introduce how to configure a security context for a Pod or container.

As a part of your prep work, you can create a new user and a new group as shown in the following:

sudo useradd -u 2000 container-user-0
sudo groupadd -g 3000 container-group-0

We will now log in to the worker node and create a new .txt file called message.txt:

sudo mkdir -p /etc/message
echo "hello Packt" | sudo tee -a /etc/message/message.txt

From here, you’ll see the message that we input from the terminal:

 hello Packt

Now, we need to adjust the permission to limit the permission for testing purposes, which is...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime