Difference between revisions of "Spec.affinity.podAntiAffinity"

From wikieduonline
Jump to navigation Jump to search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{lc}}
 +
[[spec.affinity]].podAntiAffinity
  
  
 +
 +
[[Elasticsearch]] example, official doc: <ref>https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-advanced-node-scheduling.html#k8s_a_single_elasticsearch_node_per_kubernetes_host_default</ref>
 +
 +
apiVersion: elasticsearch.k8s.elastic.co/v1
 +
[[kind: Elasticsearch]]
 +
metadata:
 +
  name: quickstart
 +
spec:
 +
  version: 8.4.3
 +
  [[nodeSets]]:
 +
  - name: default
 +
    count: 3
 +
    [[podTemplate]]:
 +
      spec:
 +
        [[affinity:]]
 +
          podAntiAffinity:
 +
            preferredDuringSchedulingIgnoredDuringExecution:
 +
            - weight: 100
 +
              podAffinityTerm:
 +
                [[labelSelector:]]
 +
                  matchLabels:
 +
                    elasticsearch.k8s.elastic.co/cluster-name: quickstart
 +
                [[topologyKey:]] [[kubernetes.io/hostname]]
  
  
[[Elasticsearch]] example, official doc: <ref>https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-advanced-node-scheduling.html#k8s_a_single_elasticsearch_node_per_kubernetes_host_default</ref>
+
== Related ==
<pre>
+
* [[Kubernetes pod affinity and anti affinity]]
apiVersion: elasticsearch.k8s.elastic.co/v1
 
kind: Elasticsearch
 
metadata:
 
  name: quickstart
 
spec:
 
  version: 8.4.3
 
  nodeSets:
 
  - name: default
 
    count: 3
 
    podTemplate:
 
      spec:
 
        affinity:
 
          podAntiAffinity:
 
            preferredDuringSchedulingIgnoredDuringExecution:
 
            - weight: 100
 
              podAffinityTerm:
 
                labelSelector:
 
                  matchLabels:
 
                    elasticsearch.k8s.elastic.co/cluster-name: quickstart
 
                topologyKey: kubernetes.io/hostname
 
</pre>
 
  
  
 
== See also ==
 
== See also ==
* [[Kubernetes pod affinity and anti affinity]]
+
* {{affinity}}
 +
 
 +
[[Category:K8s]]

Latest revision as of 07:19, 25 July 2024

spec.affinity.podAntiAffinity


Elasticsearch example, official doc: [1]

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: quickstart
spec:
  version: 8.4.3
  nodeSets:
  - name: default
    count: 3
    podTemplate:
      spec:
        affinity:
          podAntiAffinity:
            preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchLabels:
                    elasticsearch.k8s.elastic.co/cluster-name: quickstart
                topologyKey: kubernetes.io/hostname


Related[edit]


See also[edit]

  • https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-advanced-node-scheduling.html#k8s_a_single_elasticsearch_node_per_kubernetes_host_default
  • Advertising: