apiVersion: v1 kind: Service metadata: name: {{ include "ls-app.fullname" . }} labels: {{- include "ls-app.labels" . | nindent 4 }} {{- with .Values.app.service.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: type: {{ .Values.app.service.type }} ports: - port: {{ .Values.app.service.port }} targetPort: {{ .Values.app.service.targetPort }} protocol: TCP name: {{ .Values.app.service.portName }} {{- if and .Values.metrics.enabled .Values.metrics.uwsgiExporter.enabled }} - port: 9117 targetPort: "uwsgimetrics" protocol: "TCP" name: "uwsgimetrics" {{- end }} {{- if and .Values.metrics.enabled }} - port: 8000 targetPort: "djangometrics" protocol: "TCP" name: "djangometrics" {{- end }} selector: {{- include "ls-app.selectorLabels" . | nindent 4 }} sessionAffinity: {{ .Values.app.service.sessionAffinity }} {{- if .Values.app.service.sessionAffinityConfig }} sessionAffinityConfig: {{- toYaml .Values.app.service.sessionAffinityConfig | nindent 4 }} {{- end }}