This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Extract postgresql chart * Apply migrations with DB dump * Apply migrations with DB dump remove commented out code * Introduce separate chart for Local DB * Add test namespace * Create DB Dump apply job that do not use schema migrator * Remove DB Dump handling logic from schema migrator * Fix job hang when no dump * Remove old workarounds * Update README.md review readme text * Address comments * One more place for Documentation update Co-authored-by: nkanchev <44201396+nkanchev@users.noreply.github.com>
- Loading branch information
Showing
39 changed files
with
296 additions
and
55 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
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,22 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
OWNERS |
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,4 @@ | ||
apiVersion: v1 | ||
description: Local DB | ||
name: localdb | ||
version: 0.1.0 |
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,15 @@ | ||
# LocalDB | ||
|
||
## Overview | ||
|
||
LocalDB is used only in a local env scenario to install and apply the DB dump if needed. LocalDB comprises the following sub-charts: | ||
- `postgresql` - installing the PostgreSQL database | ||
- `dbdump` - applying the DB dump | ||
|
||
## Details | ||
|
||
### Configuration | ||
|
||
LocalDB has a standard Helm chart configuration. You can check all available configurations in the chart and sub-charts's `values.yaml` files. | ||
|
||
The values from those files can be overridden during installation. |
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,22 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
OWNERS |
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,4 @@ | ||
apiVersion: v1 | ||
description: DB Dump | ||
name: dbdump | ||
version: 0.1.0 |
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,79 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: compass-dbdump | ||
namespace: {{ $.Release.Namespace }} | ||
labels: | ||
app: {{ .Chart.Name }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Chart.Name }} | ||
release: {{ .Release.Name }} | ||
annotations: | ||
cluster-autoscaler.kubernetes.io/safe-to-evict: "true" | ||
spec: | ||
serviceAccountName: {{ $.Chart.Name }}-dbdump-job | ||
restartPolicy: Never | ||
shareProcessNamespace: true | ||
containers: | ||
- name: dbdump | ||
image: bitnami/postgresql:11.15.0-debian-10-r93 | ||
imagePullPolicy: IfNotPresent | ||
env: | ||
- name: DB_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: compass-postgresql | ||
key: postgresql-director-username | ||
- name: DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: compass-postgresql | ||
key: postgresql-director-password | ||
- name: DB_HOST | ||
valueFrom: | ||
secretKeyRef: | ||
name: compass-postgresql | ||
key: postgresql-serviceName | ||
- name: DB_PORT | ||
valueFrom: | ||
secretKeyRef: | ||
name: compass-postgresql | ||
key: postgresql-servicePort | ||
- name: DB_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: compass-postgresql | ||
key: postgresql-director-db-name | ||
- name: DB_SSL | ||
valueFrom: | ||
secretKeyRef: | ||
name: compass-postgresql | ||
key: postgresql-sslMode | ||
command: | ||
- "/bin/bash" | ||
args: | ||
- "-c" | ||
- "[ -f /dbdata/dump.sql ] && PGPASSWORD=${DB_PASSWORD} psql --username=${DB_USER} --host=${DB_HOST} --port=${DB_PORT} --dbname=${DB_NAME} --single-transaction -f /dbdata/dump.sql --set ON_ERROR_STOP=on --set sslmode=${DB_SSL} || echo 'There is no dump.sql to be applied.' ; exit_code=$?; echo '# KILLING PILOT-AGENT #'; pkill -INT cloud_sql_proxy; curl -XPOST http://127.0.0.1:15020/quitquitquit; sleep 5; exit $exit_code;" | ||
volumeMounts: | ||
- name: dump-folder | ||
mountPath: "/dbdata" | ||
volumes: | ||
- name: dump-folder | ||
persistentVolumeClaim: | ||
claimName: local-pvc | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ $.Chart.Name }}-dbdump-job | ||
namespace: {{ $.Release.Namespace }} | ||
labels: | ||
app: {{ $.Chart.Name }} | ||
release: {{ $.Release.Name }} | ||
helm.sh/chart: {{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }} | ||
app.kubernetes.io/managed-by: {{ $.Release.Service }} | ||
app.kubernetes.io/instance: {{ $.Release.Name }} |
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,35 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: local-pv | ||
namespace: {{ $.Release.Namespace }} | ||
labels: | ||
type: local | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app: {{ .Chart.Name }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
storageClassName: manual | ||
capacity: | ||
storage: 1Gi | ||
accessModes: | ||
- ReadWriteOnce | ||
hostPath: | ||
path: "/dbdata" | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: local-pvc | ||
namespace: {{ $.Release.Namespace }} | ||
labels: | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app: {{ .Chart.Name }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
storageClassName: manual | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,8 @@ | ||
global: | ||
tests: | ||
namespace: kyma-system | ||
database: | ||
embedded: | ||
director: | ||
name: "postgres" | ||
directorDBName: "postgres" |
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
Oops, something went wrong.