{{- if and (hasKey .Values "service") (hasKey .Values.service "type") }} apiVersion: v1 kind: Service metadata: name: {{ include "judgeflow.fullname" . }} labels: {{- include "judgeflow.labels" . | nindent 4 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 4 }} {{- end }} spec: type: {{ .Values.service.type }} ports: {{- range .Values.service.ports }} - port: {{ .port }} targetPort: {{ .port }} protocol: TCP name: {{ .name }} {{- end }} selector: {{- include "judgeflow.selectorLabels" . | nindent 4 }} {{- end }}