Skip to content

Commit

Permalink
Add upload config to appserver chart
Browse files Browse the repository at this point in the history
  • Loading branch information
pvannierop committed Oct 16, 2024
1 parent 4071650 commit c5ae7a6
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/radar-appserver/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "2.4.3"
description: A Helm chart for the backend application of RADAR-base Appserver
name: radar-appserver
version: 0.5.2
version: 0.6.0
icon: "http://radar-base.org/wp-content/uploads/2022/09/Logo_RADAR-Base-RGB.png"
sources:
- https://github.com/RADAR-base/radar-helm-charts/tree/main/charts/radar-appserver
Expand Down
11 changes: 10 additions & 1 deletion charts/radar-appserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# radar-appserver
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/radar-appserver)](https://artifacthub.io/packages/helm/radar-base/radar-appserver)

![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.4.3](https://img.shields.io/badge/AppVersion-2.4.3-informational?style=flat-square)
![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.4.3](https://img.shields.io/badge/AppVersion-2.4.3-informational?style=flat-square)

A Helm chart for the backend application of RADAR-base Appserver

Expand Down Expand Up @@ -93,3 +93,12 @@ A Helm chart for the backend application of RADAR-base Appserver
| smtp.from | string | `"noreply@example.com"` | Email address which should be used to send activation emails |
| smtp.starttls | bool | `false` | set to true,if TTLS should be enabled |
| smtp.auth | bool | `true` | set to true, if the account should be authenticated before sending emails |
| upload.enabled | bool | `false` | if set to true, file upload endpoint will be enabled |
| upload.max_file_size | string | `"20MB"` | Maximum file size for upload |
| upload.storage.type | string | `"s3"` | Type of storage to use for file upload (s3) |
| upload.storage.url | string | `"http://minio-headless:9000"` | Internal url to storage |
| upload.storage.bucket_name | string | `"radar-output-storage"` | Bucket name of the S3 storage |
| upload.storage.access_key | string | `"secret"` | Access key of the S3 storage |
| upload.storage.secret_key | string | `"secret"` | Secret key of the S3 storage |
| upload.storage.path.prefix | string | `"output"` | Prefix for the path in the storage; will become <bucket>/<prefix>/<project>/<subject>/<topic> |
| upload.storage.path.collection_per_day | bool | `false` | if set to true, a new folder will be created for each day |
30 changes: 30 additions & 0 deletions charts/radar-appserver/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,36 @@ spec:
key: smtpPassword
{{- end }}
{{- end }}
{{- if .Values.upload.enabled }}
- name: RADAR_FILE_UPLOAD_ENABLED
value: {{ .Values.upload.enabled | quote }}
- name: SPRING_SERVLET_MULTIPART_MAXFILESIZE
value: {{ .Values.upload.max_file_size | quote }}
- name: SPRING_SERVLET_MULTIPART_ENABLED
value: "true"
- name: RADAR_STORAGE_TYPE
value: {{ .Values.upload.storage.type | quote }}
{{- if eq .Values.upload.storage.type "s3" }}
- name: RADAR_STORAGE_S3_URL
value: {{ .Values.upload.storage.url | quote }}
- name: RADAR_STORAGE_S3_BUCKETNAME
value: {{ .Values.upload.storage.bucket_name | quote }}
- name: RADAR_STORAGE_S3_PATH_PREFIX
value: {{ .Values.upload.storage.path.prefix | quote }}
- name: RADAR_STORAGE_S3_PATH_COLLECTPERDAY
value: {{ .Values.upload.storage.path.collection_per_day | quote }}
- name: RADAR_STORAGE_S3_ACCESSKEY
valueFrom:
secretKeyRef:
name: {{ template "radar-appserver.secretName" . }}
key: s3AccessKey
- name: RADAR_STORAGE_S3_SECRETKEY
valueFrom:
secretKeyRef:
name: {{ template "radar-appserver.secretName" . }}
key: s3SecretKey
{{- end }}
{{- end }}
{{- with .Values.extraEnvVars }}
{{- toYaml . | nindent 10 }}
{{- end }}
Expand Down
8 changes: 6 additions & 2 deletions charts/radar-appserver/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ data:
{{- if and .Values.smtp.enabled .Values.smtp.auth }}
smtpUsername: {{ .Values.smtp.username | b64enc | quote }}
smtpPassword: {{ .Values.smtp.password | b64enc | quote }}
{{ end }}
{{- end -}}
{{- end }}
{{- if and .Values.upload.enabled (eq .Values.upload.storage.type "s3") }}
s3AccessKey: {{ .Values.upload.storage.access_key | b64enc | quote }}
s3SecretKey: {{ .Values.upload.storage.secret_key | b64enc | quote }}
{{- end }}
{{- end }}
23 changes: 23 additions & 0 deletions charts/radar-appserver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,26 @@ smtp:
starttls: false
# -- set to true, if the account should be authenticated before sending emails
auth: true

upload:
# -- if set to true, file upload endpoint will be enabled
enabled: false
# -- Maximum file size for upload
max_file_size: "20MB"
# Settings for file storage
storage:
# -- Type of storage to use for file upload (s3)
type: s3
# -- Internal url to storage
url: http://minio-headless:9000
# -- Bucket name of the S3 storage
bucket_name: radar-output-storage
# -- Access key of the S3 storage
access_key: secret
# -- Secret key of the S3 storage
secret_key: secret
path:
# -- Prefix for the path in the storage; will become <bucket>/<prefix>/<project>/<subject>/<topic>
prefix: output
# -- if set to true, a new folder will be created for each day
collection_per_day: false

0 comments on commit c5ae7a6

Please sign in to comment.