github.com/aquasecurity/trivy-iac@v0.8.1-0.20240127024015-3d8e412cf0ab/pkg/scanners/helm/test/mysql/templates/metrics-svc.yaml (about) 1 {{- if .Values.metrics.enabled }} 2 apiVersion: v1 3 kind: Service 4 metadata: 5 name: {{ printf "%s-metrics" (include "common.names.fullname" .) }} 6 namespace: {{ .Release.Namespace }} 7 labels: {{- include "common.labels.standard" . | nindent 4 }} 8 {{- if .Values.commonLabels }} 9 {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 10 {{- end }} 11 app.kubernetes.io/component: metrics 12 {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} 13 annotations: 14 {{- if .Values.metrics.service.annotations }} 15 {{- include "common.tplvalues.render" (dict "value" .Values.metrics.service.annotations "context" $) | nindent 4 }} 16 {{- end }} 17 {{- if .Values.commonAnnotations }} 18 {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 19 {{- end }} 20 {{- end }} 21 spec: 22 type: {{ .Values.metrics.service.type }} 23 ports: 24 - port: {{ .Values.metrics.service.port }} 25 targetPort: metrics 26 protocol: TCP 27 name: metrics 28 selector: {{- include "common.labels.matchLabels" $ | nindent 4 }} 29 {{- end }}