Node Affinity
Node Affinity (๋
ธ๋ ์ดํผ๋ํฐ)
๋ ธ๋ ์ดํผ๋ํฐ๋ node์ ๋ฑ๋ก๋์ด์๋ ๋ผ๋ฒจ์ ํค ๋ฐธ๋ฅ ์ ๋ณด๋ก ํ๋๊ฐ ์ด๋ค ๋ ธ๋์ ํ ๋นํ ์ง ์ ์ํ๋ ๊ฒ์ด๋ค.
pod ์์ฑ ์ ์๋์ ๊ฐ์ด ์ ์ํ ์ ์๋ค.
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent์ ์์ ์์๋ ํค : disktype , ๊ฐ : ssd๋ก ๋์ด์๋๋ฐ operator ์ ๊ฐ์ ํตํด์ ๋ฐธ๋ฅ๊ฐ ์๋์ง ์๋์ง ํ๋ณ ๊ฐ๋ฅํ๋ค.
Type

1. requiredDuringSchedulingIgnoredDuringExecution
๊ท์น์ด ๋ง์กฑ๋์ง ์์ผ๋ฉด ์ค์ผ์ค๋ฌ๊ฐ ํ๋๋ฅผ ์ค์ผ์ฅด๋งํ ์ ์๋ค.
2. preferredDuringSchedulingIgnoredDuringExecution
์ค์ผ์ฅด๋ฌ๋ ์กฐ๊ฑด์ ๋ง์กฑํ๋ ๋ ธ๋๋ฅผ ์ฐพ์ผ๋ ค๊ณ ๋ ธ๋ ฅํ๋ค. ํด๋น๋๋ ๋ ธ๋๊ฐ ์๋๋ผ๋, ์ค์ผ์ฅด๋ฌ๋ ์ฌ์ ํ ํ๋๋ฅผ ์ค์ผ์ฅด๋ง ํ๋ค.
Last updated