Skip to content

Commit

Permalink
platform-api: add filesize limits parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxpiper committed Sep 20, 2023
1 parent ccf9d7b commit c7497e6
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/platform-api/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
name: ushahidi-platform-api
version: 0.0.1-alpha.19
version: 0.0.1-alpha.20
icon: https://github.ushahidi.org/helm-charts/icon.png
2 changes: 2 additions & 0 deletions charts/platform-api/templates/api-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ spec:
value: {{ .Values.api.params.upload_max_filesize | quote }}
- name: PHP_POST_MAX_SIZE
value: {{ .Values.api.params.upload_max_filesize | quote }}
- name: MEDIA_MAX_UPLOAD
value: {{ .Values.api.params.media_max_upload | quote }}
{{- if .Values.config.shared_secret }}
- name: PLATFORM_SHARED_SECRET
value: {{ .Values.config.shared_secret | quote }}
Expand Down
15 changes: 15 additions & 0 deletions charts/platform-api/tests/multi_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: simple test
templates:
- templates/api-worker.yaml
- templates/memcached.yaml

tests:
- it: api should work
values:
- ./values/simple.yaml
template: templates/api.yaml
asserts:
- equal:
path: metadata.name
value: api
51 changes: 51 additions & 0 deletions charts/platform-api/tests/values/multi-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
minReadySeconds: 60
image:
tag: project-mzima
config:
appenv: production
timzone: UTC
multisite:
enabled: true
domain: ushahidi.io
api_domain: api.ushahidi.io
email: [email protected]
drivers:
cache: memcached
ratelimiter_cache: memcached
mail_from:
address: [email protected]
name: "Platform Deployment Admin"
redis:
host: production-redis.ujenic.0001.euw1.cache.amazonaws.com
port: 6379
mailgun_mail:
domain: mg.ushahidi.com
secret: abcdef
# -> secret_ref
rackspace_filesystem:
region: ORD
container: platform-cloud
username: ushahidi.api
apikey: cdefghi
# -> apikey_secret

api:
replicas: 2
limits:
cpu: "1"
memory: "512Mi"
requests:
cpu: "100m"
memory: "512Mi"
ingress:
host: io-test-api.staging.ush.zone # later: "*.api.ushahidi.io"
annotations:
external-dns.alpha.kubernetes.io/hostname: io-test-1.staging.ush.zone # ensure we control this
worker:
replicas: 0 # this will still run on the old infra for now
mysql:
enabled: false
redis:
enabled: false
memcached:
enabled: true
1 change: 1 addition & 0 deletions charts/platform-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ api:
params:
php_exec_time_limit: 60
upload_max_filesize: 2m
media_max_upload: 2000000
limits:
cpu: "1"
memory: "1Gi"
Expand Down

0 comments on commit c7497e6

Please sign in to comment.