helm-charts/charts/other/app-template/tests/service/servicemonitor_test.yaml
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 4d09009bf8
feat(common)!: Release version 0.2.0
- 🛑 BREAKING - Removed support for the openvpn and wireguard VPN types.
- Update container versions
- Added support for adding serviceMonitors to services.
- ConfigMap checksum logic now only looks at ConfigMap data
- Explicitly convert defaultMode to decimal notation in code-server addon.
2022-09-14 10:18:51 +02:00

109 lines
2.8 KiB
YAML

suite: service values
templates:
- common.yaml
tests:
- it: a serviceMonitor is not created by default
asserts:
- hasDocuments:
count: 2
- documentIndex: &ServiceDocument 0
isKind:
of: Deployment
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- it: a serviceMonitor is not created when disabled
set:
service:
main:
monitor:
enabled: false
asserts:
- hasDocuments:
count: 2
- documentIndex: &ServiceDocument 0
isKind:
of: Deployment
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- it: a serviceMonitor is created
set:
service:
main:
monitor:
enabled: true
endpoints:
- port: http
scheme: http
path: /metrics
interval: 1m
scrapeTimeout: 10s
asserts:
- hasDocuments:
count: 3
- documentIndex: &ServiceMonitorDocument 2
isKind:
of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument
equal:
path: metadata.name
value: RELEASE-NAME
- documentIndex: *ServiceMonitorDocument
equal:
path: spec.selector.matchLabels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME
- documentIndex: *ServiceMonitorDocument
equal:
path: spec.endpoints
value:
- port: http
scheme: http
path: /metrics
interval: 1m
scrapeTimeout: 10s
- it: a serviceMonitor is created with nameOverride
set:
service:
main:
nameOverride: test
monitor:
enabled: true
endpoints:
- port: http
scheme: http
path: /metrics
interval: 1m
scrapeTimeout: 10s
asserts:
- hasDocuments:
count: 3
- documentIndex: &ServiceMonitorDocument 2
isKind:
of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument
equal:
path: metadata.name
value: RELEASE-NAME-test
- documentIndex: *ServiceMonitorDocument
equal:
path: spec.selector.matchLabels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME-test
- documentIndex: *ServiceMonitorDocument
equal:
path: spec.endpoints
value:
- port: http
scheme: http
path: /metrics
interval: 1m
scrapeTimeout: 10s