helm-charts/nextcloud/charts/mariadb/templates/master-svc.yaml
2021-01-17 04:09:41 +03:00

48 lines
1.3 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: {{ template "mariadb.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
app: "{{ template "mariadb.name" . }}"
component: "master"
chart: "{{ template "mariadb.chart" . }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
{{- if or .Values.metrics.enabled .Values.master.service.annotations }}
annotations:
{{- if .Values.metrics.enabled }}
{{ toYaml .Values.metrics.annotations | indent 4 }}
{{- end }}
{{- if .Values.master.service.annotations }}
{{ toYaml .Values.master.service.annotations | indent 4 }}
{{- end }}
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- if eq .Values.service.type "ClusterIP" }}
{{- if .Values.service.clusterIp }}
clusterIP: {{ .Values.service.clusterIp.master }}
{{- end }}
{{- end }}
ports:
- name: mysql
port: {{ .Values.service.port }}
targetPort: mysql
{{- if eq .Values.service.type "NodePort" }}
{{- if .Values.service.nodePort }}
{{- if .Values.service.nodePort.master }}
nodePort: {{ .Values.service.nodePort.master }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.metrics.enabled }}
- name: metrics
port: 9104
targetPort: metrics
{{- end }}
selector:
app: "{{ template "mariadb.name" . }}"
component: "master"
release: "{{ .Release.Name }}"