helm-chart/templates/gitea/http-svc.yaml
JPRbrs 729a412803 Allow templated annotations for http-service (#62)
Get http annotations from the right place

Allow templated annotations for http-service

When deploying this to cloud Kubernetes, annotations are useful to add features to the
http-service

Co-authored-by: javier <perezrubio.javier@gmail.com>
Reviewed-on: gitea/helm-chart#62
Reviewed-by: luhahn <luhahn@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-Authored-By: JPRbrs <jprbrs@noreply.gitea.io>
Co-Committed-By: JPRbrs <jprbrs@noreply.gitea.io>
2020-11-20 16:08:26 +08:00

26 lines
826 B
YAML

apiVersion: v1
kind: Service
metadata:
name: {{ include "gitea.fullname" . }}-http
labels:
{{- include "gitea.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.service.http.annotations | nindent 4 }}
spec:
type: {{ .Values.service.http.type }}
{{- if and .Values.service.http.loadBalancerIP (eq .Values.service.http.type "LoadBalancer") }}
loadBalancerIP: {{ .Values.service.http.loadBalancerIP }}
{{- end }}
{{ if eq .Values.service.http.type "ClusterIP" }}
clusterIP: None
{{- end }}
ports:
- name: http
port: {{ .Values.service.http.port }}
{{- if .Values.service.http.nodePort }}
nodePort: {{ .Values.service.http.nodePort }}
{{- end }}
targetPort: {{ .Values.gitea.config.server.HTTP_PORT }}
selector:
{{- include "gitea.selectorLabels" . | nindent 4 }}