Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions .helm/adhoc/certificate.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: siibra-spatial-backend
name: siibra-spatial-backend-canonical
spec:
commonName: siibra-spatial-backend.apps.tc.humanbrainproject.eu
commonName: siibra-spatial-backend.apps.ebrains.eu
isCA: false
dnsNames:
- siibra-spatial-backend.apps.tc.humanbrainproject.eu
- siibra-spatial-backend.apps.ebrains.eu
issuerRef:
kind: ClusterIssuer
name: letsencrypt-production-issuer-1
Expand All @@ -15,6 +16,27 @@ spec:
encoding: PKCS1
size: 2048
renewBefore: 120h
secretName: siibra-spatial-backend-secret
secretName: siibra-spatial-backend-canonical-secret
usages:
- server auth
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: siibra-spatial-backend-dev
spec:
commonName: siibra-spatial-backend-dev.apps.tc.humanbrainproject.eu
isCA: false
dnsNames:
- siibra-spatial-backend-dev.apps.tc.humanbrainproject.eu
issuerRef:
kind: ClusterIssuer
name: letsencrypt-production-issuer-1
privateKey:
algorithm: RSA
encoding: PKCS1
size: 2048
renewBefore: 120h
secretName: siibra-spatial-backend-dev-secret
usages:
- server auth
25 changes: 25 additions & 0 deletions .helm/adhoc/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
data:
config.py: |
CORS_ORIGINS = '*'
PROXY_FIX = {
'x_for': 1,
'x_host': 1,
'x_port': 1,
'x_proto': 1,
}
DEFAULT_TRANSFORM_GRAPH = '/static-data/DISCO_20181004_sigV30_DARTEL_20181004_reg_x4/graph.yaml'

config_v2.py: |
CORS_ORIGINS = '*'
PROXY_FIX = {
'x_for': 1,
'x_host': 1,
'x_port': 1,
'x_proto': 1,
}
ENV: 'development'
DEFAULT_TRANSFORM_GRAPH = '/static-data/DISCO_20181004_sigV30_DARTEL_20250708_reg_x4/graph.yaml'
kind: ConfigMap
metadata:
name: siibra-spatial-backend-adhoc
2 changes: 2 additions & 0 deletions .helm/adhoc/deployment-busybox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ spec:
limits:
cpu: 100m
memory: 128Mi
ephemeral-storage: 32Mi
requests:
cpu: 100m
memory: 128Mi
ephemeral-storage: 32Mi
volumeMounts:
- mountPath: /static-data
name: data-volume
39 changes: 39 additions & 0 deletions .helm/adhoc/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hbp-spatial-backend-ingress
labels:
name: hbp-spatial-backend-ingress
annotations:
nginx.ingress.kubernetes.io/app-root: "/redoc"
spec:
ingressClassName: nginx
rules:
- host: siibra-spatial-backend.apps.ebrains.eu
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: prod-hbp-spatial-backend
port:
number: 8080
- host: siibra-spatial-backend-dev.apps.tc.humanbrainproject.eu
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: dev-hbp-spatial-backend
port:
number: 8080
tls:
- secretName: siibra-spatial-backend-canonical-secret
hosts:
- siibra-spatial-backend.apps.ebrains.eu

- secretName: siibra-spatial-backend-dev-secret
hosts:
- siibra-spatial-backend-dev.apps.tc.humanbrainproject.eu
7 changes: 7 additions & 0 deletions .helm/deployments/dev/create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash

helm install \
--set envObj.HBP_SPATIAL_BACKEND_SETTINGS="/instance/config_v2.py" \
--set replicaCount=1 \
dev \
./.helm/hbp_spatial_backend
2 changes: 1 addition & 1 deletion .helm/hbp_spatial_backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 0.1.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
16 changes: 0 additions & 16 deletions .helm/hbp_spatial_backend/templates/configmap.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions .helm/hbp_spatial_backend/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ spec:
httpGet:
path: /health
port: http
env:
{{- range $key, $val := .Values.envObj }}
- name: {{ $key }}
value: {{ $val }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
Expand Down
15 changes: 10 additions & 5 deletions .helm/hbp_spatial_backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ service:
port: 8080

ingress:
enabled: true
enabled: false
className: "nginx"
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: siibra-spatial-backend.apps.tc.humanbrainproject.eu
- host: siibra-spatial-backend.apps.ebrains.eu
paths:
- path: /
pathType: ImplementationSpecific
tls:
- secretName: siibra-spatial-backend-secret
- secretName: siibra-spatial-backend-canonical-secret
hosts:
- siibra-spatial-backend.apps.tc.humanbrainproject.eu
- siibra-spatial-backend.apps.ebrains.eu

resources:
# We usually recommend not to specify default resources and to leave this as a conscious
Expand All @@ -67,9 +67,11 @@ resources:
limits:
cpu: 300m
memory: 1024Mi
ephemeral-storage: 64Mi
requests:
cpu: 150m
memory: 256Mi
ephemeral-storage: 64Mi

autoscaling:
enabled: false
Expand All @@ -86,7 +88,7 @@ volumes:
- name: config-vol
configMap:
defaultMode: 420
name: siibra-spatial-backend
name: siibra-spatial-backend-adhoc

# Additional volumeMounts on the output Deployment definition.
volumeMounts:
Expand All @@ -100,3 +102,6 @@ nodeSelector: {}
tolerations: []

affinity: {}

envObj:
HBP_SPATIAL_BACKEND_SETTINGS: /instance/config.py
3 changes: 1 addition & 2 deletions hbp_spatial_backend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ def create_app(test_config=None):
exclude_useragent_re = re.compile(r'kube-probe')
access_logger.addFilter(
lambda record: not (
record.args['h'].startswith('10.')
and record.args['m'] == 'GET'
record.args['m'] == 'GET'
and record.args['U'] == '/health'
and exclude_useragent_re.search(record.args['a'])
)
Expand Down
Loading