Commit 9cb1c41b authored by Jens Langhammer's avatar Jens Langhammer

helm: improve host configuration, make serve fully optional

parent 9fa0d7c1
......@@ -20,24 +20,32 @@ spec:
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.ingress.serveHost | quote }}
- {{ .Values.ingress.s3Host | quote }}
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.ingress.serveHost | quote }}
{{- $fullname := include "p2.fullname" . -}}
{{- if .Values.ingress.serve.enabled -}}
{{- range .Values.ingress.serve.hosts }}
- host: {{ . | quote }}
http:
paths:
- path: /
backend:
serviceName: {{ include "p2.fullname" . }}-tier0
serviceName: {{ $fullname }}-tier0
servicePort: http
- host: {{ .Values.ingress.s3Host | quote }}
{{- end -}}
{{- end }}
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
paths:
- path: /
backend:
serviceName: {{ include "p2.fullname" . }}-web
serviceName: {{ $fullname }}-web
servicePort: http
{{- end }}
{{- end }}
......@@ -27,9 +27,14 @@ postgresql:
ingress:
enabled: true
serveHost: "i.p2.local"
s3Host: "s3.p2.local"
serve:
enabled: true
hosts:
- "i.p2.local"
hosts:
- "p2.local"
tls: []
# - secretName: chart-example-tls
# hosts:
# - p2.k8s.local
# - i.p2.local
# - p2.local
......@@ -3,8 +3,8 @@
# p2 Install script
# Installs and updates a p2 instance using k3s and docker
# Supported enviormnet variables:
# - SERVE_HOST: Hostname under which p2 will serve files
# - S3_HOST: Hostname under which the s3 API will be accessible
# - HOST: Hostname under which the will be accessible
# - SERVE_HOST: Optional; Hostname under which p2 will serve files.
# - STORAGE_BASE: Base directory in which p2 data will be storeed
# - LE_MAIL: Optional; Let's Encrypt E-Mail. If this is not set, Let's Encrypt is not enabled.
......@@ -88,8 +88,13 @@ curl -fsSL -o p2_k3s_nginx.yaml "https://git.beryju.org/BeryJu.org/p2/raw/versio
# curl -fsSL -o p2_k3s_cert.yaml "https://git.beryju.org/BeryJu.org/p2/raw/version/${P2_VERSION}/install/k3s-cert-manager.yaml"
# Replace variable in Helm CRD
sed -i "s|%SERVE_HOST%|${SERVE_HOST}|g" p2_k3s_helm.yaml
sed -i "s|%S3_HOST%|${S3_HOST}|g" p2_k3s_helm.yaml
sed -i "s|%HOST%|${HOST}|g" p2_k3s_helm.yaml
if [ -n "$SERVE_HOST" ]; then
sed -i "s|%SERVE_ENABLED%|true|g" p2_k3s_helm.yaml
sed -i "s|%SERVE_HOST%|${SERVE_HOST}|g" p2_k3s_helm.yaml
else
sed -i "s|%SERVE_ENABLED%|false|g" p2_k3s_helm.yaml
fi
sed -i "s|%PASSWORD%|${PASSWORD}|g" p2_k3s_helm.yaml
# Adjust webserver instances (1 instance per CPU)
sed -i "s|%WEB_INSTANCES%|${CPU_CORES}|g" p2_k3s_helm.yaml
......
......@@ -11,8 +11,12 @@ spec:
webInstances: %WEB_INSTANCES%
ingress:
enabled: true
serveHost: "%SERVE_HOST%"
s3Host: "%S3_HOST%"
hosts:
- "%HOST%"
serve:
enabled: %SERVE_ENABLED%
hosts:
- "%SERVE_HOST%"
# Since this is made for a single-node deployment, we disable most of the HA pods
postgresql:
postgresqlDatabase: p2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment