{{- if and .Values.diagnostics.enabled .Values.diagnostics.deployment.enabled .Values.diagnostics.primary.enabled }} {{- if or (not (empty .Values.kubecostModel.federatedStorageConfigSecret )) .Values.kubecostModel.federatedStorageConfig -}} apiVersion: v1 kind: Service metadata: name: {{ template "diagnostics.fullname" . }} namespace: {{ .Release.Namespace }} labels: {{- include "diagnostics.selectorLabels" . | nindent 4 }} spec: ports: - name: diagnostics-api protocol: TCP port: 9007 targetPort: diagnostics-api selector: {{- include "diagnostics.selectorLabels" . | nindent 4 }} type: ClusterIP {{- end }} {{- end }}