Skip to content

Instantly share code, notes, and snippets.

@umardx
Created January 9, 2022 05:28
Show Gist options
  • Save umardx/b8ec1ba3abe50728373fc9c47a83eca3 to your computer and use it in GitHub Desktop.
Save umardx/b8ec1ba3abe50728373fc9c47a83eca3 to your computer and use it in GitHub Desktop.
Distribute Pods Evenly Across The Cluster
---
apiVersion: v1
kind: Namespace
metadata:
name: net-tools
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: net-tools
namespace: net-tools
spec:
replicas: 3
selector:
matchLabels:
type: net-tools
template:
metadata:
labels:
type: net-tools
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
type: net-tools
containers:
- name: pause
image: praqma/network-multitool:c3d4e04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment