Difference between revisions of "Spec.affinity.podAntiAffinity"

From wikieduonline
Jump to navigation Jump to search
Line 6: Line 6:
  
 
  apiVersion: elasticsearch.k8s.elastic.co/v1
 
  apiVersion: elasticsearch.k8s.elastic.co/v1
  kind: Elasticsearch
+
  [[kind: Elasticsearch]]
 
  metadata:
 
  metadata:
 
   name: quickstart
 
   name: quickstart

Revision as of 07:43, 24 July 2024



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


See also

  • 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: