diff --git a/charts/eurofurence-registration-system/Chart.yaml b/charts/eurofurence-registration-system/Chart.yaml index 423b368..88ff2f8 100644 --- a/charts/eurofurence-registration-system/Chart.yaml +++ b/charts/eurofurence-registration-system/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: eurofurence-registration-system -version: 0.0.27 +version: 0.0.28 description: A helm chart that can deploy the Eurofurence Registration System. type: application home: https://github.com/eurofurence/reg-helm-chart diff --git a/charts/eurofurence-registration-system/templates/_helpers.tpl b/charts/eurofurence-registration-system/templates/_helpers.tpl index 5e40c9e..9daba02 100644 --- a/charts/eurofurence-registration-system/templates/_helpers.tpl +++ b/charts/eurofurence-registration-system/templates/_helpers.tpl @@ -12,7 +12,7 @@ metadata: {{- $mergedLabels | toYaml | nindent 4 }} spec: ports: - - port: 8080 + - port: {{ .port | default 8080 }} appProtocol: http name: application targetPort: primary @@ -57,7 +57,7 @@ spec: {{- toYaml . | nindent 14 }} {{- end }} ports: - - containerPort: 8080 + - containerPort: {{ .port | default 8080 }} name: primary readinessProbe: httpGet: diff --git a/charts/eurofurence-registration-system/templates/deployments.yaml b/charts/eurofurence-registration-system/templates/deployments.yaml index dcb888a..92b25ee 100644 --- a/charts/eurofurence-registration-system/templates/deployments.yaml +++ b/charts/eurofurence-registration-system/templates/deployments.yaml @@ -58,6 +58,18 @@ {{- template "helpers.deployment" $classicInput }} --- {{- end }} +{{- if .Values.system.components.onsite.enable }} +{{ $onsiteInput := dict "name" "onsite" + "all" .Values + "component" .Values.system.components.onsite + "secrets" (list "REG_SECRET_NOSECOUNTER_TOKEN") + "command" "nginx" + "args" (list "-g" "daemon off;") + "port" 8000 + "volume" "no" -}} +{{- template "helpers.deployment" $onsiteInput }} +--- +{{- end }} {{ $frontendInput := dict "name" "frontend" "all" .Values "component" .Values.system.components.frontend diff --git a/charts/eurofurence-registration-system/templates/services.yaml b/charts/eurofurence-registration-system/templates/services.yaml index 54f4447..a44e0dc 100644 --- a/charts/eurofurence-registration-system/templates/services.yaml +++ b/charts/eurofurence-registration-system/templates/services.yaml @@ -40,6 +40,14 @@ {{- template "helpers.service" $classicInput }} --- {{- end }} +{{- if .Values.system.components.onsite.enable }} +{{ $onsiteInput := dict "name" "onsite" + "all" .Values + "component" .Values.system.components.onsite + "port" 8000 -}} +{{- template "helpers.service" $onsiteInput }} +--- +{{- end }} {{ $frontendInput := dict "name" "frontend" "all" .Values "component" .Values.system.components.frontend -}} diff --git a/charts/eurofurence-registration-system/tests/deployments_test.yaml b/charts/eurofurence-registration-system/tests/deployments_test.yaml index ec81ae1..2193af9 100644 --- a/charts/eurofurence-registration-system/tests/deployments_test.yaml +++ b/charts/eurofurence-registration-system/tests/deployments_test.yaml @@ -120,11 +120,13 @@ tests: memory: 1111Mi frontend: enable: true + onsite: + enable: true asserts: - isKind: of: Deployment - hasDocuments: - count: 7 + count: 8 - equal: path: metadata value: @@ -620,6 +622,64 @@ tests: path: config.yaml mode: 0444 documentIndex: 5 + - equal: + path: metadata + value: + name: onsite + labels: + app: regsys + service: onsite + documentIndex: 6 + - equal: + path: spec + value: + replicas: 1 + revisionHistoryLimit: 3 + selector: + matchLabels: + app: regsys + service: onsite + template: + metadata: + labels: + app: regsys + service: onsite + spec: + containers: + - name: application + image: 'ghcr.io/eurofurence/reg-onsite-ui:latest' + ports: + - containerPort: 8000 + 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: [nginx] + args: + - -g + - 'daemon off;' + env: + - name: REG_SECRET_NOSECOUNTER_TOKEN + valueFrom: + secretKeyRef: + name: regsys-secret + key: REG_SECRET_NOSECOUNTER_TOKEN + documentIndex: 6 - equal: path: metadata value: @@ -627,7 +687,7 @@ tests: labels: app: regsys service: frontend - documentIndex: 6 + documentIndex: 7 - equal: path: spec value: @@ -689,7 +749,7 @@ tests: configMapKeyRef: name: regsys-cm key: HTTPD_CONF_STATIC_DIR - documentIndex: 6 + documentIndex: 7 - it: should not set namespace if unset asserts: diff --git a/charts/eurofurence-registration-system/tests/services_test.yaml b/charts/eurofurence-registration-system/tests/services_test.yaml index 10f2dbb..e1f43a0 100644 --- a/charts/eurofurence-registration-system/tests/services_test.yaml +++ b/charts/eurofurence-registration-system/tests/services_test.yaml @@ -62,11 +62,13 @@ tests: enable: true frontend: enable: true + onsite: + enable: true asserts: - isKind: of: Service - hasDocuments: - count: 7 + count: 8 - equal: path: metadata value: @@ -193,6 +195,27 @@ tests: service: regsys-classic type: ClusterIP documentIndex: 5 + - equal: + path: metadata + value: + name: onsite + labels: + app: regsys + service: onsite + documentIndex: 6 + - equal: + path: spec + value: + ports: + - port: 8000 + appProtocol: http + name: application + targetPort: primary + selector: + app: regsys + service: onsite + type: ClusterIP + documentIndex: 6 - equal: path: metadata value: @@ -200,7 +223,7 @@ tests: labels: app: regsys service: frontend - documentIndex: 6 + documentIndex: 7 - equal: path: spec value: @@ -213,7 +236,7 @@ tests: app: regsys service: frontend type: ClusterIP - documentIndex: 6 + documentIndex: 7 - it: should not set namespace if unset asserts: - notExists: diff --git a/charts/eurofurence-registration-system/values.schema.json b/charts/eurofurence-registration-system/values.schema.json index f885d57..3c2680f 100644 --- a/charts/eurofurence-registration-system/values.schema.json +++ b/charts/eurofurence-registration-system/values.schema.json @@ -952,6 +952,75 @@ } } } + }, + "onsite": { + "type": "object", + "additionalProperties": false, + "description": "system configuration for onsite ui", + "properties": { + "enable": { + "type": "boolean", + "description": "deploy onsite ui", + "default": "false" + }, + "docker": { + "type": "object", + "additionalProperties": false, + "description": "container source configuration", + "properties": { + "registry": { + "type": "string", + "description": "the container registry to pull from", + "default": "ghcr.io" + }, + "repository": { + "type": "string", + "description": "the path within the registry", + "default": "eurofurence/reg-regsys-classic" + }, + "tag": { + "type": "string", + "description": "the version tag, unless overridden in the individual component.", + "default": "latest" + } + } + }, + "labels": { + "type": "object", + "additionalProperties": true + }, + "replicas": { + "type": "integer", + "minValue": 1, + "maxValue": 1, + "description": "number of replicas to start - currently the auth service uses an in-memory flow cache, so only 1 replica is supported at the moment", + "default": 1 + }, + "limits": { + "type": "object", + "additionalProperties": false, + "properties": { + "memory": { + "type": "string", + "description": "amount of maximum memory before getting OOM-killed", + "example": "512Mi", + "default": "512Mi" + } + } + }, + "requests": { + "type": "object", + "additionalProperties": false, + "properties": { + "memory": { + "type": "string", + "description": "amount of memory reserved for the container", + "example": "256Mi", + "default": "256Mi" + } + } + } + } } } }, diff --git a/charts/eurofurence-registration-system/values.yaml b/charts/eurofurence-registration-system/values.yaml index 78ad2a6..ed84a67 100644 --- a/charts/eurofurence-registration-system/values.yaml +++ b/charts/eurofurence-registration-system/values.yaml @@ -143,6 +143,20 @@ system: requests: memory: 256Mi + onsite: + enable: false + docker: + registry: ghcr.io + repository: eurofurence/reg-onsite-ui + tag: latest + labels: + service: onsite + replicas: 1 + limits: + memory: 512Mi + requests: + memory: 64Mi + database: use: 'inmemory' username: 'demouser'