1 ################################################################################
2 # Copyright (c) 2019 AT&T Intellectual Property. #
3 # Copyright (c) 2019 Nokia. #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 {{- $ctx := dict "ctx" . "defaultregistry" .Values.dbaas.image.registry }}
22 name: {{ include "common.statefulsetname.dbaas" . }}-server
23 namespace: {{ include "common.namespace.platform" . }}
25 app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaas" . }}
26 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
27 release: {{ .Release.Name }}
28 heritage: {{ .Release.Service }}
32 app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaas" . }}
33 release: {{ .Release.Name }}
34 serviceName: {{ template "common.servicename.dbaas.tcp" . }}
35 {{- if $.Values.dbaas.enableHighAvailability }}
36 replicas: {{ .Values.dbaas.haReplicas }}
38 replicas: {{ .Values.dbaas.saReplicas }}
40 podManagementPolicy: OrderedReady
46 app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaas" . }}
47 release: {{ .Release.Name }}
49 {{- if $.Values.dbaas.enablePodAntiAffinity }}
52 requiredDuringSchedulingIgnoredDuringExecution:
55 app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaas" . }}
56 release: {{ .Release.Name }}
57 topologyKey: kubernetes.io/hostname
58 preferredDuringSchedulingIgnoredDuringExecution:
63 app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaas" . }}
64 release: {{ .Release.Name }}
65 topologyKey: topology.kubernetes.io/zone
68 {{- $ctx := dict "ctx" . "defaultregistry" .Values.dbaas.image.registry }}
69 - name: {{ include "common.dockerregistry.credential" $ctx }}
70 terminationGracePeriodSeconds: {{ .Values.dbaas.terminationGracePeriodSeconds }}
71 {{- if $.Values.dbaas.enableHighAvailability }}
74 image: {{ include "common.dockerregistry.url" $ctx }}/{{ .Values.dbaas.image.name }}:{{ .Values.dbaas.image.tag }}
75 imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $ctx }}
79 - /readonly-config/init.sh
84 fieldPath: status.podIP
87 mountPath: /readonly-config
92 shareProcessNamespace: true
94 - name: {{ include "common.containername.dbaas" . }}-redis
95 image: {{ include "common.dockerregistry.url" $ctx }}/{{ .Values.dbaas.image.name }}:{{ .Values.dbaas.image.tag }}
96 imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $ctx }}
100 {{- if $.Values.dbaas.enableHighAvailability }}
101 - /data/conf/redis.conf
110 - {{ .Values.dbaas.probeTimeoutCommand }} {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping
111 initialDelaySeconds: 15
118 - {{ .Values.dbaas.probeTimeoutCommand }} {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping
119 initialDelaySeconds: 15
123 containerPort: {{ include "common.serviceport.dbaas.redis" . }}
126 name: {{ include "common.configmapname.dbaas" . }}-appconfig
129 {{- if $.Values.dbaas.enableHighAvailability }}
131 - name: {{ include "common.containername.dbaas" . }}-sentinel
132 image: {{ include "common.dockerregistry.url" $ctx }}/{{ .Values.dbaas.image.name }}:{{ .Values.dbaas.image.tag }}
133 imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $ctx }}
137 - /data/conf/sentinel.conf
144 - {{ .Values.dbaas.probeTimeoutCommand }} {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping
145 initialDelaySeconds: 15
152 - {{ .Values.dbaas.probeTimeoutCommand }} {{ .Values.dbaas.probeTimeout }} redis-cli -p {{ include "common.serviceport.dbaas.redis" . }} ping
153 initialDelaySeconds: 15
157 containerPort: {{ include "common.serviceport.dbaas.sentinel" . }}
160 name: {{ include "common.configmapname.dbaas" . }}-appconfig
170 name: {{ template "common.configmapname.dbaas" . }}-config
171 {{- if $.Values.dbaas.enableHighAvailability }}