Skip to content

Commit

Permalink
Add access control config to worker nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
florianMalbranque committed Aug 20, 2024
1 parent 7450120 commit 9d22955
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
27 changes: 27 additions & 0 deletions charts/trino/templates/configmap-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ data:
{{- .Values.server.workerExtraConfig | nindent 4 }}
{{- end }}
{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }}
access-control.properties: |
access-control.name=file
{{- if .Values.accessControl.refreshPeriod }}
security.refresh-period={{ .Values.accessControl.refreshPeriod }}
{{- end }}
security.config-file={{ .Values.server.config.path }}/access-control/{{ .Values.accessControl.configFile | default "rules.json" }}
{{- end }}{{- end }}

exchange-manager.properties: |
exchange-manager.name={{ .Values.server.exchangeManager.name }}
{{ if eq .Values.server.exchangeManager.name "filesystem" }}
Expand All @@ -87,6 +96,24 @@ data:
{{ $fileName }}: |
{{- $fileContent | nindent 4 }}
{{- end }}

---

{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "trino.fullname" . }}-access-control-volume-worker
namespace: {{ .Release.Namespace }}
labels:
{{- include "trino.labels" . | nindent 4 }}
app.kubernetes.io/component: worker
data:
{{- range $key, $val := .Values.accessControl.rules }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}{{- end }}

---
apiVersion: v1
kind: ConfigMap
Expand Down
9 changes: 9 additions & 0 deletions charts/trino/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ spec:
- name: schemas-volume
configMap:
name: {{ template "trino.fullname" . }}-schemas-volume-worker
{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }}
- name: access-control-volume
configMap:
name: {{ template "trino.fullname" . }}-access-control-volume-worker
{{- end }}{{- end }}
{{- range .Values.configMounts }}
- name: {{ .name }}
configMap:
Expand Down Expand Up @@ -98,6 +103,10 @@ spec:
name: catalog-volume
- mountPath: {{ .Values.kafka.mountPath }}
name: schemas-volume
{{- if .Values.accessControl }}{{- if eq .Values.accessControl.type "configmap" }}
- mountPath: {{ .Values.server.config.path }}/access-control
name: access-control-volume
{{- end }}{{- end }}
{{- range .Values.configMounts }}
- name: {{ .name }}
mountPath: {{ .path }}
Expand Down

0 comments on commit 9d22955

Please sign in to comment.