Skip to content

Instantly share code, notes, and snippets.

@vigneshragupathy
Created November 24, 2019 12:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vigneshragupathy/a4048e59449210e28e4bf66971c8d56a to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod-podaffinity
labels:
env: test
spec:
containers:
- name: nginx-pod-podaffinity
image: nginx
imagePullPolicy: IfNotPresent
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- web-nginx-backend
topologyKey: kubernetes.io/hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment