[VOL-4763] Adding voltha-go-controller and redis helm charts
Change-Id: I21ce624f359989e814c4475cc5e18672fd16c795
diff --git a/redis/templates/redis-slave-svc.yaml b/redis/templates/redis-slave-svc.yaml
new file mode 100644
index 0000000..c56aa1d
--- /dev/null
+++ b/redis/templates/redis-slave-svc.yaml
@@ -0,0 +1,57 @@
+# Copyright 2022-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{- if and .Values.global.redis.cluster.enabled (not .Values.global.redis.sentinel.enabled) }}
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ template "redis.fullname" . }}-slave
+ namespace: {{ .Release.Namespace | quote }}
+ labels:
+ app: {{ template "redis.name" . }}
+ chart: {{ template "redis.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+ {{- if .Values.slave.service.labels -}}
+ {{- toYaml .Values.slave.service.labels | nindent 4 }}
+ {{- end -}}
+{{- if .Values.slave.service.annotations }}
+ annotations: {{- toYaml .Values.slave.service.annotations | nindent 4 }}
+{{- end }}
+spec:
+ type: {{ .Values.slave.service.type }}
+ {{ if eq .Values.slave.service.type "LoadBalancer" }}
+ externalTrafficPolicy: {{ .Values.slave.service.externalTrafficPolicy }}
+ {{- end }}
+ {{- if and (eq .Values.slave.service.type "LoadBalancer") .Values.slave.service.loadBalancerIP }}
+ loadBalancerIP: {{ .Values.slave.service.loadBalancerIP }}
+ {{- end }}
+ {{- if and (eq .Values.slave.service.type "LoadBalancer") .Values.slave.service.loadBalancerSourceRanges }}
+ loadBalancerSourceRanges:
+ {{- with .Values.slave.service.loadBalancerSourceRanges }}
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ {{- end }}
+ ports:
+ - name: redis
+ port: {{ .Values.slave.service.port }}
+ targetPort: redis
+ {{- if .Values.slave.service.nodePort }}
+ nodePort: {{ .Values.slave.service.nodePort }}
+ {{- end }}
+ selector:
+ app: {{ template "redis.name" . }}
+ release: {{ .Release.Name }}
+ role: slave
+{{- end }}