Skip to content

Commit

Permalink
add room service config and deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpy-Squirrel committed Oct 16, 2024
1 parent 6c94844 commit b551066
Show file tree
Hide file tree
Showing 10 changed files with 431 additions and 13 deletions.
2 changes: 1 addition & 1 deletion charts/eurofurence-registration-system/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: eurofurence-registration-system
version: 0.0.28
version: 0.0.29
description: A helm chart that can deploy the Eurofurence Registration System.
type: application
home: https://github.com/eurofurence/reg-helm-chart
69 changes: 69 additions & 0 deletions charts/eurofurence-registration-system/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,75 @@ data:
severity: {{ .Values.system.logging.severity }}
style: {{ .Values.system.logging.style }}
room-service-config: |
# configuration file for room-service
service:
{{- if .Values.system.components.attendee_service.enable }}
attendee_service_url: '{{ .Values.system.components.attendee_service.local_base_url }}'
{{- end }}
{{- if .Values.system.components.auth_service.enable }}
auth_service_url: '{{ .Values.system.components.auth_service.local_base_url }}'
{{- end }}
{{- if .Values.system.components.mail_service.enable }}
mail_service_url: '{{ .Values.system.components.mail_service.local_base_url }}'
{{- end }}
join_link_base_url: '{{ .Values.system.components.room_service.join_link_base_url }}'
max_group_size: {{ .Values.system.components.room_service.max_group_size }}
{{- with .Values.system.components.room_service.group_flags }}
group_flags: {{- . | toYaml | nindent 8 }}
{{- end }}
{{- with .Values.system.components.room_service.room_flags }}
room_flags: {{- . | toYaml | nindent 8 }}
{{- end }}
server:
port: 8080
read_timeout_seconds: 30
write_timeout_seconds: 30
idle_timeout_seconds: 120
database:
use: '{{ .Values.system.database.use }}'
{{- if eq .Values.system.database.use "mysql" }}
username: '{{ .Values.system.database.username }}'
# password: '$REG_SECRET_DB_PASSWORD'
database: '{{ .Values.system.database.database }}'
{{- with .Values.system.database.parameters }}
parameters:
{{- range . }}
- '{{ . }}'
{{- end }}
{{- end }}
{{- end }}
security:
fixed_token: {}
# api: '$REG_SECRET_API_TOKEN'
oidc:
id_token_cookie_name: '{{ .Values.system.components.auth_service.id_token_cookie_name }}'
access_token_cookie_name: '{{ .Values.system.components.auth_service.access_token_cookie_name }}'
{{- with .Values.system.components.auth_service.token_public_keys_PEM }}
token_public_keys_PEM: {{- . | toYaml | nindent 8 }}
{{- end }}
admin_group: '{{ .Values.system.components.auth_service.admin_group_id }}'
{{- if .Values.system.components.auth_service.enable }}
auth_service: '{{ .Values.system.components.auth_service.local_base_url }}'
{{- end }}
{{- with .Values.system.components.auth_service.allowed_audience_in_tokens }}
audience: '{{ . }}'
{{- end }}
{{- with .Values.system.components.auth_service.allowed_issuer_in_tokens }}
issuer: '{{ . }}'
{{- end }}
cors:
disable: {{ .Values.development.cors.disable }}
{{- with .Values.development.cors.allow_origin }}
allow_origin: '{{ . }}'
{{- end }}
logging:
severity: {{ .Values.system.logging.severity }}
style: {{ .Values.system.logging.style }}
{{- with .Values.system.components.room_service.go_live }}
go_live: {{- . | toYaml | nindent 6 }}
{{- end }}
HTTPD_CONF_PATH_PREFIX_NO_SLASHES: '{{ .Values.system.public_base_context }}'
HTTPD_CONF_SERVER_NAME: '{{ .Values.ingress.host }}'
{{- if .Values.system.components.frontend.enable }}
Expand Down
10 changes: 10 additions & 0 deletions charts/eurofurence-registration-system/templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@
{{- template "helpers.deployment" $paySrvInput }}
---
{{- end }}
{{- if .Values.system.components.room_service.enable }}
{{ $roomSrvInput := dict "name" "room-service"
"all" .Values
"component" .Values.system.components.room_service
"secrets" (list "REG_SECRET_DB_PASSWORD" "REG_SECRET_API_TOKEN")
"command" "/main"
"args" (list "--config=/config/config.yaml" "--migrate-database") -}}
{{- template "helpers.deployment" $roomSrvInput }}
---
{{- end }}
{{- if .Values.system.components.regsys_classic.enable }}
{{ $classicInput := dict "name" "regsys-classic"
"all" .Values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
{{- template "helpers.service" $classicInput }}
---
{{- end }}
{{- if .Values.system.components.room_service.enable }}
{{ $roomSrvInput := dict "name" "room-service"
"all" .Values
"component" .Values.system.components.room_service -}}
{{- template "helpers.service" $roomSrvInput }}
---
{{- end }}
{{- if .Values.system.components.onsite.enable }}
{{ $onsiteInput := dict "name" "onsite"
"all" .Values
Expand Down
68 changes: 68 additions & 0 deletions charts/eurofurence-registration-system/tests/configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ tests:
iban: 'UK00100020003000400050'
bic: 'AABBCCDDUK'
subject_prefix: 'AWECON'
room_service:
enable: true
join_link_base_url: 'http://localhost:10000'
go_live:
public:
start_iso_datetime: 1995-06-30T11:11:11+02:00
booking_code: Kaiser-Wilhelm-Koog
staff:
start_iso_datetime: 1995-06-29T11:11:11+02:00
booking_code: Dithmarschen
database:
use: mysql
choices:
Expand Down Expand Up @@ -517,6 +527,64 @@ tests:
logging:
severity: INFO
style: ecs
- equal:
path: data.room-service-config
value: |
# configuration file for room-service
service:
attendee_service_url: 'http://attendee-service:8080'
auth_service_url: 'http://auth-service:8080'
mail_service_url: 'http://mail-service:8080'
join_link_base_url: 'http://localhost:10000'
max_group_size: 6
group_flags:
- public
room_flags:
- handicapped
- final
server:
port: 8080
read_timeout_seconds: 30
write_timeout_seconds: 30
idle_timeout_seconds: 120
database:
use: 'mysql'
username: 'demouser'
# password: '$REG_SECRET_DB_PASSWORD'
database: 'tcp(localhost:3306)/dbname'
parameters:
- 'charset=utf8mb4'
- 'collation=utf8mb4_general_ci'
- 'parseTime=True'
- 'timeout=30s'
security:
fixed_token: {}
# api: '$REG_SECRET_API_TOKEN'
oidc:
id_token_cookie_name: 'JWT'
access_token_cookie_name: 'AUTH'
token_public_keys_PEM:
- |
-----BEGIN PUBLIC KEY-----
ABC
-----END PUBLIC KEY-----
admin_group: 'D1DQADM'
auth_service: 'http://auth-service:8080'
audience: 'aud-1234'
issuer: 'https://identity.example.com'
cors:
disable: false
logging:
severity: INFO
style: ecs
go_live:
public:
booking_code: Kaiser-Wilhelm-Koog
start_iso_datetime: "1995-06-30T11:11:11+02:00"
staff:
booking_code: Dithmarschen
start_iso_datetime: "1995-06-29T11:11:11+02:00"
- equal:
path: data.HTTPD_CONF_PATH_PREFIX_NO_SLASHES
value: 'hello/you'
Expand Down
91 changes: 84 additions & 7 deletions charts/eurofurence-registration-system/tests/deployments_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ tests:
memory: 4444Mi
requests:
memory: 1111Mi
room_service:
enable: true
frontend:
enable: true
onsite:
Expand All @@ -126,7 +128,7 @@ tests:
- isKind:
of: Deployment
- hasDocuments:
count: 8
count: 9
- equal:
path: metadata
value:
Expand Down Expand Up @@ -521,14 +523,89 @@ tests:
path: config.yaml
mode: 0444
documentIndex: 4
- equal:
path: metadata
value:
name: room-service
labels:
app: regsys
service: room-service
documentIndex: 5
- equal:
path: spec
value:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: regsys
service: room-service
template:
metadata:
labels:
app: regsys
service: room-service
spec:
containers:
- name: application
image: 'ghcr.io/eurofurence/reg-room-service:latest'
ports:
- containerPort: 8080
name: primary
readinessProbe:
httpGet:
port: primary
path: /
initialDelaySeconds: 2
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
resources:
limits:
memory: 512Mi
requests:
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
command: [/main]
args:
- --config=/config/config.yaml
- --migrate-database
env:
- name: REG_SECRET_DB_PASSWORD
valueFrom:
secretKeyRef:
name: regsys-secret
key: REG_SECRET_DB_PASSWORD
- name: REG_SECRET_API_TOKEN
valueFrom:
secretKeyRef:
name: regsys-secret
key: REG_SECRET_API_TOKEN
volumeMounts:
- name: config-file
mountPath: /config
readOnly: true
volumes:
- name: config-file
configMap:
name: regsys-cm
items:
- key: room-service-config
path: config.yaml
mode: 0444
documentIndex: 5
- equal:
path: metadata
value:
name: regsys-classic
labels:
app: regsys
service: regsys-classic
documentIndex: 5
documentIndex: 6
- equal:
path: spec
value:
Expand Down Expand Up @@ -621,15 +698,15 @@ tests:
- key: regsys-classic-config
path: config.yaml
mode: 0444
documentIndex: 5
documentIndex: 6
- equal:
path: metadata
value:
name: onsite
labels:
app: regsys
service: onsite
documentIndex: 6
documentIndex: 7
- equal:
path: spec
value:
Expand Down Expand Up @@ -679,15 +756,15 @@ tests:
secretKeyRef:
name: regsys-secret
key: REG_SECRET_NOSECOUNTER_TOKEN
documentIndex: 6
documentIndex: 7
- equal:
path: metadata
value:
name: frontend
labels:
app: regsys
service: frontend
documentIndex: 7
documentIndex: 8
- equal:
path: spec
value:
Expand Down Expand Up @@ -749,7 +826,7 @@ tests:
configMapKeyRef:
name: regsys-cm
key: HTTPD_CONF_STATIC_DIR
documentIndex: 7
documentIndex: 8

- it: should not set namespace if unset
asserts:
Expand Down
Loading

0 comments on commit b551066

Please sign in to comment.