helmfile.yaml
7.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
environments:
{{ .Environment.Name }}:
missingFileHandler: Debug
values:
- environments/default-values.yaml
{{- if ne .Environment.Name "default" }}
- environments/{{ .Environment.Name }}-values.yaml
{{- end }}
---
releases:
- name: {{ .Values.name }}-moqui-elasticsearch
condition: elasticsearch.enabled
chart: charts/elasticsearch
namespace: {{ .Values.namespace }}
values:
- namePrefix: {{ .Values.name }}-
strategicMergePatches:
- apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: {{ .Values.name }}-moqui
namespace: {{ .Values.namespace }}
spec:
version: {{ .Values.elasticsearch.version }}
- apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: {{ .Values.name }}-moqui
namespace: {{ .Values.namespace }}
spec:
count: {{ .Values.elasticsearch.kibana.count }}
version: {{ .Values.elasticsearch.version }}
elasticsearchRef:
name: {{ .Values.name }}-moqui
jsonPatches:
- target:
group: elasticsearch.k8s.elastic.co
version: v1
kind: Elasticsearch
name: {{ .Values.name }}-moqui
namespace: {{ .Values.namespace }}
patch:
- op: replace
path: /spec/nodeSets/0/count
value: {{ .Values.elasticsearch.count }}
- name: {{ .Values.name }}-moqui-postgresql
condition: postgresql.enabled
chart: charts/postgresql
namespace: {{ .Values.namespace }}
values:
- namePrefix: {{ .Values.name }}-
strategicMergePatches:
- apiVersion: acid.zalan.do/v1
kind: postgresql
metadata:
name: {{ .Values.name }}-moqui-postgresql
namespace: {{ .Values.namespace }}
spec:
teamId: {{ .Values.name }}-moqui
volume:
size: {{ .Values.postgresql.volume.size | quote }}
postgresql:
version: {{ .Values.postgresql.version | quote }}
{{- if .Values | get "postgresql.clone.uid" nil }}
clone:
{{ merge .Values.postgresql.clone ( dict "cluster" ( print .Values.name "-moqui-postgresql" ) ) | toYaml | nindent 12 }}
{{- end }}
- name: {{ .Values.name }}-moqui-app
chart: charts/moqui
namespace: {{ .Values.namespace }}
values:
- namePrefix: {{ .Values.name }}-
images:
- name: moqui-app
newName: localhost:31234/moqui-app
newTag: test-latest
- name: moqui-jdbc-drivers
newName: localhost:31234/moqui-jdbc-drivers
newTag: test-latest
jsonPatches:
- target:
group: apps
version: v1
kind: Deployment
name: {{ .Values.name }}-moqui-app
namespace: {{ .Values.namespace }}
patch:
{{- if .Values.postgresql.enabled }}
- op: add
path: /spec/template/spec/volumes/-
value:
name: postgresql-scripts
configMap:
name: {{ .Values.name }}-moqui-postgresql-scripts
defaultMode: 0755
- op: add
path: /spec/template/spec/initContainers/-
value:
name: wait-for-pg
image: registry.opensource.zalan.do/acid/spilo-14:2.1-p6
command: ["/postgresql-scripts/pg_isready"]
volumeMounts:
- name: postgresql-scripts
mountPath: /postgresql-scripts
env:
- name: POSTGRES_HOST
value: {{ .Values.name }}-moqui-postgresql
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: moqui.{{ .Values.name }}-moqui-postgresql.credentials.postgresql.acid.zalan.do
key: username
{{- end }}
{{- if .Values.elasticsearch.enabled }}
- op: add
path: /spec/template/spec/volumes/-
value:
name: elasticsearch-scripts
configMap:
name: {{ .Values.name }}-moqui-elasticsearch-scripts
defaultMode: 0755
- op: add
path: /spec/template/spec/initContainers/-
value:
name: wait-for-elasticsearch
image: localhost:31234/moqui-app:test-latest
command: ["/elasticsearch-scripts/es_isready"]
volumeMounts:
- name: elasticsearch-scripts
mountPath: /elasticsearch-scripts
env:
- name: elasticsearch_url
value: https://{{ .Values.name }}-moqui-es-http:9200
- name: elasticsearch_user
value: elastic
- name: elasticsearch_password
valueFrom:
secretKeyRef:
name: {{ .Values.name }}-moqui-es-elastic-user
key: elastic
{{- end }}
strategicMergePatches:
- apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.name }}-moqui-app
namespace: {{ .Values.namespace }}
labels:
app: {{ .Values.name }}-moqui-app
spec:
selector:
matchLabels:
app: {{ .Values.name }}-moqui-app
template:
metadata:
labels:
app: {{ .Values.name }}-moqui-app
spec:
restartPolicy: Always
securityContext:
runAsUser: 0
runAsGroup: 0
containers:
- name: moqui
env:
{{- if .Values.elasticsearch.enabled }}
- name: elasticsearch_url
value: https://{{ .Values.name }}-moqui-es-http:9200
- name: elasticsearch_user
value: elastic
- name: elasticsearch_password
valueFrom:
secretKeyRef:
name: {{ .Values.name }}-moqui-es-elastic-user
key: elastic
{{- end }}
{{- if .Values.postgresql.enabled }}
- name: entity_ds_db_conf
value: postgres
- name: entity_ds_host
value: {{ .Values.name }}-moqui-postgresql
- name: entity_ds_port
value: "5432"
- name: entity_ds_user
valueFrom:
secretKeyRef:
name: moqui.{{ .Values.name }}-moqui-postgresql.credentials.postgresql.acid.zalan.do
key: username
- name: entity_ds_password
valueFrom:
secretKeyRef:
name: moqui.{{ .Values.name }}-moqui-postgresql.credentials.postgresql.acid.zalan.do
key: password
- name: entity_ds_database
value: moqui
- name: entity_ds_schema
value: public
{{- end }}