"쿠버네티스 Pod Affinity"의 두 판 사이의 차이

 
(사용자 2명의 중간 판 8개는 보이지 않습니다)
9번째 줄: 9번째 줄:
| preferredDuringSchedulingIgnoredDuringExecution || soft 약한 규칙(권장사항)
| preferredDuringSchedulingIgnoredDuringExecution || soft 약한 규칙(권장사항)
|}
|}
{{소스헤더|pod-with-pod-affinity.yaml}}
<syntaxhighlight lang='yaml'>
apiVersion: v1
kind: Pod
metadata:
  name: with-pod-affinity
spec:
  affinity:
    podAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: security
            operator: In
            values:
            - S1
        topologyKey: failure-domain.beta.kubernetes.io/zone
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: security
              operator: In
              values:
              - S2
          topologyKey: failure-domain.beta.kubernetes.io/zone
  containers:
  - name: with-pod-affinity
    image: k8s.gcr.io/pause:2.0
</syntaxhighlight>


==같이 보기==
==같이 보기==
* [[쿠버네티스 Pod]]
* [[쿠버네티스 Pod]]
* [[쿠버네티스 PodSpec]]
* [[쿠버네티스 PodSpec]]
* [[쿠버네티스 Affinity Rules]]
* [[쿠버네티스 Affinity]]
* [[쿠버네티스 Node Affinity]]
* [[쿠버네티스 nodeSelector]]
* [[쿠버네티스 nodeSelector]]
* [[쿠버네티스 스케줄링]]
* [[쿠버네티스 스케줄링]]
19번째 줄: 53번째 줄:
==참고==
==참고==
* https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#pod-v1-core
* https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#pod-v1-core
* https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity


[[분류: kubernetes]]
[[분류:K8s]]

2023년 1월 8일 (일) 17:31 기준 최신판

1 개요[ | ]

쿠버네티스 Pod Affinity Rules
쿠버네티스 Pod 어피니티 규칙
  • 연산자 In, NotIn, Exists, DoesNotExist 사용
requiredDuringSchedulingIgnoredDuringExecution hard 강한 규칙(강제사항)
preferredDuringSchedulingIgnoredDuringExecution soft 약한 규칙(권장사항)
pod-with-pod-affinity.yaml
apiVersion: v1
kind: Pod
metadata:
  name: with-pod-affinity
spec:
  affinity:
    podAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: security
            operator: In
            values:
            - S1
        topologyKey: failure-domain.beta.kubernetes.io/zone
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: security
              operator: In
              values:
              - S2
          topologyKey: failure-domain.beta.kubernetes.io/zone
  containers:
  - name: with-pod-affinity
    image: k8s.gcr.io/pause:2.0

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}