ingress.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {{- if .Values.ingress.enabled -}}
  2. {{- $ingresses := prepend .Values.ingress.additionalIngresses .Values.ingress -}}
  3. {{- range $ingresses }}
  4. apiVersion: "networking.k8s.io/v1"
  5. kind: Ingress
  6. metadata:
  7. {{- if .name }}
  8. name: {{ printf "%s-%s" (include "opentelemetry-collector.fullname" $) .name }}
  9. {{- else }}
  10. name: {{ include "opentelemetry-collector.fullname" $ }}
  11. {{- end }}
  12. labels:
  13. {{- include "opentelemetry-collector.labels" $ | nindent 4 }}
  14. {{- include "opentelemetry-collector.component" $ | nindent 4 }}
  15. {{- if .annotations }}
  16. annotations:
  17. {{- range $key, $value := .annotations }}
  18. {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
  19. {{- end }}
  20. {{- end }}
  21. spec:
  22. {{- if .ingressClassName }}
  23. ingressClassName: {{ .ingressClassName }}
  24. {{- end -}}
  25. {{- if .tls }}
  26. tls:
  27. {{- range .tls }}
  28. - hosts:
  29. {{- range .hosts }}
  30. - {{ . | quote }}
  31. {{- end }}
  32. {{- with .secretName }}
  33. secretName: {{ . }}
  34. {{- end }}
  35. {{- end }}
  36. {{- end }}
  37. rules:
  38. {{- range .hosts }}
  39. - host: {{ .host | quote }}
  40. http:
  41. paths:
  42. {{- range .paths }}
  43. - path: {{ .path }}
  44. pathType: {{ .pathType }}
  45. backend:
  46. service:
  47. name: {{ include "opentelemetry-collector.fullname" $ }}
  48. port:
  49. number: {{ .port }}
  50. {{- end }}
  51. {{- end }}
  52. ---
  53. {{- end }}
  54. {{- end }}