diff --git a/charts/postgresql/Dockerfile b/charts/postgresql/Dockerfile new file mode 100644 index 0000000..753969d --- /dev/null +++ b/charts/postgresql/Dockerfile @@ -0,0 +1,6 @@ +FROM bitnami/postgresql:15.6.0 +USER postgres +WORKDIR /docker-entrypoint-initdb.d +COPY postgres-script.sql . +# RUN chmod -R 777 /var/lib/postgresql/data +# docker run -e POSTGRESQL_PASSWORD=password -u 999999:0 custom-postgresql:v1 \ No newline at end of file diff --git a/charts/postgresql/postgres-script.sql b/charts/postgresql/postgres-script.sql new file mode 100644 index 0000000..dfb5752 --- /dev/null +++ b/charts/postgresql/postgres-script.sql @@ -0,0 +1,8 @@ +CREATE DATABASE openmetadata_db; +CREATE DATABASE airflow_db; +CREATE USER openmetadata_user WITH PASSWORD 'openmetadata_password'; +CREATE USER airflow_user WITH PASSWORD 'airflow_pass'; +ALTER DATABASE openmetadata_db OWNER TO openmetadata_user; +ALTER DATABASE airflow_db OWNER TO airflow_user; +ALTER USER airflow_user SET search_path = public; +commit; \ No newline at end of file diff --git a/mysql-init.yaml b/mysql-init.yaml deleted file mode 100644 index 729a500..0000000 --- a/mysql-init.yaml +++ /dev/null @@ -1,59 +0,0 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: mysql-init-scripts - namespace: a9cb09-dev - uid: 570be9c0-978b-401b-992c-44b3545e7203 - resourceVersion: '1062036183' - creationTimestamp: '2024-03-07T04:12:23Z' - labels: - app.kubernetes.io/component: primary - app.kubernetes.io/instance: openmetadata-dependencies - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: mysql - helm.sh/chart: mysql-9.7.2 - annotations: - meta.helm.sh/release-name: openmetadata-dependencies - meta.helm.sh/release-namespace: a9cb09-dev - managedFields: - - manager: helm - operation: Update - apiVersion: v1 - time: '2024-03-07T04:12:23Z' - fieldsType: FieldsV1 - fieldsV1: - 'f:data': - .: {} - 'f:init_airflow_db_scripts.sql': {} - 'f:init_openmetadata_db_scripts.sql': {} - 'f:metadata': - 'f:annotations': - .: {} - 'f:meta.helm.sh/release-name': {} - 'f:meta.helm.sh/release-namespace': {} - 'f:labels': - .: {} - 'f:app.kubernetes.io/component': {} - 'f:app.kubernetes.io/instance': {} - 'f:app.kubernetes.io/managed-by': {} - 'f:app.kubernetes.io/name': {} - 'f:helm.sh/chart': {} -data: - init_airflow_db_scripts.sql: > - CREATE DATABASE airflow_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; - - CREATE USER 'airflow_user'@'%' IDENTIFIED BY 'airflow_pass'; - - GRANT ALL PRIVILEGES ON airflow_db.* TO 'airflow_user'@'%' WITH GRANT - OPTION; - - commit; - init_openmetadata_db_scripts.sql: > - CREATE DATABASE openmetadata_db; - - CREATE USER 'openmetadata_user'@'%' IDENTIFIED BY 'openmetadata_password'; - - GRANT ALL PRIVILEGES ON openmetadata_db.* TO 'openmetadata_user'@'%' WITH - GRANT OPTION; - - commit; \ No newline at end of file