2023-12-14 15:17:09 +00:00
|
|
|
suite: Controller > Deployment
|
|
|
|
templates:
|
|
|
|
- controller-deployment.yaml
|
|
|
|
|
|
|
|
tests:
|
|
|
|
- it: should create a Deployment
|
|
|
|
asserts:
|
|
|
|
- hasDocuments:
|
|
|
|
count: 1
|
|
|
|
- isKind:
|
|
|
|
of: Deployment
|
|
|
|
- equal:
|
|
|
|
path: metadata.name
|
|
|
|
value: RELEASE-NAME-ingress-nginx-controller
|
|
|
|
|
|
|
|
- it: should create a Deployment with 3 replicas if `controller.replicaCount` is 3
|
|
|
|
set:
|
|
|
|
controller.replicaCount: 3
|
|
|
|
asserts:
|
|
|
|
- equal:
|
|
|
|
path: spec.replicas
|
|
|
|
value: 3
|
|
|
|
|
2024-03-12 13:43:51 +00:00
|
|
|
- it: should create a Deployment without replicas if `controller.autoscaling.enabled` is true
|
|
|
|
set:
|
|
|
|
controller.autoscaling.enabled: true
|
|
|
|
asserts:
|
|
|
|
- notExists:
|
|
|
|
path: spec.replicas
|
|
|
|
|
|
|
|
- it: should create a Deployment without replicas if `controller.keda.enabled` is true
|
|
|
|
set:
|
|
|
|
controller.keda.enabled: true
|
|
|
|
asserts:
|
|
|
|
- notExists:
|
|
|
|
path: spec.replicas
|
|
|
|
|
|
|
|
- it: should create a Deployment with replicas if `controller.autoscaling.enabled` is true and `controller.keda.enabled` is true
|
|
|
|
set:
|
|
|
|
controller.autoscaling.enabled: true
|
|
|
|
controller.keda.enabled: true
|
|
|
|
asserts:
|
|
|
|
- exists:
|
|
|
|
path: spec.replicas
|
|
|
|
|
2024-02-02 06:55:15 +00:00
|
|
|
- it: should create a Deployment with argument `--enable-metrics=false` if `controller.metrics.enabled` is false
|
|
|
|
set:
|
|
|
|
controller.metrics.enabled: false
|
|
|
|
asserts:
|
|
|
|
- contains:
|
|
|
|
path: spec.template.spec.containers[0].args
|
|
|
|
content: --enable-metrics=false
|
|
|
|
|
|
|
|
- it: should create a Deployment without argument `--enable-metrics=false` if `controller.metrics.enabled` is true
|
|
|
|
set:
|
|
|
|
controller.metrics.enabled: true
|
|
|
|
asserts:
|
|
|
|
- notContains:
|
|
|
|
path: spec.template.spec.containers[0].args
|
|
|
|
content: --enable-metrics=false
|
|
|
|
|
2023-12-14 15:17:09 +00:00
|
|
|
- it: should create a Deployment with resource limits if `controller.resources.limits` is set
|
|
|
|
set:
|
|
|
|
controller.resources.limits.cpu: 500m
|
|
|
|
controller.resources.limits.memory: 512Mi
|
|
|
|
asserts:
|
|
|
|
- equal:
|
|
|
|
path: spec.template.spec.containers[0].resources.limits.cpu
|
|
|
|
value: 500m
|
|
|
|
- equal:
|
|
|
|
path: spec.template.spec.containers[0].resources.limits.memory
|
|
|
|
value: 512Mi
|