kubeasz/manifests/redis-cluster/redis-ha/templates/redis-ha-service.yaml

35 lines
906 B
YAML
Raw Normal View History

2019-01-30 21:23:17 +08:00
apiVersion: v1
kind: Service
metadata:
name: {{ template "redis-ha.fullname" . }}
namespace: {{ .Release.Namespace }}
2019-01-30 21:23:17 +08:00
labels:
{{ include "labels.standard" . | indent 4 }}
{{- 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
{{- 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 }}
app: {{ template "redis-ha.name" . }}