Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/iap/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.6.0
version: 1.7.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 1 addition & 1 deletion charts/iap/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ spec:
number: {{ $.Values.service.port }}
path: {{ $.Values.ingress.directAccess.path | default "/" }}
pathType: {{ $.Values.ingress.pathType | default "Prefix" }}
{{- if and $.Values.processExporter $.Values.processExporter.enabled }}
{{- if and $.Values.processExporter $.Values.processExporter.enabled $.Values.processExporter.ingressEnabled }}
- backend:
service:
name: {{ $.Values.service.name }}-headless-{{ $i }}
Expand Down
107 changes: 106 additions & 1 deletion charts/iap/tests/ingress_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ tests:
path: spec.rules[1].host
value: iap-prod-1.example.com

- it: should work with process exporter and hostOverride
- it: should work with process exporter enabled and ingressEnabled true
set:
ingress:
enabled: true
Expand All @@ -1137,6 +1137,7 @@ tests:
hostOverride: "metrics"
processExporter:
enabled: true
ingressEnabled: true
service:
port: 443
replicaCount: 1
Expand All @@ -1155,6 +1156,110 @@ tests:
path: spec.rules[0].http.paths[1].path
value: /metrics

- it: should not include metrics path when processExporter enabled but ingressEnabled false
set:
ingress:
enabled: true
loadBalancer:
enabled: false
directAccess:
enabled: true
baseDomain: example.com
processExporter:
enabled: true
ingressEnabled: false
service:
port: 443
replicaCount: 1
asserts:
- lengthEqual:
path: spec.rules
count: 1
# Should only have main path, no metrics path
- lengthEqual:
path: spec.rules[0].http.paths
count: 1
- equal:
path: spec.rules[0].http.paths[0].path
value: /

- it: should not include metrics path when processExporter disabled
set:
ingress:
enabled: true
loadBalancer:
enabled: false
directAccess:
enabled: true
baseDomain: example.com
processExporter:
enabled: false
ingressEnabled: true
service:
port: 443
replicaCount: 1
asserts:
- lengthEqual:
path: spec.rules
count: 1
# Should only have main path, no metrics path
- lengthEqual:
path: spec.rules[0].http.paths
count: 1
- equal:
path: spec.rules[0].http.paths[0].path
value: /

- it: should include metrics path for all replicas when processExporter enabled and ingressEnabled true
set:
ingress:
enabled: true
loadBalancer:
enabled: false
directAccess:
enabled: true
baseDomain: example.com
processExporter:
enabled: true
ingressEnabled: true
service:
port: 443
replicaCount: 3
asserts:
- lengthEqual:
path: spec.rules
count: 3
# Each rule should have both main path and metrics path
- lengthEqual:
path: spec.rules[0].http.paths
count: 2
- lengthEqual:
path: spec.rules[1].http.paths
count: 2
- lengthEqual:
path: spec.rules[2].http.paths
count: 2
# Verify metrics paths
- equal:
path: spec.rules[0].http.paths[1].path
value: /metrics
- equal:
path: spec.rules[1].http.paths[1].path
value: /metrics
- equal:
path: spec.rules[2].http.paths[1].path
value: /metrics
# Verify metrics backend service port names
- equal:
path: spec.rules[0].http.paths[1].backend.service.port.name
value: process-metrics
- equal:
path: spec.rules[1].http.paths[1].backend.service.port.name
value: process-metrics
- equal:
path: spec.rules[2].http.paths[1].backend.service.port.name
value: process-metrics

- it: should preserve service references with hostOverride
set:
ingress:
Expand Down
2 changes: 2 additions & 0 deletions charts/iap/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ affinity: {}
processExporter:
# -- Enable process exporter sidecar container
enabled: false
# -- Enable ingress configuration for process exporter metrics
ingressEnabled: false
image:
# -- Process exporter image repository
repository: ncabatoff/process-exporter
Expand Down