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
Conferences
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

Using inter-Pod affinity and anti-affinity

Inter-Pod affinity and anti-affinity let you dictate how Pods should run based on which other Pods already exist on a node. Since the number of Pods in a cluster is typically much larger than the number of nodes, and some Pod affinity and anti-affinity rules can be somewhat complex, this feature can put quite a load on your cluster control plane if you are running many pods on many nodes. For this reason, the Kubernetes documentation does not recommend using these features with a large number of nodes in your cluster.

Pod affinities and anti-affinities work fairly differently – let's look at each by itself before discussing how they can be combined.

Pod affinities

As with node affinities, let's dive into the YAML in order to discuss the constituent parts of a Pod affinity spec:

pod-with-pod-affinity.yaml

apiVersion: v1
kind: Pod
metadata:
  name: not-hungry-app-affinity
spec:
  affinity:...
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