$ kubectl get pods -o jsonpath={..spec.nodeName} | tr ' ' '\n' | sort | uniq -c
15 ip-10-0-34-210.us-west-1.compute.internal
15 ip-10-0-61-157.us-west-1.compute.internal
Created
February 23, 2018 19:45
-
-
Save coresolve/ebcbe6beac454eda3a68db639cce36b5 to your computer and use it in GitHub Desktop.
test anti affinity of pods.
This file contains hidden or 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: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
creationTimestamp: null | |
labels: | |
run: slam | |
name: slam | |
spec: | |
replicas: 30 | |
selector: | |
matchLabels: | |
run: slam | |
strategy: {} | |
template: | |
metadata: | |
creationTimestamp: null | |
labels: | |
run: slam | |
spec: | |
affinity: | |
podAntiAffinity: | |
preferredDuringSchedulingIgnoredDuringExecution: | |
- weight: 100 | |
podAffinityTerm: | |
labelSelector: | |
matchExpressions: | |
- key: run #I am using the labels set on the nodes of this deployment. | |
operator: In | |
values: | |
- slam | |
topologyKey: kubernetes.io/hostname | |
containers: | |
- image: quay.io/dcooley/simple-app:plain | |
name: slam | |
resources: {} | |
status: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment