Skip to content

Commit

Permalink
feat(#6): support onsite UI container
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpy-Squirrel committed Sep 9, 2024
1 parent fb371c8 commit 6c94844
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 9 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.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
4 changes: 2 additions & 2 deletions charts/eurofurence-registration-system/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
{{- $mergedLabels | toYaml | nindent 4 }}
spec:
ports:
- port: 8080
- port: {{ .port | default 8080 }}
appProtocol: http
name: application
targetPort: primary
Expand Down Expand Up @@ -57,7 +57,7 @@ spec:
{{- toYaml . | nindent 14 }}
{{- end }}
ports:
- containerPort: 8080
- containerPort: {{ .port | default 8080 }}
name: primary
readinessProbe:
httpGet:
Expand Down
12 changes: 12 additions & 0 deletions charts/eurofurence-registration-system/templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
66 changes: 63 additions & 3 deletions charts/eurofurence-registration-system/tests/deployments_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -620,14 +622,72 @@ 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:
name: frontend
labels:
app: regsys
service: frontend
documentIndex: 6
documentIndex: 7
- equal:
path: spec
value:
Expand Down Expand Up @@ -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:
Expand Down
29 changes: 26 additions & 3 deletions charts/eurofurence-registration-system/tests/services_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -193,14 +195,35 @@ 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:
name: frontend
labels:
app: regsys
service: frontend
documentIndex: 6
documentIndex: 7
- equal:
path: spec
value:
Expand All @@ -213,7 +236,7 @@ tests:
app: regsys
service: frontend
type: ClusterIP
documentIndex: 6
documentIndex: 7
- it: should not set namespace if unset
asserts:
- notExists:
Expand Down
69 changes: 69 additions & 0 deletions charts/eurofurence-registration-system/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
}
}
},
Expand Down
14 changes: 14 additions & 0 deletions charts/eurofurence-registration-system/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 6c94844

Please sign in to comment.