jenkins-agent-svc.yaml 1.33 KB
Newer Older
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 32
apiVersion: v1
kind: Service
metadata:
  name: {{ template "jenkins.fullname" . }}-agent
  namespace: {{ template "jenkins.namespace" . }}
  labels:
    "app.kubernetes.io/name": '{{ template "jenkins.name" .}}'
    "helm.sh/chart": "{{ .Chart.Name }}-{{ .Chart.Version }}"
    "app.kubernetes.io/managed-by": "{{ .Release.Service }}"
    "app.kubernetes.io/instance": "{{ .Release.Name }}"
    "app.kubernetes.io/component": "{{ .Values.master.componentName }}"
{{- if .Values.master.slaveListenerServiceAnnotations }}
  annotations:
{{ toYaml .Values.master.slaveListenerServiceAnnotations | indent 4 }}
{{- end }}
spec:
  ports:
    - port: {{ .Values.master.slaveListenerPort }}
      targetPort: {{ .Values.master.slaveListenerPort }}
      {{ if (and (eq .Values.master.slaveListenerServiceType "NodePort") (not (empty .Values.master.slaveListenerPort))) }}
      nodePort: {{.Values.master.slaveListenerPort}}
      {{end}}
      name: slavelistener
  selector:
    "app.kubernetes.io/component": "{{ .Values.master.componentName }}"
    "app.kubernetes.io/instance": "{{ .Release.Name }}"
  type: {{ .Values.master.slaveListenerServiceType }}
  {{  if eq .Values.master.slaveListenerServiceType "LoadBalancer"  }}
  {{  if .Values.master.slaveListenerLoadBalancerIP  }}
  loadBalancerIP: {{  .Values.master.slaveListenerLoadBalancerIP  }}
  {{end}}
  {{end}}