-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c86f25
commit 77fe110
Showing
11 changed files
with
201 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
dependencies: | ||
- name: postgresql | ||
repository: https://charts.jfrog.io/ | ||
version: 10.3.18 | ||
version: 15.5.20 | ||
- name: rabbitmq | ||
repository: https://charts.jfrog.io/ | ||
version: 11.9.3 | ||
digest: sha256:07d819a08ebaae2057071eb70bad38ad8209bd611c73d906e3313cd5c20806d1 | ||
generated: "2023-02-20T19:44:20.844286+05:30" | ||
version: 14.6.6 | ||
- name: catalog | ||
repository: https://charts.jfrog.io/ | ||
version: 101.7.3 | ||
digest: sha256:64d23e13fb197b92e3c3dfe7497a933c87656b575182485b4d28ca8a0b5967ca | ||
generated: "2024-12-02T15:25:33.588122+05:30" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{{- if and .Values.catalog.createCatalogDb.enabled .Values.catalog.enabled .Values.postgresql.enabled -}} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
labels: | ||
app: {{ template "xray.name" . }} | ||
chart: {{ template "xray.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "xray.fullname" . }}-catalog-create-db | ||
annotations: | ||
"helm.sh/hook": "post-upgrade,post-install" | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "xray.name" . }} | ||
chart: {{ template "xray.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
{{- if .Values.podSecurityContext.enabled }} | ||
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} | ||
{{- end }} | ||
{{- if or .Values.imagePullSecrets .Values.global.imagePullSecrets }} | ||
{{- include "xray.imagePullSecrets" . | indent 6 }} | ||
{{- end }} | ||
serviceAccountName: {{ template "xray.serviceAccountName" . }} | ||
restartPolicy: OnFailure | ||
terminationGracePeriodSeconds: 0 | ||
containers: | ||
- name: catalog-create-db | ||
image: {{ .Values.catalog.createCatalogDb.image }} | ||
imagePullPolicy: IfNotPresent | ||
{{- if .Values.containerSecurityContext.enabled }} | ||
securityContext: | ||
{{- toYaml (omit .Values.containerSecurityContext "enabled") | nindent 12 }} | ||
{{- end }} | ||
{{- if .Values.initContainers.resources }} | ||
resources: {{- toYaml .Values.initContainers.resources | nindent 12 }} | ||
{{- end }} | ||
command: | ||
- 'bash' | ||
- '-c' | ||
- | | ||
echo "Waiting for postgresql to come up" | ||
ready=false; | ||
while ! $ready; do echo waiting; | ||
timeout 2s bash -c "</dev/tcp/{{ .Release.Name }}-postgresql/{{ .Values.postgresql.primary.service.ports.postgresql }}"; exit_status=$?; | ||
if [[ $exit_status -eq 0 ]]; then ready=true; echo "database ok"; fi; sleep 1; | ||
done; | ||
psql "postgres://{{ .Values.catalog.database.user }}:${PGPASSWORD}@{{ .Release.Name }}-postgresql:5432/catalogdb?sslmode=disable" -c "\q" 2>/dev/null | ||
exit_status=$? | ||
if [[ $exit_status -eq 0 ]]; then | ||
ready=true | ||
echo "catalogdb database is available" | ||
exit 0 | ||
fi | ||
psql -h {{ .Release.Name }}-postgresql --username "{{ .Values.postgresql.auth.username }}" -d {{ .Values.postgresql.auth.database }} -c "CREATE DATABASE catalogdb;" -c "GRANT ALL PRIVILEGES ON DATABASE catalogdb TO {{ .Values.postgresql.auth.username }};" | ||
env: | ||
- name: PGPASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: "{{ .Release.Name }}-postgresql" | ||
key: password | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if .Values.postgresql.enabled }} | ||
{{- if .Values.postgresql.postgresqlPassword }} | ||
{{- fail "\n\nThe key 'postgresql.postgresqlPassword' is not supported in the latest packaged version of Postgres in this chart.\nUse the new key 'postgresql.auth.postgresPassword' to proceed with installation.\n" }} | ||
{{- end }} | ||
{{- if .Values.postgresql.postgresqlExtendedConf }} | ||
{{- fail "\n\nThe key 'postgresql.postgresqlExtendedConf' is not supported in the latest packaged version of postgres in this chart.\nUse the new key 'postgresql.primary.extendedConfiguration' to proceed with installation.\n" }} | ||
{{- end }} | ||
{{- if .Values.global.postgresqlPassword }} | ||
{{- fail "\n\nThe key 'global.postgresqlPassword' is not supported in the latest packaged version of postgres in this chart.\nUse the new key 'global.auth.postgresPassword' to proceed with installation.\n" }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters