feat(patchinject)

drone
nold 2 years ago
parent 2068a7cb54
commit a0e101aaad
  1. 4
      charts/heqet/templates/_helpers.tpl
  2. 35
      charts/heqet/templates/heqet-apps.yaml
  3. 12
      charts/heqet/values.yaml

@ -31,10 +31,9 @@ ingress:
{{- /*
Inject vault-injector into pods
*/ -}}
{{- define "vault.injection" }}
{{- define "heqet.vault" }}
podAnnotations:
heqet.gnu.one/app: "true"
{{- if not .novault }}
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: "{{ .name }}-vault-ro"
{{- if .secret }}
@ -46,4 +45,3 @@ podAnnotations:
spec:
serviceAccountName: "{{ .name }}-vault-ro"
{{- end }}
{{- end }}

@ -42,30 +42,19 @@ spec:
{{- end }}
{{- end }}
{{- end }}
values: |
{{- if or (and $.Values.ingress.enabled .vhost) .values }}
{{- if and $.Values.ingress.enabled .vhost }}
{{- $shift := empty .ingress_prefix -}}
{{- $indent := ternary 8 10 $shift -}}
{{- if .ingress_prefix }}
{{ .ingress_prefix | indent 8 }}:
{{- end -}}
{{- include "heqet.ingress" . | indent $indent -}}
{{- end }}
{{- if .values }}
{{ toYaml .values | default "" | indent 8 -}}
{{- end }}
{{- $shift := empty .pod_spec_prefix -}}
{{- $indent := ternary 8 10 $shift -}}
{{- if .pod_spec_ingress_prefix }}
{{ .pod_spec_prefix | indent 8 }}:
{{- end }}
{{- include "vault.injection" . | indent $indent -}}
{{- end -}}
{{- end }}
{{- $values := dict }}
{{- if .has_values }}
{{- $patch_values := $.Files.Get (printf "values.d/%s.yaml" .name ) | fromYaml }}
{{- $values := deepCopy $patch_values | merge $values }}
{{- end }}
{{- range .patches }}
{{- $patch_values := include (printf "heqet.%s" .name) . | fromYaml }}
{{- $tmp := dict .path }}
{{- $_ := set $tmp .path $patch_values }}
{{- $values := deepCopy $tmp | merge $values }}
{{- end }}
{{ toYaml $values | indent 8 }}
syncPolicy:
automated:
# FIXME: Open Issue: https://github.com/helm/helm/issues/8026

@ -36,6 +36,14 @@ apps:
vhost: argocd.heqet.gnu.one
ingress_prefix: server
pod_spec_prefix: server
has_values: true
patches:
- name: vault
path: server
paths:
- root: server
values:
access: ro
parameters:
- name: server.debug
value: "true"
@ -49,10 +57,6 @@ apps:
value: debug
- name: repoServer.logLevel
value: debug
values:
server:
extraArgs:
- --insecure
- name: jaeger
path: charts/jaeger

Loading…
Cancel
Save