aboutsummaryrefslogtreecommitdiff
path: root/grumpy/gitolite/templates/gitolite-svc.yaml
blob: eec57da86b387192320b8d5fea75ab1b0ba53338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
apiVersion: v1
kind: Service
metadata:
  name: {{template "gitolite.fullname" . }}
  labels:
    app: {{ template "gitolite.fullname" . }}
    heritage: {{.Release.Service | quote }}
    release: {{.Release.Name | quote }}
    chart: "{{.Chart.Name}}-{{.Chart.Version}}"
    component: "{{.Release.Name}}-{{.Values.Component}}"
{{- if .Values.ServiceAnnotations }}
  annotations:
{{ toYaml .Values.ServiceAnnotations | indent 4 }}
{{- end }}
spec:
  ports:
    - port: {{.Values.ServicePort}}
      name: http
      targetPort: {{.Values.ContainerPort}}
      {{if (and (eq .Values.ServiceType "NodePort") (not (empty .Values.NodePort)))}}
      nodePort: {{.Values.NodePort}}
      {{end}}
  selector:
    component: "{{.Release.Name}}-{{.Values.Component}}"
  type: {{.Values.ServiceType}}
  {{if eq .Values.ServiceType "LoadBalancer"}}
  loadBalancerSourceRanges: {{.Values.LoadBalancerSourceRanges}}
  {{if .Values.LoadBalancerIP}}
  loadBalancerIP: {{.Values.LoadBalancerIP}}
  {{end}}
  {{end}}