apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}
  labels:
    app: {{ template "fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
    system: openstack
    component: keystone
    type: api
{{- if .Values.api.metrics.enabled }}
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/targets: "{{ required ".Values.alerts.prometheus missing" .Values.alerts.prometheus }}"
{{- end }}
spec:
  selector:
    name: {{ .Release.Name }}-api
  type: {{ default "ClusterIP" .Values.services.type }}
  ports:
    - name: public
      protocol: "TCP"
      port: 5000
      targetPort: 5000
{{- if .Values.global.keystone_internal_ip }}
  externalIPs:
    - {{ .Values.global.keystone_internal_ip | quote }}
{{- if .Values.services.externalip }}
    - {{ .Values.services.externalip | quote }}
{{- end }}
{{- end }}

apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}
  labels:
    app: {{ template "fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
    system: openstack
    component: keystone
    type: api
{{- if .Values.api.metrics.enabled }}
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "{{.Values.api.metrics.port}}"
    prometheus.io/targets: "{{ required ".Values.alerts.prometheus missing" .Values.alerts.prometheus }}"
{{- end }}
spec:
  selector:
    name: {{ .Release.Name }}-api
  type: {{ default "ClusterIP" .Values.services.type }}
  ports:
    - name: public
      protocol: "TCP"
      port: 5000
      targetPort: 5000
{{- if .Values.global.keystone_internal_ip }}
  externalIPs:
    - {{ .Values.global.keystone_internal_ip | quote }}
{{- if .Values.services.externalip }}
    - {{ .Values.services.externalip | quote }}
{{- end }}
{{- end }}

Revert "[Keystone] prevent double scraping of api"
Revert "[Keystone] prevent double scraping of api"

This reverts commit 05a29e6ca3e717c4ea822b45e5f5f26a0365923e.
