github.com/lrills/helm@v2.8.1+incompatible/docs/examples/nginx/templates/service.yaml (about)

     1  apiVersion: v1
     2  kind: Service
     3  metadata:
     4  {{- if .Values.service.annotations }}
     5    annotations:
     6  {{ toYaml .Values.service.annotations | indent 4 }}
     7  {{- end }}
     8    labels:
     9      app: {{ template "nginx.name" . }}
    10      chart: {{ .Chart.Name }}-{{ .Chart.Version }}
    11      heritage: {{ .Release.Service }}
    12      release: {{ .Release.Name }}
    13    name: {{ template "nginx.fullname" . }}
    14  spec:
    15  # Provides options for the service so chart users have the full choice
    16    type: "{{ .Values.service.type }}"
    17    clusterIP: "{{ .Values.service.clusterIP }}"
    18  {{- if .Values.service.externalIPs }}
    19    externalIPs:
    20  {{ toYaml .Values.service.externalIPs | indent 4 }}
    21  {{- end }}
    22  {{- if .Values.service.loadBalancerIP }}
    23    loadBalancerIP: "{{ .Values.service.loadBalancerIP }}"
    24  {{- end }}
    25  {{- if .Values.service.loadBalancerSourceRanges }}
    26    loadBalancerSourceRanges:
    27  {{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
    28  {{- end }}
    29    ports:
    30      - name: http
    31        port: {{ .Values.service.port }}
    32        protocol: TCP
    33        targetPort: http
    34        {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
    35        nodePort: {{ .Values.service.nodePort }}
    36        {{- end }}
    37    selector:
    38      app: {{ template "nginx.name" . }}
    39      release: {{ .Release.Name }}