--- apiVersion: v1 kind: Service metadata: name: "{{ .Values.name }}-service" namespace: {{ .Values.namespace }} spec: {{- if eq .Values.service.type "NodePort" }} type: NodePort {{- else if eq .Values.service.type "LoadBalancer" }} type: LoadBalancer {{- end }} selector: app: {{ .Values.name }} ports: - protocol: TCP targetPort: 6767 {{- if eq .Values.service.type "NodePort" }} nodePort: {{ .Values.service.nodePort }} {{- else if eq .Values.service.type "LoadBalancer" }} port: {{ .Values.service.port }} {{- end }}