Skip to content

Commit

Permalink
feat(#3): add frontend deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumpy-Squirrel committed Dec 7, 2023
1 parent 4f6222d commit 9929281
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 1 deletion.
9 changes: 9 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ spec:
name: regsys-secret
key: {{ . }}
{{- end }}
{{- range .envs }}
- name: {{ . }}
valueFrom:
configMapKeyRef:
name: regsys-cm
key: {{ . }}
{{- end }}
{{- if ne .volume "no" }}
volumeMounts:
- name: config-file
mountPath: /config
Expand All @@ -96,3 +104,4 @@ spec:
path: config.yaml
mode: 0444
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,5 @@ data:
logging:
severity: {{ .Values.system.logging.severity }}
style: {{ .Values.system.logging.style }}
HTTPD_CONF_PATH_PREFIX_NO_SLASHES: 'TODO'
9 changes: 9 additions & 0 deletions templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,12 @@
"command" "/usr/bin/java"
"args" (list "-jar" "/app/regsys-classic.jar") -}}
{{- template "helpers.deployment" $classicInput }}
---
{{ $frontendInput := dict "name" "frontend"
"all" .Values
"component" .Values.system.components.frontend
"envs" (list "HTTPD_CONF_PATH_PREFIX_NO_SLASHES")
"command" "/usr/sbin/httpd"
"args" (list "-f" "/etc/apache2/regsys.conf")
"volume" "no" -}}
{{- template "helpers.deployment" $frontendInput }}
3 changes: 3 additions & 0 deletions tests/configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ tests:
logging:
severity: INFO
style: ecs
- equal:
path: data.HTTPD_CONF_PATH_PREFIX_NO_SLASHES
value: 'TODO'

- it: should not set namespace if unset
set:
Expand Down
61 changes: 60 additions & 1 deletion tests/deployments_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tests:
- isKind:
of: Deployment
- hasDocuments:
count: 6
count: 7
- equal:
path: metadata
value:
Expand Down Expand Up @@ -497,6 +497,65 @@ tests:
path: config.yaml
mode: 0444
documentIndex: 5
- equal:
path: metadata
value:
name: frontend
labels:
app: regsys
service: frontend
regsysChart: https://github.com/eurofurence/reg-helm-chart
documentIndex: 6
- equal:
path: spec
value:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: regsys
service: frontend
regsysChart: https://github.com/eurofurence/reg-helm-chart
template:
metadata:
labels:
app: regsys
service: frontend
regsysChart: https://github.com/eurofurence/reg-helm-chart
spec:
containers:
- name: application
image: 'ghcr.io/eurofurence/reg-frontend:latest'
ports:
- containerPort: 8080
name: primary
readinessProbe:
httpGet:
port: primary
path: /
initialDelaySeconds: 2
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
memory: 256Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
command: [/usr/sbin/httpd]
args:
- -f
- /etc/apache2/regsys.conf
env:
- name: HTTPD_CONF_PATH_PREFIX_NO_SLASHES
valueFrom:
configMapKeyRef:
name: regsys-cm
key: HTTPD_CONF_PATH_PREFIX_NO_SLASHES
documentIndex: 6

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

0 comments on commit 9929281

Please sign in to comment.