Skip to content

Commit

Permalink
Merge pull request #1628 from bhumi46/develop
Browse files Browse the repository at this point in the history
[DSD-7089] updated helm and deploy for helm publish
  • Loading branch information
ckm007 authored Feb 17, 2025
2 parents f34f20e + 1411a6b commit 8b92f24
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 82 deletions.
74 changes: 62 additions & 12 deletions deployment/v3/utils/data-archive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,57 @@ This configuration file is used for setting up database connections and defining
- `archive_dbname`: Archive database name.
- `archive_schemaname`: Archive schema name.
- `archive_db_password`: Password for the archive database.
- `batch_size`: Number of records processed in each batch.



### Database Names

A list of databases to be archived:

```yaml
db_names:
- name: audit
enabled: true
container_volume_path: /audit-table-info ## volume mount path for table info inside cronjob container
- name: ida
enabled: true
container_volume_path: /ida-table-info ## volume mount path for table info inside cronjob container
- name: credential
enabled: true
container_volume_path: /credential-table-info ## volume mount path for table info inside cronjob container
- name: kernel
enabled: true
container_volume_path: /kernek-table-info ## volume mount path for table info inside cronjob container
- name: master
enabled: true
container_volume_path: /master-table-info ## volume mount path for table info inside cronjob container
- name: pms
enabled: false
container_volume_path: /pms-table-info ## volume mount path for table info inside cronjob container
- name: regprc
enabled: false
container_volume_path: /regprc-table-info ## volume mount path for table info inside cronjob container
- name: resident
enabled: false
container_volume_path: /resident-table-info ## volume mount path for table info inside cronjob container
```
Each entry includes a name and an enabled flag to indicate if the database should be included in the archival process.
## Adding Another Database
To add another database to the archival list, follow these steps:
1. Update the `values.yaml` file.

2. Under the `db_names` section, add a new entry with the following format:

```yaml
- name: new_database_name
enabled: true # or false, depending on whether you want to include it
```
3. Replace `new_database_name` with the desired name of the new database.
4. Save the changes to the `values.yaml` file.

### Source Database Connections (source_db)

Expand All @@ -30,7 +81,7 @@ For each source database (audit, credential, esignet, ida, idrepo, kernel, maste
- `source_<database>_schemaname`: Source schema name.
- `source_<database>_db_pass`: Password for the source database.

- `provide_db_names_to_archive`: Comma-separated list of database names to archive (e.g., "AUDIT,CREDENTIAL,IDA,.....").(in CAPS)



## Container Volume Path
Expand All @@ -49,14 +100,13 @@ audit:
date_column: "log_dtimes"
retention_days: 30
operation_type: "archive_delete"

source_table: Name of the table in the source database.
archive_table: Name of the table in the archive database.
id_column: Column representing the unique identifier.
date_column: Column representing the date of the record.
retention_days: Number of days to retain the archived data.
operation_type: Type of operation for archiving (e.g., archive_delete, delete, none).
- Delete: Delete records from the source table.
- Archive and Delete: Archive records to an archive table and then delete them from the source table.
- Archive (No Delete): Archive records to an archive table without deleting them from the source table.
- None: Skip archival for the specified table.
```
`source_table`: Name of the table in the source database.
`archive_table`: Name of the table in the archive database.
`id_column`: Column representing the unique identifier.
`date_column`: Column representing the date of the record.
`retention_days`: Number of days to retain the archived data.
`operation_type`: Type of operation for archiving (e.g., archive_delete, delete, none).
- `delete`: Delete records from the source table.
- `archive_delete`: Archive records to an archive table and then delete them from the source table.
- `none`: Skip archival for the specified table.
11 changes: 5 additions & 6 deletions deployment/v3/utils/data-archive/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ $# -ge 1 ]; then
fi

NS=data-archive
CHART_VERSION=1.0.0
CHART_VERSION=0.0.1-develop

echo Create $NS namespace
kubectl create ns $NS
Expand All @@ -17,12 +17,11 @@ function installing_data-archive() {
helm repo add mosip https://mosip.github.io/mosip-helm
helm repo update

read -p "Is values.yaml for data-archive chart set correctly as part of Pre-requisites?(Y/n) " yn;
if [ "$yn" != "Y" ]; then
echo "ERROR: values.yaml not set correctly; EXITING;";
exit 1;
read -p "Is values.yaml for data-archive chart set correctly as part of Pre-requisites?(Y/n) " yn
if [[ "$yn" != "Y" ]]; then
echo "ERROR: values.yaml not set correctly; EXITING."
exit 1
fi

read -p "Please enter the time(hr) to run the cronjob every day (time: 0-23) : " time
if [ -z "$time" ]; then
echo "ERROR: Time cannot be empty; EXITING;";
Expand Down
Loading

0 comments on commit 8b92f24

Please sign in to comment.