feat: added OpenShift route (#954)
Some checks failed
build / lint-node (push) Successful in 32s
build / lint-helm (push) Successful in 47s
build / e2e (v1.28.15+k3s1) (push) Has been cancelled
build / e2e (v1.30.6+k3s1) (push) Has been cancelled
build / e2e (v1.31.2+k3s1) (push) Has been cancelled
build / test-success (push) Has been cancelled
build / publish (push) Has been cancelled
Some checks failed
build / lint-node (push) Successful in 32s
build / lint-helm (push) Successful in 47s
build / e2e (v1.28.15+k3s1) (push) Has been cancelled
build / e2e (v1.30.6+k3s1) (push) Has been cancelled
build / e2e (v1.31.2+k3s1) (push) Has been cancelled
build / test-success (push) Has been cancelled
build / publish (push) Has been cancelled
Reviewed-on: https://code.forgejo.org/forgejo-helm/forgejo-helm/pulls/954 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Co-authored-by: Lucien Weller <lucien@wellernet.ch> Co-committed-by: Lucien Weller <lucien@wellernet.ch>
This commit is contained in:
parent
8bd2c48184
commit
7e1629e174
4 changed files with 263 additions and 0 deletions
43
templates/gitea/route.yaml
Normal file
43
templates/gitea/route.yaml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{{- if .Values.route.enabled -}}
|
||||
apiVersion: route.openshift.io/v1
|
||||
kind: Route
|
||||
metadata:
|
||||
name: {{ include "gitea.fullname" . }}-http
|
||||
namespace: {{ include "common.names.namespace" . | quote }}
|
||||
labels:
|
||||
{{- include "gitea.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
{{- toYaml .Values.route.annotations | nindent 4 }}
|
||||
spec:
|
||||
{{- if .Values.route.host }}
|
||||
host: {{ tpl .Values.route.host $ | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.route.wildcardPolicy }}
|
||||
wildcardPolicy: {{ .Values.route.wildcardPolicy }}
|
||||
{{- end }}
|
||||
to:
|
||||
kind: Service
|
||||
name: {{ include "gitea.fullname" . }}-http
|
||||
weight: 100
|
||||
port:
|
||||
targetPort: http
|
||||
tls:
|
||||
termination: edge
|
||||
insecureEdgeTerminationPolicy: Redirect
|
||||
{{- if .Values.route.tls.existingSecret }}
|
||||
externalCertificate: {{ .Values.route.tls.existingSecret }}
|
||||
{{- else if and .Values.route.tls.certificate
|
||||
.Values.route.tls.privateKey
|
||||
.Values.route.tls.caCertificate }}
|
||||
certificate: |
|
||||
{{ .Values.route.tls.certificate | indent 6 }}
|
||||
key: |
|
||||
{{ .Values.route.tls.privateKey | indent 6 }}
|
||||
caCertificate: |
|
||||
{{ .Values.route.tls.caCertificate | indent 6 }}
|
||||
{{- else if or .Values.route.tls.certificate
|
||||
.Values.route.tls.privateKey
|
||||
.Values.route.tls.caCertificate }}
|
||||
{{- fail "certificate, privateKey and caCertificate must be specified together" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue