controller-service-webhook.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {{- if .Values.controller.admissionWebhooks.enabled -}}
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. {{- if .Values.controller.admissionWebhooks.service.annotations }}
  6. annotations: {{ toYaml .Values.controller.admissionWebhooks.service.annotations | nindent 4 }}
  7. {{- end }}
  8. labels:
  9. {{- include "ingress-nginx.labels" . | nindent 4 }}
  10. app.kubernetes.io/component: controller
  11. {{- with .Values.controller.labels }}
  12. {{- toYaml . | nindent 4 }}
  13. {{- end }}
  14. name: {{ include "ingress-nginx.controller.fullname" . }}-admission
  15. namespace: {{ .Release.Namespace }}
  16. spec:
  17. type: {{ .Values.controller.admissionWebhooks.service.type }}
  18. {{- if .Values.controller.admissionWebhooks.service.clusterIP }}
  19. clusterIP: {{ .Values.controller.admissionWebhooks.service.clusterIP }}
  20. {{- end }}
  21. {{- if .Values.controller.admissionWebhooks.service.externalIPs }}
  22. externalIPs: {{ toYaml .Values.controller.admissionWebhooks.service.externalIPs | nindent 4 }}
  23. {{- end }}
  24. {{- if .Values.controller.admissionWebhooks.service.loadBalancerIP }}
  25. loadBalancerIP: {{ .Values.controller.admissionWebhooks.service.loadBalancerIP }}
  26. {{- end }}
  27. {{- if .Values.controller.admissionWebhooks.service.loadBalancerSourceRanges }}
  28. loadBalancerSourceRanges: {{ toYaml .Values.controller.admissionWebhooks.service.loadBalancerSourceRanges | nindent 4 }}
  29. {{- end }}
  30. ports:
  31. - name: https-webhook
  32. port: 443
  33. targetPort: webhook
  34. {{- if semverCompare ">=1.20" .Capabilities.KubeVersion.Version }}
  35. appProtocol: https
  36. {{- end }}
  37. selector:
  38. {{- include "ingress-nginx.selectorLabels" . | nindent 4 }}
  39. app.kubernetes.io/component: controller
  40. {{- end }}