apiVersion: v1 kind: Service metadata: name: {{ include "shadowsocks-rust.fullname" . }} labels: {{- include "shadowsocks-rust.labels" . | nindent 4 }} annotations: {{- range $key, $value := .Values.service.annotations }} {{ $key }}: {{ $value | quote }} {{- end }} spec: type: {{ .Values.service.type }} ports: {{- range $i, $svr := .Values.servers }} - name: {{ include "shadowsocks-rust.portName" $svr }} targetPort: {{ $svr.server_port }} protocol: TCP port: {{ default $svr.server_port $svr.service_port }} {{ end -}} selector: {{- include "shadowsocks-rust.selectorLabels" . | nindent 4 }}