# helm_charts_service-secrets.yaml
{{- if and (not .Values.server.kubernetes.enabled) .Values.runner.enabled .Values.secrets.enabled .Values.runner.enabled -}}
apiVersion: v1
kind: Service
metadata:
  name: {{ template "drone.fullname" . }}-secrets
{{- if .Values.secrets.service.annotations }}
  annotations:
  {{- range $key, $value := .Values.secrets.service.annotations }}
    {{ $key }}: {{ $value | quote }}
  {{- end }}
{{- end }}
  labels:
    app: {{ template "drone.name" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
spec:
  type: ClusterIP
  ports:
  - name: http
    port: {{ .Values.secrets.service.httpPort }}
    targetPort: {{ .Values.secrets.httpPort }}
  selector:
    app: {{ template "drone.name" . }}
    release: {{ .Release.Name | quote }}
    component: secrets
{{- end -}}