apiVersion: v1 kind: Service metadata: labels: {{ include "externalip-webhook.labels" . | indent 4 }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} name: {{ template "externalip-webhook.fullname" . }} namespace: {{ .Release.Namespace }} spec: ports: - name: webhook-server port: {{ .Values.service.webhookPort }} protocol: TCP targetPort: {{ .Values.webhookPort }} selector: app: {{ template "externalip-webhook.name" . }} type: "ClusterIP" {{- if .Values.metrics.enabled }} --- apiVersion: v1 kind: Service metadata: labels: {{ include "externalip-webhook.labels" . | indent 4 }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} name: {{ template "externalip-webhook.fullname" . }}-metrics-service namespace: {{ .Release.Namespace }} spec: ports: - name: webhook-metrics port: {{ .Values.service.metricsPort }} protocol: TCP targetPort: {{ .Values.metrics.port }} selector: app: {{ template "externalip-webhook.name" . }} type: "ClusterIP" {{- end }}