mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
91 lines
2.8 KiB
YAML
91 lines
2.8 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
|
suite: pod affinity
|
|
templates:
|
|
- common.yaml
|
|
values:
|
|
- ../_values/controllers_main_default_container.yaml
|
|
tests:
|
|
- it: default should pass
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: Deployment
|
|
- documentIndex: 0
|
|
notExists:
|
|
path: spec.template.spec.affinity
|
|
|
|
- it: defaultPodOption should pass
|
|
set:
|
|
defaultPodOptions:
|
|
affinity:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: topology.kubernetes.io/zone
|
|
operator: In
|
|
values:
|
|
- antarctica-east1
|
|
- antarctica-west1
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: Deployment
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.template.spec.affinity
|
|
value:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: topology.kubernetes.io/zone
|
|
operator: In
|
|
values:
|
|
- antarctica-east1
|
|
- antarctica-west1
|
|
|
|
- it: defaultPodOption with pod override should pass
|
|
set:
|
|
defaultPodOptions:
|
|
affinity:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: topology.kubernetes.io/zone
|
|
operator: In
|
|
values:
|
|
- antarctica-east1
|
|
- antarctica-west1
|
|
controllers:
|
|
main:
|
|
pod:
|
|
affinity:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: topology.kubernetes.io/zone
|
|
operator: In
|
|
values:
|
|
- asia-east1
|
|
- asia-west1
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: Deployment
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.template.spec.affinity
|
|
value:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: topology.kubernetes.io/zone
|
|
operator: In
|
|
values:
|
|
- asia-east1
|
|
- asia-west1
|