2019-01-30 21:23:17 +08:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: {{ template "redis-ha.fullname" . }}
|
2020-05-28 21:06:43 +08:00
|
|
|
namespace: {{ .Release.Namespace }}
|
2019-01-30 21:23:17 +08:00
|
|
|
labels:
|
|
|
|
{{ include "labels.standard" . | indent 4 }}
|
2020-05-28 21:06:43 +08:00
|
|
|
{{- if and ( .Values.exporter.enabled ) ( .Values.exporter.serviceMonitor.enabled ) }}
|
|
|
|
servicemonitor: enabled
|
|
|
|
{{- end }}
|
2019-01-30 21:23:17 +08:00
|
|
|
annotations:
|
|
|
|
{{- if .Values.serviceAnnotations }}
|
|
|
|
{{ toYaml .Values.serviceAnnotations | indent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
spec:
|
|
|
|
type: ClusterIP
|
|
|
|
clusterIP: None
|
|
|
|
ports:
|
|
|
|
- name: server
|
|
|
|
port: {{ .Values.redis.port }}
|
|
|
|
protocol: TCP
|
|
|
|
targetPort: redis
|
|
|
|
- name: sentinel
|
|
|
|
port: {{ .Values.sentinel.port }}
|
|
|
|
protocol: TCP
|
|
|
|
targetPort: sentinel
|
2020-05-28 21:06:43 +08:00
|
|
|
{{- if .Values.exporter.enabled }}
|
|
|
|
- name: exporter-port
|
|
|
|
port: {{ .Values.exporter.port }}
|
|
|
|
protocol: TCP
|
|
|
|
targetPort: exporter-port
|
|
|
|
{{- end }}
|
2019-01-30 21:23:17 +08:00
|
|
|
selector:
|
|
|
|
release: {{ .Release.Name }}
|
2020-05-28 21:06:43 +08:00
|
|
|
app: {{ template "redis-ha.name" . }}
|