-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass through service spec values #271
base: main
Are you sure you want to change the base?
Conversation
08aa1cd
to
aa770ff
Compare
10895a4
to
3ef3a48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like adding these new test suites! Just a bunch of nitpicks remaining.
2019727
to
f747b79
Compare
tests/gateway/test-nodeport.yaml
Outdated
http-server.https.keystore.path: /etc/scratch/tls.pem | ||
|
||
service: | ||
spec: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not reading any properties from this spec
key, so if this test passes without these settings, it means it's not a good test. Should it be using different port numbers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I outsmarted myself with this logic in charts/gateway/templates/test-nodeport.yaml
:
- |
{{- if eq .Values.service.type "NodePort" }}
[ "$(wget --no-check-certificate https://${NODE_IP}:{{ index .Values.service.ports 0 "nodePort"}}/entity/GATEWAY_BACKEND -O -)" = "[]" ] &&
[ "$(wget http://${NODE_IP}:{{ index .Values.service.ports 1 "nodePort"}}/entity/GATEWAY_BACKEND -O -)" = "[]" ]
{{- else }}
echo non NodePort service type
{{- end }}
the invalid key effectively disabled the test. I think this can be fixed by using serverConfig
as the independent variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The values files using service.spec
failed after the correction to connection-test.yaml
to check if serverConfig.http-server.http[s].enabled = =true
, so I think the test is now good
f747b79
to
2020597
Compare
Support healthchecks for gateway configurations without http enabled. Add tests for https and NodePort service with both https and http exposed. Co-authored-by: Jan Waś <[email protected]>
2020597
to
36b728f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, just two nitpicks about testing.
- | | ||
[ 1 = 1 ] | ||
{{- if index .Values "config" "serverConfig" "http-server.https.enabled" -}} | ||
&& [ "$(wget --no-check-certificate https://{{ include "trino-gateway.fullname" . }}:{{ index .Values "config" "serverConfig" "http-server.https.port"}}/entity/GATEWAY_BACKEND -O -)" = "[]" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The service name should be hardcoded here - it's ok, because it's a test. If we change anything in the chart and this test would start to fail, this verifies the test. Same for ports. What would happen if you'd set a service port different from http-server.https.port
?
ports: | ||
- protocol: TCP | ||
name: request | ||
nodePort: 30443 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that we don't verify if this node port is reachable. We could add an extra wget in the test-connection
in a conditional block that'd only run if the service was of type NodePort
.
Kubernetes supports several types of services. This change passes through arbitrary keys under
service.spec
, which allows specifying type-specific keys such asnodePort
. Theport
andtargetPort
are autoconfigured to match the port specified in the gatewayhttp-server
configuration, and the selector is autoconfigured to match the deployment.Suggested release note:
service
node no longer usestype
andport
as a subfields. Define theservice.spec
instead.