diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index ea0a1da5..b52077b3 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -38,3 +38,7 @@ Create chart name and version as used by the chart label. {{- define "trino.worker" -}} {{ template "trino.fullname" . }}-worker {{- end -}} + +{{- define "trino.catalog" -}} +{{ template "trino.fullname" . }}-catalog +{{- end -}} diff --git a/templates/configmap-catalog.yaml b/templates/configmap-catalog.yaml new file mode 100644 index 00000000..9df08995 --- /dev/null +++ b/templates/configmap-catalog.yaml @@ -0,0 +1,16 @@ +{{- if .Values.server.catalogs.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "trino.catalog" . }} + labels: + app: {{ template "trino.name" . }} + chart: {{ template "trino.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + component: catalog +data: +{{- range $key, $val := .Values.server.catalogs.configs }} + {{ $key }}: | {{ $val | nindent 4 }} +{{- end }} +{{- end }} diff --git a/templates/configmap-coordinator.yaml b/templates/configmap-coordinator.yaml index 92c05bca..eb8074ac 100644 --- a/templates/configmap-coordinator.yaml +++ b/templates/configmap-coordinator.yaml @@ -37,6 +37,9 @@ data: query.max-memory-per-node={{ .Values.server.config.query.maxMemoryPerNode }} discovery-server.enabled=true discovery.uri=http://localhost:{{ .Values.service.port }} +{{- if .Values.oauth.enabled }} +{{- .Values.oauth.config | nindent 4 }} +{{- end }} log.properties: | io.trinosql={{ .Values.server.log.trino.level }} diff --git a/templates/deployment-coordinator.yaml b/templates/deployment-coordinator.yaml index f35f0e47..530a903d 100644 --- a/templates/deployment-coordinator.yaml +++ b/templates/deployment-coordinator.yaml @@ -30,6 +30,9 @@ spec: - name: config-volume configMap: name: {{ template "trino.coordinator" . }} + - name: catalog-volume + configMap: + name: {{ template "trino.catalog" . }} containers: - name: {{ .Chart.Name }}-coordinator image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" @@ -37,6 +40,8 @@ spec: volumeMounts: - mountPath: {{ .Values.server.config.path }} name: config-volume + - mountPath: {{ .Values.server.config.path }}/catalog + name: catalog-volume ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/templates/deployment-worker.yaml b/templates/deployment-worker.yaml index 1ea38e9c..70d96e4c 100644 --- a/templates/deployment-worker.yaml +++ b/templates/deployment-worker.yaml @@ -27,6 +27,9 @@ spec: - name: config-volume configMap: name: {{ template "trino.worker" . }} + - name: catalog-volume + configMap: + name: {{ template "trino.catalog" . }} containers: - name: {{ .Chart.Name }}-worker image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" @@ -34,6 +37,8 @@ spec: volumeMounts: - mountPath: {{ .Values.server.config.path }} name: config-volume + - mountPath: {{ .Values.server.config.path }}/catalog + name: catalog-volume ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/templates/ingress.yaml b/templates/ingress.yaml new file mode 100644 index 00000000..bcd08aff --- /dev/null +++ b/templates/ingress.yaml @@ -0,0 +1,32 @@ +{{- if .Values.ingress.enabled }} +{{- $serviceName := printf "%s" ( include "trino.name" .) }} +{{- $servicePort := .Values.service.port }} +{{- $ingressPath := .Values.ingress.path }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ template "trino.fullname" . }} + labels: + app: {{ template "trino.name" . }} + chart: {{ template "trino.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $serviceName }} + servicePort: {{ $servicePort }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: {{ toYaml .Values.ingress.tls | nindent 4 }} + {{- end }} +{{- end }} diff --git a/values.yaml b/values.yaml index 7895f990..e45bb039 100644 --- a/values.yaml +++ b/values.yaml @@ -31,14 +31,57 @@ server: g1: heapRegionSize: "32M" -securityContext: - runAsUser: 1000 - runAsGroup: 1000 + catalogs: + enabled: false + configs: + datalake.properties: | + connector.name=hive-hadoop2 + hive.metastore=file + hive.s3-file-system-type=TRINO + hive.metastore.catalog.dir=s3:/// + hive.s3.aws-access-key= + hive.s3.aws-secret-key=secretKey + hive.s3.endpoint= + hive.s3.path-style-access=true + hive.s3select-pushdown.enabled=true + hive.s3.ssl.enabled=false + +oauth: + enabled: false + config: | + http-server.authentication.type=oauth2 + http-server.authentication.oauth2.auth-url= + http-server.authentication.oauth2.token-url= + http-server.authentication.oauth2.jwks-url= + http-server.authentication.oauth2.client-id= + http-server.authentication.oauth2.client-secret= + http-server.authentication.oauth2.scopes= + web-ui.authentication.type=oauth2 + +ingress: + ## Set to true to enable ingress record generation + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + labels: {} + path: / + pathType: Prefix + hosts: + - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local service: type: ClusterIP port: 8080 +securityContext: + runAsUser: 1000 + runAsGroup: 1000 + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little