Created
March 21, 2019 17:25
-
-
Save darioblanco/b9192c8b3ef96b1abe8d57de97e58993 to your computer and use it in GitHub Desktop.
Example of pod anti affinity with label
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: mypod | |
labels: | |
app: mypod-app | |
spec: | |
affinity: | |
podAntiAffinity: | |
requiredDuringSchedulingIgnoredDuringExecution: | |
- labelSelector: | |
matchLabels: | |
app: mypod-app | |
topologyKey: "kubernetes.io/hostname" | |
containers: | |
- name: mypod-container | |
image: k8s.gcr.io/mypodcontainer:2.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment