Skip to content

Commit

Permalink
refact json import and volume mount
Browse files Browse the repository at this point in the history
  • Loading branch information
fl0-m committed Jan 10, 2024
1 parent 14954db commit c81ff71
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
15 changes: 7 additions & 8 deletions charts/trino/templates/configmap-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ data:
security.config-file={{ .Values.server.config.path }}/access-control/{{ .Values.accessControl.configFile | default "rules.json" }}
{{- end }}{{- end }}

{{- if .Values.resourceGroups }}{{- if eq .Values.resourceGroups.type "configmap" }}
{{- if .Values.resourceGroups }}
resource-groups.properties: |
resource-groups.configuration-manager=file
resource-groups.config-file={{ .Values.server.config.path }}/resource-groups/{{ .Values.resourceGroups.configFile | default "resource-groups.json" }}
{{- end }}{{- end }}
resource-groups.config-file={{ .Values.server.config.path }}/resource-groups/resource-groups.json
{{- end }}

exchange-manager.properties: |
exchange-manager.name={{ .Values.server.exchangeManager.name }}
Expand Down Expand Up @@ -143,7 +143,7 @@ data:

---

{{- if .Values.resourceGroups }}{{- if eq .Values.resourceGroups.type "configmap" }}
{{- if .Values.resourceGroups }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -152,10 +152,9 @@ metadata:
{{- include "trino.labels" . | nindent 4 }}
app.kubernetes.io/component: coordinator
data:
{{- range $key, $val := .Values.resourceGroups.resourceGroupsFile }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}{{- end }}
resource-groups.json: |-
{{- .Values.resourceGroups.resourceGroupsConfig | nindent 4 }}
{{- end }}

---

Expand Down
8 changes: 4 additions & 4 deletions charts/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ spec:
configMap:
name: trino-access-control-volume-coordinator
{{- end }}{{- end }}
{{- if .Values.resourceGroups }}{{- if eq .Values.resourceGroups.type "configmap" }}
{{- if .Values.resourceGroups }}
- name: resource-groups-volume
configMap:
name: trino-resource-groups-volume-coordinator
{{- end }}{{- end }}
{{- end }}
{{- if eq .Values.server.config.authenticationType "PASSWORD" }}
- name: password-volume
secret:
Expand Down Expand Up @@ -114,10 +114,10 @@ spec:
- mountPath: {{ .Values.server.config.path }}/access-control
name: access-control-volume
{{- end }}{{- end }}
{{- if .Values.resourceGroups }}{{- if eq .Values.resourceGroups.type "configmap" }}
{{- if .Values.resourceGroups }}
- mountPath: {{ .Values.server.config.path }}/resource-groups
name: resource-groups-volume
{{- end }}{{- end }}
{{- end }}
{{- range .Values.secretMounts }}
- name: {{ .name }}
mountPath: {{ .path }}
Expand Down
8 changes: 3 additions & 5 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@ accessControl: {}
# }

resourceGroups: {}
# type: configmap
# # Rules file is mounted to /etc/trino/resource-groups
# configFile: "resource-groups.json"
# resourceGroupsFile:
# resource-groups.json: |-
# Rules file is mounted to /etc/trino/resource-groups/resource-groups.json
# Split cluster resources evenly accross users when under load while allowing for bursting when some don't use cluster

Check failure on line 101 in charts/trino/values.yaml

View workflow job for this annotation

GitHub Actions / lint

[trailing-spaces] trailing spaces
#resourceGroupsConfig: |-

Check failure on line 102 in charts/trino/values.yaml

View workflow job for this annotation

GitHub Actions / lint

[comments] missing starting space in comment
# {
# "rootGroups": [
# {
Expand Down

0 comments on commit c81ff71

Please sign in to comment.