Search icon CANCEL
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
The Complete Kubernetes Guide

You're reading from   The Complete Kubernetes Guide Become an expert in container management with the power of Kubernetes

Arrow left icon
Product type Course
Published in May 2019
Publisher Packt
ISBN-13 9781838647346
Length 628 pages
Edition 1st Edition
Arrow right icon
Authors (3):
Arrow left icon
Jesse White Jesse White
Author Profile Icon Jesse White
Jesse White
Gigi Sayfan Gigi Sayfan
Author Profile Icon Gigi Sayfan
Gigi Sayfan
Jonathan Baier Jonathan Baier
Author Profile Icon Jonathan Baier
Jonathan Baier
Arrow right icon
View More author details
Toc

Table of Contents (26) Chapters Close

Title Page
Copyright and Credits
About Packt
Contributors
Preface
1. Introduction to Kubernetes FREE CHAPTER 2. Understanding Kubernetes Architecture 3. Building a Foundation with Core Kubernetes Constructs 4. Working with Networking, Load Balancers, and Ingress 5. Using Critical Kubernetes Resources 6. Exploring Kubernetes Storage Concepts 7. Monitoring and Logging 8. Monitoring, Logging, and Troubleshooting 9. Operating Systems, Platforms, and Cloud and Local Providers 10. Creating Kubernetes Clusters 11. Cluster Federation and Multi-Tenancy 12. Cluster Authentication, Authorization, and Container Security 13. Running Stateful Applications with Kubernetes 14. Rolling Updates, Scalability, and Quotas 15. Advanced Kubernetes Networking 16. Kubernetes Infrastructure Management 17. Customizing Kubernetes - API and Plugins 18. Handling the Kubernetes Package Manager 19. The Future of Kubernetes 1. Other Books You May Enjoy Index

Using namespace to limit access


The Hue project is moving along nicely, and we have a few hundred microservices and about 100 developers and DevOps engineers working on it. Groups of related microservices emerge, and you notice that many of these groups are pretty autonomous. They are completely oblivious to the other groups. Also, there are some sensitive areas, such as health and finance, that you will want to control access to more effectively. Enter namespaces.

Let's create a new service, Hue-finance, and put it in a new namespace called restricted.

Here is the YAML file for the new restricted namespace:

kind: Namespace 
 apiVersion: v1
 metadata:
     name: restricted
     labels:
       name: restricted
    
> kubectl create -f restricted-namespace.yaml
namespace "restricted" created 

Once the namespace has been created, we need to configure a context for the namespace. This will allow restricting access just to this namespace:

> kubectl config set-context restricted --namespace=restricted...
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