ingress.yaml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. namespace: {{ template "opentelemetry-collector.namespace" $ }}
  13. labels:
  14. {{- include "opentelemetry-collector.labels" $ | nindent 4 }}
  15. {{- include "opentelemetry-collector.component" $ | nindent 4 }}
  16. {{- if .annotations }}
  17. annotations:
  18. {{- range $key, $value := .annotations }}
  19. {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
  20. {{- end }}
  21. {{- end }}
  22. spec:
  23. {{- if .ingressClassName }}
  24. ingressClassName: {{ .ingressClassName }}
  25. {{- end -}}
  26. {{- if .tls }}
  27. tls:
  28. {{- range .tls }}
  29. - hosts:
  30. {{- range .hosts }}
  31. - {{ tpl . $ | quote }}
  32. {{- end }}
  33. {{- with .secretName }}
  34. secretName: {{ . }}
  35. {{- end }}
  36. {{- end }}
  37. {{- end }}
  38. rules:
  39. {{- range .hosts }}
  40. - host: {{ tpl .host $ | quote }}
  41. http:
  42. paths:
  43. {{- range .paths }}
  44. - path: {{ .path }}
  45. pathType: {{ .pathType }}
  46. backend:
  47. service:
  48. name: {{ include "opentelemetry-collector.fullname" $ }}
  49. port:
  50. number: {{ .port }}
  51. {{- end }}
  52. {{- end }}
  53. ---
  54. {{- end }}
  55. {{- end }}