webhook-service.yaml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {{- if .Values.webhook.create }}
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: {{ include "external-secrets.fullname" . }}-webhook
  6. namespace: {{ .Release.Namespace | quote }}
  7. labels:
  8. {{- include "external-secrets-webhook.labels" . | nindent 4 }}
  9. external-secrets.io/component: webhook
  10. {{- if .Values.webhook.prometheus.enabled}}
  11. annotations:
  12. prometheus.io/path: "/metrics"
  13. prometheus.io/scrape: "true"
  14. prometheus.io/port: {{ .Values.prometheus.service.port | quote }}
  15. {{- else }}
  16. {{- with .Values.metrics.service.annotations }}
  17. annotations:
  18. {{- toYaml . | nindent 4 }}
  19. {{- end }}
  20. {{- end }}
  21. spec:
  22. type: ClusterIP
  23. ports:
  24. - port: 443
  25. targetPort: {{ .Values.webhook.port }}
  26. protocol: TCP
  27. name: webhook
  28. {{- if or .Values.webhook.prometheus.enabled .Values.webhook.metrics.service.enabled }}
  29. {{- if .Values.webhook.prometheus.enabled }}
  30. - port: {{ .Values.webhook.prometheus.service.port }}
  31. targetPort: {{ .Values.webhook.prometheus.service.port }}
  32. {{- else }}
  33. - port: {{ .Values.webhook.metrics.service.port }}
  34. targetPort: {{ .Values.webhook.metrics.service.port }}
  35. {{- end }}
  36. protocol: TCP
  37. name: metrics
  38. {{- end }}
  39. selector:
  40. {{- include "external-secrets-webhook.selectorLabels" . | nindent 4 }}
  41. {{- end }}