-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support gateway configurations without http enabled. Add tests for ht…
…tps and NodePort service with both https and http exposed.
- Loading branch information
1 parent
6d86367
commit f0a4380
Showing
10 changed files
with
209 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.idea/* | ||
tests/trino/cert.key | ||
tests/trino/cert.crt | ||
*/*/cert.key | ||
*/*/cert.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: "{{ include "trino-gateway.fullname" . }}-test-connection" | ||
labels: | ||
{{- include "trino-gateway.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: test | ||
test: service | ||
annotations: | ||
"helm.sh/hook": test | ||
spec: | ||
containers: | ||
- name: wget | ||
image: alpine | ||
imagePullPolicy: IfNotPresent | ||
# Get the list of backends, which should return an empty list, "[]". For this test to pass | ||
# the gateway must successfully connect to an initialized backend database | ||
command: | ||
- "sh" | ||
- "-c" | ||
- | | ||
{{- if eq .Values.service.spec.type "NodePort" }} | ||
[ "$(wget --no-check-certificate https://${NODE_IP}:{{ index .Values.service.spec.ports 0 "nodePort"}}/entity/GATEWAY_BACKEND -O -)" = "[]" ] && | ||
[ "$(wget http://${NODE_IP}:{{ index .Values.service.spec.ports 1 "nodePort"}}/entity/GATEWAY_BACKEND -O -)" = "[]" ] | ||
{{- else }} | ||
echo non NodePort service type | ||
{{- end }} | ||
envFrom: | ||
- secretRef: | ||
name: node-ip | ||
restartPolicy: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
replicaCount: 1 | ||
|
||
image: | ||
# -- Repository location of the Trino Gateway image, typically `organization/imagename` | ||
repository: "trinodb/trino-gateway" | ||
pullPolicy: IfNotPresent | ||
|
||
command: | ||
- "/bin/sh" | ||
- "-c" | ||
- | | ||
cat /etc/certificates/tls.crt /etc/certificates/tls.key > /etc/scratch/tls.pem && \ | ||
java -XX:MinRAMPercentage=80.0 -XX:MaxRAMPercentage=80.0 -jar /usr/lib/trino/gateway-ha-jar-with-dependencies.jar /etc/gateway/config.yaml | ||
config: | ||
serverConfig: | ||
node.environment: test | ||
http-server.http.enabled: false | ||
http-server.https.enabled: true | ||
http-server.https.port: 8443 | ||
http-server.https.keystore.path: /etc/scratch/tls.pem | ||
dataStore: | ||
# The connection details for the backend database for Trino Gateway and Trino query history | ||
jdbcUrl: jdbc:postgresql://gateway-backend-db-postgresql.postgres-gateway.svc.cluster.local:5432/gateway | ||
user: gateway | ||
password: pass0000 | ||
driver: org.postgresql.Driver | ||
clusterStatsConfiguration: | ||
monitorType: INFO_API | ||
modules: | ||
- io.trino.gateway.ha.module.HaGatewayProviderModule | ||
- io.trino.gateway.ha.module.ClusterStateListenerModule | ||
- io.trino.gateway.ha.module.ClusterStatsMonitorModule | ||
managedApps: | ||
- io.trino.gateway.ha.clustermonitor.ActiveClusterMonitor | ||
|
||
volumes: | ||
- name: certificates | ||
secret: | ||
secretName: certificates | ||
- name: scratch | ||
emptyDir: | ||
sizeLimit: 10Mi | ||
|
||
volumeMounts: | ||
- name: certificates | ||
mountPath: /etc/certificates | ||
- name: scratch | ||
mountPath: /etc/scratch | ||
|
||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 256Mi | ||
requests: | ||
cpu: 250m | ||
memory: 256Mi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
replicaCount: 1 | ||
|
||
image: | ||
# -- Repository location of the Trino Gateway image, typically `organization/imagename` | ||
repository: "trinodb/trino-gateway" | ||
pullPolicy: IfNotPresent | ||
|
||
command: | ||
- "/bin/sh" | ||
- "-c" | ||
- | | ||
cat /etc/certificates/tls.crt /etc/certificates/tls.key > /etc/scratch/tls.pem && \ | ||
java -XX:MinRAMPercentage=80.0 -XX:MaxRAMPercentage=80.0 -jar /usr/lib/trino/gateway-ha-jar-with-dependencies.jar /etc/gateway/config.yaml | ||
config: | ||
serverConfig: | ||
node.environment: test | ||
http-server.http.enabled: true | ||
http-server.https.enabled: true | ||
http-server.https.port: 8443 | ||
http-server.https.keystore.path: /etc/scratch/tls.pem | ||
dataStore: | ||
# The connection details for the backend database for Trino Gateway and Trino query history | ||
jdbcUrl: jdbc:postgresql://gateway-backend-db-postgresql.postgres-gateway.svc.cluster.local:5432/gateway | ||
user: gateway | ||
password: pass0000 | ||
driver: org.postgresql.Driver | ||
clusterStatsConfiguration: | ||
monitorType: INFO_API | ||
modules: | ||
- io.trino.gateway.ha.module.HaGatewayProviderModule | ||
- io.trino.gateway.ha.module.ClusterStateListenerModule | ||
- io.trino.gateway.ha.module.ClusterStatsMonitorModule | ||
managedApps: | ||
- io.trino.gateway.ha.clustermonitor.ActiveClusterMonitor | ||
|
||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 256Mi | ||
requests: | ||
cpu: 250m | ||
memory: 256Mi | ||
|
||
service: | ||
spec: | ||
type: NodePort | ||
ports: | ||
- protocol: TCP | ||
name: request | ||
nodePort: 30443 | ||
- protocol: TCP | ||
name: gateway-http | ||
nodePort: 30080 | ||
port: 8080 | ||
targetPort: 8080 | ||
|
||
volumes: | ||
- name: certificates | ||
secret: | ||
secretName: certificates | ||
- name: scratch | ||
emptyDir: | ||
sizeLimit: 10Mi | ||
|
||
volumeMounts: | ||
- name: certificates | ||
mountPath: /etc/certificates | ||
- name: scratch | ||
mountPath: /etc/scratch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters