apiVersion: v1 kind: Service metadata: name: { { template "fullname" . } } labels: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" annotations: prometheus.io/scrape: "true" prometheus.io/path: "/metrics" prometheus.io/port: { { $v := .Values.config.chihaya.metrics_addr | split ":" } }{ { $v._1 | quote } } spec: type: { { .Values.service.type } } ports: - name: bittorrent-http port: { { $v := .Values.config.chihaya.http.addr | split ":" } }{ { $v._1 } } targetPort: { { $v := .Values.config.chihaya.http.addr | split ":" } }{ { $v._1 } } protocol: TCP - name: bittorrent-udp port: { { $v := .Values.config.chihaya.udp.addr | split ":" } }{ { $v._1 } } targetPort: { { $v := .Values.config.chihaya.udp.addr | split ":" } }{ { $v._1 } } protocol: UDP - name: metrics port: { { $v := .Values.config.chihaya.metrics_addr | split ":" } }{ { $v._1 } } targetPort: { { $v := .Values.config.chihaya.metrics_addr | split ":" } }{ { $v._1 } } protocol: TCP selector: app: { { template "fullname" . } }