Sylvain Desbureaux | e44d170 | 2018-05-07 20:39:16 +0200 | [diff] [blame^] | 1 | {{/* |
| 2 | # Copyright © 2018 Orange |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | */}} |
| 16 | |
| 17 | apiVersion: v1 |
| 18 | kind: Service |
| 19 | metadata: |
| 20 | name: {{ include "common.servicename" . }} |
| 21 | namespace: {{ include "common.namespace" . }} |
| 22 | labels: |
| 23 | app: {{ include "common.name" . }} |
| 24 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 25 | release: {{ .Release.Name }} |
| 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
| 28 | ports: |
| 29 | - port: {{ .Values.service.internalPort }} |
| 30 | name: {{ .Values.service.portName }} |
| 31 | selector: |
| 32 | app: {{ include "common.name" . }} |
| 33 | release: {{ .Release.Name }} |
| 34 | clusterIP: None |
| 35 | #{{ if not .Values.disableNfsProvisioner }} |
| 36 | --- |
| 37 | kind: Service |
| 38 | apiVersion: v1 |
| 39 | metadata: |
| 40 | name: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner |
| 41 | namespace: {{ include "common.namespace" . }} |
| 42 | labels: |
| 43 | app: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner |
| 44 | spec: |
| 45 | ports: |
| 46 | - name: nfs |
| 47 | port: {{ .Values.service.nfsPort }} |
| 48 | - name: mountd |
| 49 | port: {{ .Values.service.mountdPort }} |
| 50 | - name: rpcbind |
| 51 | port: {{ .Values.service.rpcbindPort }} |
| 52 | - name: rpcbind-udp |
| 53 | port: {{ .Values.service.rpcbindUdpPort }} |
| 54 | protocol: UDP |
| 55 | selector: |
| 56 | app: {{ .Values.nfsprovisionerPrefix }}-nfs-provisioner |
| 57 | #{{ end }} |
| 58 | --- |
| 59 | # Client service for connecting to any Mongo instance for reads. |
| 60 | apiVersion: v1 |
| 61 | kind: Service |
| 62 | metadata: |
| 63 | name: {{ include "common.servicename" . }}-read |
| 64 | namespace: {{ include "common.namespace" . }} |
| 65 | labels: |
| 66 | app: {{ include "common.name" . }} |
| 67 | spec: |
| 68 | ports: |
| 69 | - port: {{ .Values.service.internalPort }} |
| 70 | name: {{ .Values.service.portName }} |
| 71 | selector: |
| 72 | app: {{ include "common.name" . }} |
| 73 | release: {{ .Release.Name }} |
| 74 | --- |
| 75 | {{ if .Values.geoEnabled }} |
| 76 | apiVersion: v1 |
| 77 | kind: Service |
| 78 | metadata: |
| 79 | name: {{ include "common.servicename" . }}-nodeport |
| 80 | namespace: {{ include "common.namespace" . }} |
| 81 | labels: |
| 82 | statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0 |
| 83 | spec: |
| 84 | ports: |
| 85 | - name: {{ .Values.service.internalPort }} |
| 86 | port: {{ .Values.service.internalPort }} |
| 87 | targetPort: {{ .Values.service.internalPort }} |
| 88 | nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPort1 }} |
| 89 | - name: {{ .Values.xtrabackup.internalPort }} |
| 90 | port: {{ .Values.xtrabackup.internalPort }} |
| 91 | targetPort: {{ .Values.xtrabackup.internalPort }} |
| 92 | nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.externalPort2 }} |
| 93 | type: NodePort |
| 94 | selector: |
| 95 | statefulset.kubernetes.io/pod-name: {{ include "common.fullname" . }}-0 |
| 96 | release: {{ .Release.Name }} |
| 97 | {{ end }} |