| {{- $svc := .Values.service }} |
| {{- if $svc.enabled }} |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: {{ template "admin.name" . }} |
| namespace: {{ template "admin.namespace" . }} |
| labels: |
| {{- include "admin.labels" . | nindent 4 }} |
| {{- with $svc.labels }} |
| {{- toYaml . | nindent 4 }} |
| {{- end }} |
| annotations: |
| {{- with $svc.annotations }} |
| {{- toYaml . | nindent 4 }} |
| {{- end }} |
| spec: |
| {{- if $svc.type }} |
| type: {{ $svc.type }} |
| {{- end }} |
| {{- if $svc.clusterIP }} |
| clusterIP: {{ $svc.clusterIP }} |
| {{- end }} |
| {{- if $svc.externalIPs }} |
| externalIPs: {{ $svc.externalIPs }} |
| {{- end }} |
| {{- if $svc.loadBalancerIP }} |
| loadBalancerIP: {{ $svc.loadBalancerIP }} |
| {{- end }} |
| {{- if $svc.loadBalancerSourceRanges }} |
| loadBalancerSourceRanges: {{ $svc.loadBalancerSourceRanges }} |
| {{- end }} |
| {{- if $svc.loadBalancerClass }} |
| loadBalancerClass: {{ $svc.loadBalancerClass }} |
| {{- end }} |
| ports: |
| - name: http |
| port: {{ template "admin.port" . }} |
| protocol: {{ $svc.protocol }} |
| targetPort: http |
| appProtocol: http |
| selector: |
| app: {{ template "admin.selector" . }} |
| {{- end }} |
| --- |
| {{- if $svc.enabled }} |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: {{ include "admin.name" . }}-headless |
| namespace: {{ include "admin.namespace" . }} |
| labels: |
| {{- include "admin.labels" . | nindent 4 }} |
| {{- with $svc.labels }} |
| {{- toYaml . | nindent 4 }} |
| {{- end }} |
| annotations: |
| {{- with $svc.annotations }} |
| {{- toYaml . | nindent 4 }} |
| {{- end }} |
| spec: |
| {{- if $svc.type }} |
| type: {{ $svc.type }} |
| {{- end }} |
| clusterIP: None |
| {{- if $svc.externalIPs }} |
| externalIPs: {{ $svc.externalIPs }} |
| {{- end }} |
| {{- if $svc.loadBalancerIP }} |
| loadBalancerIP: {{ $svc.loadBalancerIP }} |
| {{- end }} |
| {{- if $svc.loadBalancerSourceRanges }} |
| loadBalancerSourceRanges: {{ $svc.loadBalancerSourceRanges }} |
| {{- end }} |
| {{- if $svc.loadBalancerClass }} |
| loadBalancerClass: {{ $svc.loadBalancerClass }} |
| {{- end }} |
| {{- if $svc.sessionAffinity }} |
| sessionAffinity: {{ $svc.sessionAffinity }} |
| {{- end }} |
| {{- if $svc.publishNotReadyAddresses }} |
| publishNotReadyAddresses: {{ $svc.publishNotReadyAddresses }} |
| {{- end }} |
| ports: |
| - name: http |
| port: {{ template "admin.port" . }} |
| protocol: {{ $svc.protocol }} |
| targetPort: http |
| appProtocol: http |
| selector: |
| app: {{ template "admin.selector" . }} |
| {{- end -}} |