feat: helm chart (wip)
This commit is contained in:
39
dev/helm/templates/ingress.yaml
Normal file
39
dev/helm/templates/ingress.yaml
Normal file
@@ -0,0 +1,39 @@
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range .Values.ingress.hosts }}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ template "wiki.fullname" $ }}
|
||||
labels:
|
||||
app: {{ template "wiki.name" $ }}
|
||||
chart: {{ template "wiki.chart" $ }}
|
||||
release: {{ $.Release.Name | quote }}
|
||||
heritage: {{ $.Release.Service | quote }}
|
||||
annotations:
|
||||
{{- if .tls }}
|
||||
ingress.kubernetes.io/secure-backends: "true"
|
||||
{{- end }}
|
||||
{{- if .certManager }}
|
||||
kubernetes.io/tls-acme: "true"
|
||||
{{- end }}
|
||||
{{- range $key, $value := .annotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
spec:
|
||||
rules:
|
||||
- host: {{ .name }}
|
||||
http:
|
||||
paths:
|
||||
- path: {{ default "/" .path }}
|
||||
backend:
|
||||
serviceName: {{ template "wiki.fullname" $ }}
|
||||
servicePort: 80
|
||||
{{- if .tls }}
|
||||
tls:
|
||||
- hosts:
|
||||
- {{ .name }}
|
||||
secretName: {{ .tlsSecret }}
|
||||
{{- end }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
13
dev/helm/templates/secrets.yaml
Normal file
13
dev/helm/templates/secrets.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "wiki.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "wiki.fullname" . }}
|
||||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
type: Opaque
|
||||
data:
|
||||
db-user: {{ .Values.postgresql.postgresUser | b64enc | quote }}
|
||||
db-password: {{ .Values.postgresql.postgresPassword | b64enc | quote }}
|
32
dev/helm/templates/service.yaml
Normal file
32
dev/helm/templates/service.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "wiki.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "wiki.name" . }}
|
||||
chart: {{ template "wiki.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if .Values.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }}
|
||||
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}}
|
||||
nodePort: {{ .Values.service.nodePorts.http }}
|
||||
{{- end }}
|
||||
- name: https
|
||||
port: {{ .Values.service.httpsPort }}
|
||||
targetPort: https
|
||||
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}}
|
||||
nodePort: {{ .Values.service.nodePorts.https }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "wiki.name" . }}
|
Reference in New Issue
Block a user