apiVersion: v1
kind: Service
metadata:
  name: {{ template "heapster.service.fullname" . }}
  labels:
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    app: {{ template "heapster.fullname" . }}
    heritage: "{{ .Release.Service }}"
    release: "{{ .Release.Name }}"
    {{- range $key, $value := .Values.service.labels }}
    {{ $key }}: {{ $value }}
    {{- end }}    
{{- if .Values.service.annotations }}
  annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
  type: {{ .Values.service.type }}
  ports:
  - port: {{ .Values.service.externalPort }}
    targetPort: {{ .Values.service.internalPort }}
    protocol: TCP
  selector:
    app: {{ template "heapster.fullname" . }}
