{{- if .Values.admin.enabled }} apiVersion: v1 kind: Service metadata: name: {{ include "seaweedfs.componentName" (list . "admin") }} namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/name: {{ template "seaweedfs.name" . }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: admin {{- if .Values.admin.service.annotations }} annotations: {{- toYaml .Values.admin.service.annotations | nindent 4 }} {{- end }} spec: {{- $serviceType := .Values.admin.service.type }} {{- $nodePorts := dict }} {{- if or (eq $serviceType "NodePort") (eq $serviceType "LoadBalancer") }} {{- $nodePorts = .Values.admin.service.nodePorts | default dict }} {{- end }} type: {{ $serviceType }} {{- include "seaweedfs.service.loadBalancerFields" .Values.admin.service }} ports: - name: "http" port: {{ .Values.admin.port }} targetPort: {{ .Values.admin.port }} {{- if $nodePorts.http }} nodePort: {{ $nodePorts.http }} {{- end }} protocol: TCP - name: "grpc" port: {{ .Values.admin.grpcPort }} targetPort: {{ .Values.admin.grpcPort }} {{- if $nodePorts.grpc }} nodePort: {{ $nodePorts.grpc }} {{- end }} protocol: TCP selector: app.kubernetes.io/name: {{ template "seaweedfs.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: admin {{- end }}