Difference between revisions of "Template:Nodeaffinity ex"

From wikieduonline
Jump to navigation Jump to search
(Created page with " apiVersion: v1 kind: Pod metadata: name: with-node-affinity spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: no...")
 
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
   name: with-node-affinity
 
   name: with-node-affinity
 
  spec:
 
  spec:
   affinity:
+
   [[affinity]]:
     nodeAffinity:
+
     [[nodeAffinity]]:
 
       [[requiredDuringSchedulingIgnoredDuringExecution]]:
 
       [[requiredDuringSchedulingIgnoredDuringExecution]]:
 
         nodeSelectorTerms:
 
         nodeSelectorTerms:
 
         - matchExpressions:
 
         - matchExpressions:
           - key: topology.kubernetes.io/zone
+
           - key: [[topology.kubernetes.io/zone]]
 
             operator: In
 
             operator: In
 
             values:
 
             values:
 
             - antarctica-east1
 
             - antarctica-east1
 
             - antarctica-west1
 
             - antarctica-west1
       preferredDuringSchedulingIgnoredDuringExecution:
+
       [[preferredDuringSchedulingIgnoredDuringExecution]]:
 
       - weight: 1
 
       - weight: 1
 
         preference:
 
         preference:
Line 24: Line 24:
 
   containers:
 
   containers:
 
   - name: with-node-affinity
 
   - name: with-node-affinity
     image: registry.k8s.io/pause:2.0
+
     image: [[registry.k8s.io/pause]]:2.0

Latest revision as of 12:59, 25 July 2024

apiVersion: v1
kind: Pod
metadata:
  name: with-node-affinity
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: topology.kubernetes.io/zone
            operator: In
            values:
            - antarctica-east1
            - antarctica-west1
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 1
        preference:
          matchExpressions:
          - key: another-node-label-key
            operator: In
            values:
            - another-node-label-value
  containers:
  - name: with-node-affinity
    image: registry.k8s.io/pause:2.0

Advertising: