Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
moqui
/
k8s-moqui
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
28893199
authored
2022-10-19 13:56:36 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Proper initContainers for wait-for-pg/wait-for-elasticsearch.
1 parent
3b159690
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
1 deletions
charts/elasticsearch/es_isready
charts/elasticsearch/kustomization.yaml
charts/moqui/kustomization.yaml
charts/postgresql/kustomization.yaml
charts/moqui/pg_isready → charts/postgresql/pg_isready
helmfile.yaml
charts/elasticsearch/es_isready
0 → 100644
View file @
2889319
#!/bin/sh
set
-ex
elasticsearch_timeout
=
${
elasticsearch_timeout
:-
3
}
check_es
()
{
status
=
"
$(
curl -o /dev/null -w
"%{http_code}"
--max-time
${
elasticsearch_timeout
}
-XGET -g -s -k -u
"
${
elasticsearch_user
}
:
${
elasticsearch_password
}
"
"
${
elasticsearch_url
}
"
)
"
if
[
"z
$status
"
=
z200
]
;
then
return
0
fi
return
1
}
while
! check_es;
do
echo
"Waiting for Elasticsearch"
1>&2
sleep 1
count
=
5
while
[
$count
-gt 0
]
&&
! check_es;
do
count
=
$((
$count
-
1
))
sleep 1
done
done
charts/elasticsearch/kustomization.yaml
View file @
2889319
...
...
@@ -4,3 +4,10 @@ kind: Kustomization
resources
:
-
./elasticsearch.yaml
configMapGenerator
:
-
name
:
moqui-elasticsearch-scripts
files
:
-
./es_isready
options
:
disableNameSuffixHash
:
true
...
...
charts/moqui/kustomization.yaml
View file @
2889319
...
...
@@ -7,7 +7,6 @@ resources:
configMapGenerator
:
-
name
:
moqui-scripts
files
:
-
./pg_isready
-
./copy-jdbc-drivers
options
:
disableNameSuffixHash
:
true
...
...
charts/postgresql/kustomization.yaml
View file @
2889319
...
...
@@ -4,3 +4,10 @@ kind: Kustomization
resources
:
-
./postgresql.yaml
configMapGenerator
:
-
name
:
moqui-postgresql-scripts
files
:
-
./pg_isready
options
:
disableNameSuffixHash
:
true
...
...
charts/
moqui
/pg_isready
→
charts/
postgresql
/pg_isready
View file @
2889319
File moved
helmfile.yaml
View file @
2889319
...
...
@@ -51,6 +51,69 @@ releases:
-
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
...
...
Please
register
or
sign in
to post a comment