feat: add resource-specific annotations to ingress objects

This commit is contained in:
Jose Diaz-Gonzalez
2024-02-05 13:35:09 -05:00
parent 5674a29211
commit 1af36b609d
2 changed files with 12 additions and 2 deletions

View File

@@ -73,8 +73,8 @@ type ProcessAnnotations struct {
JobAnnotations map[string]string `yaml:"job,omitempty"`
PodAnnotations map[string]string `yaml:"pod,omitempty"`
SecretAnnotations map[string]string `yaml:"secret,omitempty"`
ServiceAnnotations map[string]string `yaml:"service,omitempty"`
ServiceAccountAnnotations map[string]string `yaml:"serviceaccount,omitempty"`
ServiceAnnotations map[string]string `yaml:"service,omitempty"`
TraefikIngressRouteAnnotations map[string]string `yaml:"traefik_ingressroute,omitempty"`
TraefikMiddlewareAnnotations map[string]string `yaml:"traefik_middleware,omitempty"`
}

View File

@@ -1,5 +1,5 @@
{{- $processName := "PROCESS_NAME" }}
{{- $config := .Values.processes.PROCESS_NAME }}
{{- $config := index .Values.processes "PROCESS_NAME" }}
{{- if and $config.web.domains (eq $.Values.global.network.ingress_class "nginx") }}
{{- range $pdx, $port_map := $config.web.port_maps }}
---
@@ -8,6 +8,16 @@ kind: Ingress
metadata:
annotations:
dokku.com/managed: "true"
{{- if and $.Values.global.annotations $.Values.global.annotations.deployment }}
{{- range $k, $v := $.Values.global.annotations.deployment }}
{{ $k }}: {{ $v | quote }}
{{- end }}
{{- end }}
{{- if and $config.annotations $config.annotations.ingress }}
{{- range $k, $v := $config.annotations.ingress }}
{{ $k }}: {{ $v | quote }}
{{- end }}
{{- end }}
labels:
app.kubernetes.io/instance: {{ $.Values.global.app_name }}-{{ $processName }}
app.kubernetes.io/name: {{ $processName }}