Skip to content
Open
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
57 changes: 57 additions & 0 deletions valkey/tests/service_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,55 @@ suite: service configuration
templates:
- templates/service.yaml
tests:
- it: should have correct default service type
template: templates/service.yaml
asserts:
- isKind:
of: Service
- equal:
path: spec.type
value: ClusterIP
- it: should be able to set custom clusterIP
set:
service.clusterIP: "10.0.0.1"
template: templates/service.yaml
asserts:
- isKind:
of: Service
- equal:
path: spec.clusterIP
value: "10.0.0.1"
- it: should have correct default ports
template: templates/service.yaml
asserts:
- contains:
path: spec.ports
content:
port: 6379
targetPort: tcp
protocol: TCP
name: tcp
- it: should be able to set custom nodePort
set:
service.type: "NodePort"
service.nodePort: 30080
template: templates/service.yaml
asserts:
- isKind:
of: Service
- equal:
path: spec.ports[0].nodePort
value: 30080
- it: should be able to set custom appProtocol
set:
service.appProtocol: "my-protocol"
template: templates/service.yaml
asserts:
- isKind:
of: Service
- equal:
path: spec.ports[0].appProtocol
value: "my-protocol"
- it: should be able to set custom loadBalancerClass
set:
service.loadBalancerClass: "custom-lb-class"
Expand All @@ -19,3 +68,11 @@ tests:
of: Service
- notExists:
path: spec.loadBalancerClass
- it: should have correct selector labels
template: templates/service.yaml
asserts:
- isSubset:
path: spec.selector
content:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: valkey