@@ -41,186 +41,30 @@ spec:
4141 loadBalancerIP : " {{ .Values.yugaware.service.ip }}"
4242 {{- end }}
4343{{- end }}
44+ {{- if .Values.postgres.service.enabled }}
4445---
45- apiVersion : apps/ v1
46- kind : StatefulSet
46+ apiVersion : v1
47+ kind : Service
4748metadata :
48- name : {{ .Release.Name }}-yugaware
49+ name : {{ .Release.Name }}-postgres
50+ {{- if .Values.postgres.service.annotations }}
51+ annotations :
52+ {{ toYaml .Values.postgres.service.annotations | indent 4 }}
53+ {{- end }}
4954 labels :
5055 app : {{ .Release.Name }}-yugaware
5156 chart : {{ template "yugaware.chart" . }}
5257 release : {{ .Release.Name }}
5358 heritage : {{ .Values.helm2Legacy | ternary "Tiller" (.Release.Service | quote) }}
5459spec :
55- serviceName : {{ .Release.Name }}-yugaware
56- replicas : {{ .Values.yugaware.replicas }}
60+ ports :
61+ - name : postgres
62+ port : 5432
63+ targetPort : 5432
5764 selector :
58- matchLabels :
59- app : {{ .Release.Name }}-yugaware
60- template :
61- metadata :
62- labels :
63- app : {{ .Release.Name }}-yugaware
64- spec :
65- serviceAccountName : {{ .Release.Name }}
66- imagePullSecrets :
67- - name : {{ .Values.image.pullSecret }}
68- {{- if .Values.securityContext.enabled }}
69- securityContext :
70- fsGroup : {{ .Values.securityContext.fsGroup }}
71- {{- end }}
72- volumes :
73- - name : yugaware-storage
74- persistentVolumeClaim :
75- claimName : {{ .Release.Name }}-yugaware-storage
76- - name : yugaware-ui
77- emptyDir : {}
78- - name : yugaware-config
79- configMap :
80- name : {{ .Release.Name }}-yugaware-app-config
81- items :
82- - key : application.docker.conf
83- path : application.docker.conf
84- - name : nginx-config
85- configMap :
86- name : {{ .Release.Name }}-yugaware-nginx-config
87- items :
88- - key : default.conf
89- path : default.conf
90- - name : prometheus-config
91- configMap :
92- name : {{ .Release.Name }}-yugaware-prometheus-config
93- items :
94- - key : prometheus.yml
95- path : prometheus.yml
96-
97- {{- if .Values.tls.enabled }}
98- - name : {{ .Release.Name }}-yugaware-tls-cert
99- secret :
100- secretName : {{ .Release.Name }}-yugaware-tls-cert
101- {{- end }}
102- containers :
103- - image : {{ include "full_image" (dict "containerName" "postgres" "root" .) }}
104- name : postgres
105- env :
106- - name : POSTGRES_USER
107- valueFrom :
108- configMapKeyRef :
109- name : {{ .Release.Name }}-yugaware-global-config
110- key : postgres_user
111- - name : POSTGRES_PASSWORD
112- valueFrom :
113- configMapKeyRef :
114- name : {{ .Release.Name }}-yugaware-global-config
115- key : postgres_password
116- - name : POSTGRES_DB
117- valueFrom :
118- configMapKeyRef :
119- name : {{ .Release.Name }}-yugaware-global-config
120- key : postgres_db
121- - name : PGDATA
122- value : /var/lib/postgresql/data/pgdata
123- ports :
124- - containerPort : 5432
125- name : postgres
126- volumeMounts :
127- - name : yugaware-storage
128- mountPath : /var/lib/postgresql/data
129- subPath : postgres_data
130- - name : prometheus
131- image : {{ include "full_image" (dict "containerName" "prometheus" "root" .) }}
132- {{- if (not .Values.ocpCompatibility.enabled) }}
133- securityContext :
134- runAsUser : 0
135- {{- end }}
136- volumeMounts :
137- - name : yugaware-storage
138- mountPath : /prometheus_configs
139- subPath : prometheus.yml
140- - name : yugaware-storage
141- mountPath : /prometheus/
142- - name : yugaware-storage
143- mountPath : /opt/yugabyte/prometheus/targets
144- subPath : swamper_targets
145- args :
146- - --config.file=/prometheus_configs/prometheus.yml
147- - --storage.tsdb.path=/prometheus/
148- - --web.enable-admin-api
149- - --web.enable-lifecycle
150- ports :
151- - containerPort : 9090
152- - name : yugaware
153- image : {{ include "full_yugaware_image" . }}
154- {{- if .Values.securityContext.enabled }}
155- securityContext :
156- runAsUser : {{ .Values.securityContext.runAsUser }}
157- {{- end }}
158- imagePullPolicy : {{ .Values.image.pullPolicy }}
159- {{- if .Values.yugaware.resources }}
160- resources :
161- {{ toYaml .Values.yugaware.resources | indent 12 }}
162- {{- end }}
163- command : [ "/bin/bash", "-c"]
164- args :
165- - " cp /default_prometheus_config/prometheus.yml /prometheus_configs/prometheus.yml && bin/yugaware -Dconfig.file=/data/application.docker.conf"
166- env :
167- - name : POSTGRES_USER
168- valueFrom :
169- configMapKeyRef :
170- name : {{ .Release.Name }}-yugaware-global-config
171- key : postgres_user
172- - name : POSTGRES_PASSWORD
173- valueFrom :
174- configMapKeyRef :
175- name : {{ .Release.Name }}-yugaware-global-config
176- key : postgres_password
177- - name : POSTGRES_DB
178- valueFrom :
179- configMapKeyRef :
180- name : {{ .Release.Name }}-yugaware-global-config
181- key : postgres_db
182- - name : APP_SECRET
183- valueFrom :
184- configMapKeyRef :
185- name : {{ .Release.Name }}-yugaware-global-config
186- key : app_secret
187- ports :
188- - containerPort : 9000
189- name : yugaware
190- volumeMounts :
191- - name : yugaware-config
192- mountPath : /data
193- - name : yugaware-storage
194- mountPath : /opt/yugabyte/yugaware/data/
195- subPath : data
196- # old path for backward compatibility
197- - name : yugaware-storage
198- mountPath : /opt/yugaware_data/
199- subPath : data
200- - name : yugaware-storage
201- mountPath : /opt/yugabyte/releases/
202- subPath : releases
203- # old path for backward compatibility
204- - name : yugaware-storage
205- mountPath : /opt/releases/
206- subPath : releases
207- - name : yugaware-storage
208- mountPath : /opt/yugabyte/prometheus/targets
209- subPath : swamper_targets
210- - name : prometheus-config
211- mountPath : /default_prometheus_config
212- - name : yugaware-storage
213- mountPath : /prometheus_configs
214- subPath : prometheus.yml
215- - name : nginx
216- image : {{ include "full_image" (dict "containerName" "nginx" "root" .) }}
217- ports :
218- - containerPort : 8080
219- volumeMounts :
220- - mountPath : /etc/nginx/conf.d/
221- name : nginx-config
222- {{- if .Values.tls.enabled }}
223- - name : {{ .Release.Name }}-yugaware-tls-cert
224- mountPath : /opt/certs/
225- readOnly : true
226- {{- end }}
65+ app : {{ .Release.Name }}-yugaware
66+ type : {{ .Values.postgres.service.type }}
67+ {{- if and (eq .Values.postgres.service.type "LoadBalancer") (.Values.postgres.service.ip) }}
68+ loadBalancerIP : " {{ .Values.postgres.service.ip }}"
69+ {{- end }}
70+ {{- end }}
0 commit comments