feat: add resource-specific annotations to ingress objects

This commit is contained in:
Jose Diaz-Gonzalez committed 2024-02-06 22:12:41 -05:00
1 parent 5674a29211
commit 1af36b609d
2 files changed
+12 -2

No files matched your search

+1 -1
View File
@@ -73,8 +73,8 @@ type ProcessAnnotations struct {
JobAnnotations map[string]string `yaml:"job,omitempty"` JobAnnotations map[string]string `yaml:"job,omitempty"`
PodAnnotations map[string]string `yaml:"pod,omitempty"` PodAnnotations map[string]string `yaml:"pod,omitempty"`
SecretAnnotations map[string]string `yaml:"secret,omitempty"` SecretAnnotations map[string]string `yaml:"secret,omitempty"`
ServiceAnnotations map[string]string `yaml:"service,omitempty"`
ServiceAccountAnnotations map[string]string `yaml:"serviceaccount,omitempty"` ServiceAccountAnnotations map[string]string `yaml:"serviceaccount,omitempty"`
ServiceAnnotations map[string]string `yaml:"service,omitempty"`
TraefikIngressRouteAnnotations map[string]string `yaml:"traefik_ingressroute,omitempty"` TraefikIngressRouteAnnotations map[string]string `yaml:"traefik_ingressroute,omitempty"`
TraefikMiddlewareAnnotations map[string]string `yaml:"traefik_middleware,omitempty"` TraefikMiddlewareAnnotations map[string]string `yaml:"traefik_middleware,omitempty"`
} }
@@ -1,5 +1,5 @@
{{- $processName := "PROCESS_NAME" }} {{- $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") }} {{- if and $config.web.domains (eq $.Values.global.network.ingress_class "nginx") }}
{{- range $pdx, $port_map := $config.web.port_maps }} {{- range $pdx, $port_map := $config.web.port_maps }}
--- ---
@@ -8,6 +8,16 @@ kind: Ingress
metadata: metadata:
annotations: annotations:
dokku.com/managed: "true" 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: labels:
app.kubernetes.io/instance: {{ $.Values.global.app_name }}-{{ $processName }} app.kubernetes.io/instance: {{ $.Values.global.app_name }}-{{ $processName }}
app.kubernetes.io/name: {{ $processName }} app.kubernetes.io/name: {{ $processName }}