TrueChartsClone/charts/enterprise/blocky/templates/_k8sgateway.tpl

89 lines
2.6 KiB
Smarty
Raw Normal View History

{{- define "k8sgateway.container" -}}
image: {{ .Values.k8sgatewayImage.repository }}:{{ .Values.k8sgatewayImage.tag }}
imagePullPolicy: {{ .Values.k8sgatewayImage.pullPolicy }}
securityContext:
runAsUser: 0
runAsGroup: 0
readOnlyRootFilesystem: true
runAsNonRoot: false
args: ["-conf", "/etc/coredns/Corefile"]
volumeMounts:
- name: config-volume
mountPath: /etc/coredns
BREAKING CHANGE refactor: port all enterprise apps to new common and add apps (#7738) * use new common * more porting and add notes.txt * portals * add vaultwarden and authelia to enterprise * some changes * authelia porting * fix grafana * fixup metallb * more * traefik * some initial blocky work * fixes * more work on enterprise train * containers * labels * no message * some more fixes * update questions for new enterprise apps * something * remove postgresql dependency from enterprise train apps * fix some traefik bugs * remove prometheus affinities for now * authelia postgresql fixes * bump and fix install test errors * bump common for probe fixes * fix questions * more questions fixes * add some metrics improvements * some more fixes * whoops * some authelia fixes * fix blocky and authelia * bump common for postgresql fixes * hmm * bump common * bump redis to disable double manifest loading * dont enc secrets for authelia * traefik, blocky and authelia fixes * traefik caps on protocols * bump redis for password fixes * ensure roles are clusterwide * ok * redis/common bumps * remove blocky webui and change config location * whoops * redis fix * more blocky tryouts * authelia whoops * bump blocky version * disable prometheus controller * oops * bump common on prometheus for custom service selector labels * rename prometheus selector labels on service * damn * more work * blocky 100 tryout * blocky root tryout * fix blocky config and remove fsgroup * dont drop caps * Update common.yaml Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl> * Update values.yaml Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl> * Update values.yaml Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl> * revert update for blocky * use old-style mount for blocky * put update back for blocky * add initial postgresl query log support * hmm * small lint * bump common --------- Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl> Co-authored-by: Stavros kois <s.kois@outlook.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
2023-03-04 12:42:14 +00:00
probe:
readiness:
httpGet:
path: /ready
port: 8181
liveness:
httpGet:
path: /health
port: 8080
startup:
httpGet:
path: /ready
port: 8181
{{- end -}}
{{/*
Create the matchable regex from domain
*/}}
{{- define "k8sgateway.configmap.regex" -}}
{{- if .dnsChallenge.domain }}
{{- .dnsChallenge.domain | replace "." "[.]" -}}
{{- else -}}
{{ "unset" }}
{{- end }}
{{- end -}}
{{/* Define the configmap */}}
{{- define "k8sgateway.configmap" -}}
{{- $values := .Values.k8sgateway }}
BREAKING CHANGE refactor: port all enterprise apps to new common and add apps (#7738) * use new common * more porting and add notes.txt * portals * add vaultwarden and authelia to enterprise * some changes * authelia porting * fix grafana * fixup metallb * more * traefik * some initial blocky work * fixes * more work on enterprise train * containers * labels * no message * some more fixes * update questions for new enterprise apps * something * remove postgresql dependency from enterprise train apps * fix some traefik bugs * remove prometheus affinities for now * authelia postgresql fixes * bump and fix install test errors * bump common for probe fixes * fix questions * more questions fixes * add some metrics improvements * some more fixes * whoops * some authelia fixes * fix blocky and authelia * bump common for postgresql fixes * hmm * bump common * bump redis to disable double manifest loading * dont enc secrets for authelia * traefik, blocky and authelia fixes * traefik caps on protocols * bump redis for password fixes * ensure roles are clusterwide * ok * redis/common bumps * remove blocky webui and change config location * whoops * redis fix * more blocky tryouts * authelia whoops * bump blocky version * disable prometheus controller * oops * bump common on prometheus for custom service selector labels * rename prometheus selector labels on service * damn * more work * blocky 100 tryout * blocky root tryout * fix blocky config and remove fsgroup * dont drop caps * Update common.yaml Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl> * Update values.yaml Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl> * Update values.yaml Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl> * revert update for blocky * use old-style mount for blocky * put update back for blocky * add initial postgresl query log support * hmm * small lint * bump common --------- Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl> Co-authored-by: Stavros kois <s.kois@outlook.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
2023-03-04 12:42:14 +00:00
{{- $fqdn := ( include "tc.v1.common.lib.chart.names.fqdn" . ) }}
enabled: true
data:
Corefile: |-
.:{{ .Values.service.k8sgateway.ports.k8sgateway.targetPort }} {
errors
log
health {
lameduck 5s
}
ready
{{- range .Values.k8sgateway.domains }}
{{- if .dnsChallenge.enabled }}
template IN ANY {{ required "Delegated domain ('domain') is mandatory" .domain }} {
match "_acme-challenge[.](.*)[.]{{ include "k8sgateway.configmap.regex" . }}"
answer "{{ "{{" }} .Name {{ "}}" }} 5 IN CNAME {{ "{{" }} index .Match 1 {{ "}}" }}.{{ required "DNS01 challenge domain is mandatory" .dnsChallenge.domain }}"
fallthrough
}
{{- end }}
{{- end }}
k8s_gateway {{ range .Values.k8sgateway.domains }}"{{ required "Delegated domain ('domain') is mandatory " .domain }}"{{ end }} {
apex {{ $values.apex | default $fqdn }}
ttl {{ $values.ttl }}
{{- if $values.secondary }}
secondary {{ $values.secondary }}
{{- end }}
{{- if $values.watchedResources }}
resources {{ join " " $values.watchedResources }}
{{- end }}
fallthrough
}
prometheus 0.0.0.0:9153
{{- if .Values.k8sgateway.forward.enabled }}
forward . {{ .Values.k8sgateway.forward.primary }} {{ .Values.k8sgateway.forward.secondary }} {
{{- range .Values.k8sgateway.forward.options }}
{{ .name }} {{ .value }}
{{- end }}
}
{{- else }}
forward . 1.1.1.1
{{- end }}
loop
reload
loadbalance
}
{{- end -}}