54 lines
2.8 KiB
YAML
54 lines
2.8 KiB
YAML
{{- if .Values.controller.metrics.enabled }}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ include "argocd.application-controller" . }}-metrics
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
|
app.kubernetes.io/component: metrics
|
|
app.kubernetes.io/part-of: controller
|
|
{{- if .Values.commonLabels }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if or .Values.commonAnnotations .Values.controller.metrics.service.annotations }}
|
|
annotations:
|
|
{{- if .Values.commonAnnotations }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.controller.metrics.service.annotations }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.controller.metrics.service.annotations "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
spec:
|
|
type: {{ .Values.controller.metrics.service.type }}
|
|
{{- if and .Values.controller.metrics.service.clusterIP (eq .Values.controller.metrics.service.type "ClusterIP") }}
|
|
clusterIP: {{ .Values.controller.metrics.service.clusterIP }}
|
|
{{- end }}
|
|
{{- if (or (eq .Values.controller.metrics.service.type "LoadBalancer") (eq .Values.controller.metrics.service.type "NodePort")) }}
|
|
externalTrafficPolicy: {{ .Values.controller.metrics.service.externalTrafficPolicy | quote }}
|
|
{{- end }}
|
|
{{- if eq .Values.controller.metrics.service.type "LoadBalancer" }}
|
|
loadBalancerSourceRanges: {{ .Values.controller.metrics.service.loadBalancerSourceRanges }}
|
|
{{- end }}
|
|
{{- if (and (eq .Values.controller.metrics.service.type "LoadBalancer") (not (empty .Values.controller.metrics.service.loadBalancerIP))) }}
|
|
loadBalancerIP: {{ .Values.controller.metrics.service.loadBalancerIP }}
|
|
{{- end }}
|
|
{{- if .Values.controller.metrics.service.sessionAffinity }}
|
|
sessionAffinity: {{ .Values.controller.metrics.service.sessionAffinity }}
|
|
{{- end }}
|
|
{{- if .Values.controller.metrics.service.sessionAffinityConfig }}
|
|
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.controller.metrics.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: http-metrics
|
|
port: {{ .Values.controller.metrics.service.port }}
|
|
protocol: TCP
|
|
{{- if (and (or (eq .Values.controller.service.type "NodePort") (eq .Values.controller.service.type "LoadBalancer")) (not (empty .Values.controller.metrics.service.nodePort))) }}
|
|
nodePort: {{ .Values.controller.metrics.service.nodePort }}
|
|
{{- else if eq .Values.controller.metrics.service.type "ClusterIP" }}
|
|
nodePort: null
|
|
{{- end }}
|
|
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
|
app.kubernetes.io/component: controller
|
|
{{- end }}
|