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

helm: always deploy tier0, specify 2 separate domains for serve and s3

parent 58b58d36
Pipeline #3875 passed with stage
in 1 minute and 33 seconds
......@@ -20,33 +20,24 @@ spec:
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
- {{ .Values.ingress.serveHost | quote }}
- {{ .Values.ingress.s3Host | quote }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- $beta_enable_tier0 := .Values.beta_enable_tier0 -}}
{{- $fullname := include "p2.fullname" . -}}
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
- host: {{ .Values.ingress.serveHost | quote }}
http:
paths:
{{ if $beta_enable_tier0 -}}
- path: /_/
backend:
serviceName: {{ $fullname }}-web
servicePort: http
- path: /
backend:
serviceName: {{ $fullname }}-tier0
serviceName: {{ include "p2.fullname" . }}-tier0
servicePort: http
{{ else }}
- host: {{ .Values.ingress.s3Host | quote }}
http:
paths:
- path: /
backend:
serviceName: {{ $fullname }}-web
serviceName: {{ include "p2.fullname" . }}-web
servicePort: http
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.beta_enable_tier0 -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
......@@ -48,4 +47,3 @@ spec:
limits:
cpu: 200m
memory: 500M
{{- end }}
{{- if .Values.beta_enable_tier0 -}}
apiVersion: v1
kind: ServiceAccount
metadata:
......@@ -29,4 +28,3 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ include "p2.fullname" . }}-tier0
{{- end }}
......@@ -15,8 +15,6 @@ config:
# configure passbook then upgrade with external_auth_only = true.
external_auth_only: false
beta_enable_tier0: false
deployment:
webInstances: 2
workerInstances: 1
......@@ -29,8 +27,8 @@ postgresql:
ingress:
enabled: true
hosts:
- p2.k8s.local
serveHost: "i.p2.local"
s3Host: "s3.p2.local"
tls: []
# - secretName: chart-example-tls
# hosts:
......
......@@ -3,7 +3,8 @@
# p2 Install script
# Installs and updates a p2 instance using k3s and docker
# Supported enviormnet variables:
# - INGRESS_HOST: Hostname under which p2 will be available
# - SERVE_HOST: Hostname under which p2 will serve files
# - S3_HOST: Hostname under which the s3 API will be accessible
# - 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.
......@@ -87,7 +88,8 @@ 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|%INGRESS_HOST%|${INGRESS_HOST}|g" p2_k3s_helm.yaml
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|%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,9 +11,8 @@ spec:
webInstances: %WEB_INSTANCES%
ingress:
enabled: true
hosts:
- '%INGRESS_HOST%' # Replaced by install script
- '*.%INGRESS_HOST%' # Wildcard for S3
serveHost: "%SERVE_HOST%"
s3Host: "%S3_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