Verified Commit 6ae7a37f authored by Hugo's avatar Hugo
Browse files

allow fqdn + domain overwrite

parent 23beb261
{{/*
Expand the name of the chart.
*/}}
{{- define "fqdn" -}}
{{ .Release.Name }}-{{ .Release.Namespace }}
{{- end }}
{{- define "domain" -}}
{{ include "fqdn" . | replace "-" "." }}
{{- end }}
kind: ConfigMap
metadata:
name: {{ include "fqdn" . }}-config
name: {{ tpl .Values.fqdn . }}-config
apiVersion: v1
data:
{{- if .Values.oauth.enabled }}
......@@ -17,7 +17,7 @@ data:
{{- end }}
CMD_IMAGE_UPLOAD_TYPE: minio
CMD_S3_REGION: default
CMD_S3_BUCKET: {{ include "fqdn" . }}
CMD_S3_BUCKET: {{ tpl .Values.fqdn . }}
CMD_MINIO_ENDPOINT: "s3.standard.indie.host"
CMD_PROTOCOL_USESSL: "true"
CMD_URL_ADDPORT: "false"
......@@ -25,5 +25,5 @@ data:
CMD_MINIO_PORT: "443"
CMD_MINIO_SECURE: "true"
CMD_USECDN: "false"
CMD_DOMAIN: {{ include "domain" . }}
CMD_DOMAIN: {{ tpl .Values.domain . }}
DB_TYPE: postgres
\ No newline at end of file
......@@ -3,23 +3,23 @@ kind: Deployment
metadata:
labels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ include "fqdn" . }}
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
name: {{ include "fqdn" . }}-app
name: {{ tpl .Values.fqdn . }}-app
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ include "fqdn" . }}
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
template:
metadata:
labels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ include "fqdn" . }}
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
spec:
......@@ -30,37 +30,37 @@ spec:
valueFrom:
secretKeyRef:
key: postgresql-url
name: {{ include "fqdn" . }}
name: {{ tpl .Values.fqdn . }}
- name: CMD_SESSION_SECRET
valueFrom:
secretKeyRef:
key: session
name: {{ include "fqdn" . }}
name: {{ tpl .Values.fqdn . }}
- name: CMD_MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
key: AWS_ACCESS_KEY_ID
name: {{ include "fqdn" . }}-s3
name: {{ tpl .Values.fqdn . }}-s3
- name: CMD_MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
key: AWS_SECRET_ACCESS_KEY
name: {{ include "fqdn" . }}-s3
name: {{ tpl .Values.fqdn . }}-s3
{{- if .Values.oauth.enabled }}
- name: CMD_OAUTH2_CLIENT_ID
valueFrom:
secretKeyRef:
key: client-id
name: {{ include "fqdn" . }}-oidc
name: {{ tpl .Values.fqdn . }}-oidc
- name: CMD_OAUTH2_CLIENT_SECRET
valueFrom:
secretKeyRef:
key: client-secret
name: {{ include "fqdn" . }}-oidc
name: {{ tpl .Values.fqdn . }}-oidc
{{- end }}
envFrom:
- configMapRef:
name: {{ include "fqdn" . }}-config
name: {{ tpl .Values.fqdn . }}-config
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: IfNotPresent
name: hedgedoc
......
......@@ -5,20 +5,20 @@ metadata:
kubernetes.io/tls-acme: "true"
labels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ include "fqdn" . }}
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
name: {{ include "fqdn" . }}-app
name: {{ tpl .Values.fqdn . }}-app
spec:
rules:
- host: {{ include "domain" . }}
- host: {{ tpl .Values.domain . }}
http:
paths:
- backend:
serviceName: {{ include "fqdn" . }}-app
serviceName: {{ tpl .Values.fqdn . }}-app
servicePort: http
path: /
tls:
- hosts:
- {{ include "domain" . }}
secretName: {{ include "fqdn" . }}-tls
- {{ tpl .Values.domain . }}
secretName: {{ tpl .Values.fqdn . }}-tls
{{ $secretName := print (include "fqdn" .) "-app" }}
{{ $secretName := print (tpl .Values.fqdn .) "-app" }}
{{ $secret := lookup "v1" "Secret" .Release.Namespace $secretName }}
{{ $pgSecretName := print "hedgedoc.pg-" .Release.Namespace ".credentials" }}
{{ $pgSecret := lookup "v1" "Secret" .Release.Namespace $pgSecretName }}
......
......@@ -3,10 +3,10 @@ kind: Service
metadata:
labels:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ include "fqdn" . }}
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
name: {{ include "fqdn" . }}-app
name: {{ tpl .Values.fqdn . }}-app
spec:
ports:
- name: http
......@@ -15,7 +15,7 @@ spec:
targetPort: http
selector:
app.kubernetes.io/component: app
app.kubernetes.io/instance: {{ include "fqdn" . }}
app.kubernetes.io/instance: {{ tpl .Values.fqdn . }}
app.kubernetes.io/name: hedgedoc
app.kubernetes.io/part-of: hedgedoc
type: ClusterIP
......@@ -3,6 +3,9 @@ image:
pullPolicy: IfNotPresent
tag: ""
fqdn: "{{ .Release.Name }}-{{ .Release.Namespace }}"
domain: '{{ tpl .Values.fqdn . | replace "-" "." }}'
oauth:
enabled: true
providerName: Liiibre
......
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