Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Cloud Native with Kubernetes

You're reading from   Cloud Native with Kubernetes Deploy, configure, and run modern cloud native applications on Kubernetes

Arrow left icon
Product type Paperback
Published in Jan 2021
Publisher Packt
ISBN-13 9781838823078
Length 446 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Alexander Raul Alexander Raul
Author Profile Icon Alexander Raul
Alexander Raul
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Section 1: Setting Up Kubernetes
2. Chapter 1: Communicating with Kubernetes FREE CHAPTER 3. Chapter 2: Setting Up Your Kubernetes Cluster 4. Chapter 3: Running Application Containers on Kubernetes 5. Section 2: Configuring and Deploying Applications on Kubernetes
6. Chapter 4: Scaling and Deploying Your Application 7. Chapter 5: Services and Ingress – Communicating with the Outside World 8. Chapter 6: Kubernetes Application Configuration 9. Chapter 7: Storage on Kubernetes 10. Chapter 8: Pod Placement Controls 11. Section 3: Running Kubernetes in Production
12. Chapter 9: Observability on Kubernetes 13. Chapter 10: Troubleshooting Kubernetes 14. Chapter 11: Template Code Generation and CI/CD on Kubernetes 15. Chapter 12: Kubernetes Security and Compliance 16. Section 4: Extending Kubernetes
17. Chapter 13: Extending Kubernetes with CRDs 18. Chapter 14: Service Meshes and Serverless 19. Chapter 15: Stateful Workloads on Kubernetes 20. Assessments 21. Other Books You May Enjoy

Implementing taints and tolerations

Taints and tolerations in Kubernetes work like reverse node selectors. Rather than nodes attracting Pods due to having the proper labels, which are then consumed by a selector, we taint nodes, which repels all Pods from being scheduled on the node, and then mark our Pods with tolerations, which allow them to be scheduled on the tainted nodes.

As mentioned at the beginning of the chapter, Kubernetes uses system-created taints to mark nodes as unhealthy and prevent new workloads from being scheduled on them. For instance, the out-of-disk taint will prevent any new pods from being scheduled to a node with that taint.

Let's take the same example use case that we had with node selectors and apply it using taints and tolerations. Since this is basically the reverse of our previous setup, let's first give our node a taint using the kubectl taint command:

> kubectl taint nodes node2 cpu_speed=slow:NoSchedule

Let's pick apart...

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
Banner background image