You are viewing documentation for a release that is no longer maintainedSee documentation for the latest supported version 3 or the latest supported version 4.
3.8.3.2. 複数の Pod トポロジー分散制約の例
このサンプル Pod 仕様は 2 つの Pod トポロジー分散制約を定義します。どちらの場合も foo:bar というラベルが付けられた Pod で一致し、スキューの 1 を指定し、これらの要件を満たしていない Pod をスケジュールしません。
最初の制約は、ユーザー定義ラベルの node に基づいて Pod を分散し、2 つ目の制約はユーザー定義ラベルの rack に基づいて Pod を分散します。Pod がスケジュールされるには、両方の制約を満たす必要があります。
kind: Pod
apiVersion: v1
metadata:
name: my-pod-2
labels:
foo: bar
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: node
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
foo: bar
- maxSkew: 1
topologyKey: rack
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
foo: bar
containers:
- image: "docker.io/ocpqe/hello-pod"
name: hello-pod
kind: Pod
apiVersion: v1
metadata:name: my-pod-2labels:foo: bar
spec:topologySpreadConstraints:-maxSkew:1topologyKey: node
whenUnsatisfiable: DoNotSchedule
labelSelector:matchLabels:foo: bar
-maxSkew:1topologyKey: rack
whenUnsatisfiable: DoNotSchedule
labelSelector:matchLabels:foo: bar
containers:-image:"docker.io/ocpqe/hello-pod"name: hello-pod
Copy to ClipboardCopied!Toggle word wrapToggle overflow