-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Role for auditing-timescaledb. (#310)
- Loading branch information
Showing
9 changed files
with
165 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# auditing-timescaledb | ||
|
||
This role provides a database for the metal-api that can be used for storing audit traces. The auditing feature has to be explicitly enabled in the metal-api in order to make use of this database. | ||
|
||
This role just wraps the [postgres-backup-restore](/control-plane/roles/postgres-backup-restore) role. Refer to this role for further documentation. | ||
|
||
## Variables | ||
|
||
The role should take the same variables as the wrapped role, but prefixed with `auditing_timescaledb_` instead of `postgres_`. |
1 change: 1 addition & 0 deletions
1
control-plane/roles/auditing-timescaledb/defaults/main/control-plane-defaults
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 @@ | ||
../../../../control-plane-defaults/ |
1 change: 1 addition & 0 deletions
1
control-plane/roles/auditing-timescaledb/defaults/main/global-defaults
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 @@ | ||
../../../../../defaults |
44 changes: 44 additions & 0 deletions
44
control-plane/roles/auditing-timescaledb/defaults/main/main.yaml
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,44 @@ | ||
--- | ||
auditing_timescaledb_name: auditing-timescaledb | ||
auditing_timescaledb_namespace: "{{ metal_control_plane_namespace }}" | ||
|
||
auditing_timescaledb_image_pull_policy: "{{ metal_control_plane_image_pull_policy }}" | ||
|
||
auditing_timescaledb_storage_size: 10Gi | ||
auditing_timescaledb_storage_class: | ||
auditing_timescaledb_db: auditing | ||
auditing_timescaledb_user: postgres | ||
auditing_timescaledb_password: change-me | ||
auditing_timescaledb_max_connections: 100 | ||
|
||
auditing_timescaledb_shared_libraries_preload: | ||
- pg_stat_statements | ||
- timescaledb | ||
|
||
auditing_timescaledb_backup_restore_sidecar_image_pull_policy: "{{ metal_control_plane_image_pull_policy }}" | ||
auditing_timescaledb_backup_restore_sidecar_provider: local | ||
auditing_timescaledb_backup_restore_sidecar_backup_cron_schedule: "0 * * * *" | ||
auditing_timescaledb_backup_restore_sidecar_log_level: debug | ||
auditing_timescaledb_backup_restore_sidecar_object_prefix: "{{ auditing_timescaledb_name }}-{{ metal_control_plane_stage_name }}" | ||
auditing_timescaledb_backup_restore_sidecar_object_max_keep: | ||
|
||
auditing_timescaledb_backup_restore_sidecar_gcp_bucket_name: | ||
auditing_timescaledb_backup_restore_sidecar_gcp_backup_location: | ||
auditing_timescaledb_backup_restore_sidecar_gcp_project_id: | ||
auditing_timescaledb_backup_restore_sidecar_gcp_serviceaccount_json: | ||
|
||
auditing_timescaledb_resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "500m" | ||
limits: | ||
memory: "1Gi" | ||
cpu: "1" | ||
|
||
auditing_timescaledb_registry_auth_enabled: "{{ metal_registry_auth_enabled }}" | ||
auditing_timescaledb_registry_auth: | ||
auths: | ||
https://index.docker.io/v1/: | ||
username: "{{ metal_registry_auth_user }}" | ||
password: "{{ metal_registry_auth_password }}" | ||
auth: "{{ (metal_registry_auth_user + ':' + metal_registry_auth_password) | b64encode }}" |
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,55 @@ | ||
--- | ||
- name: Gather release versions | ||
setup_yaml: | ||
|
||
- name: Check mandatory variables for this role are set | ||
assert: | ||
fail_msg: "not all mandatory variables given, check role documentation" | ||
quiet: yes | ||
that: | ||
- auditing_timescaledb_image_name is defined | ||
- auditing_timescaledb_image_tag is defined | ||
- auditing_timescaledb_backup_restore_sidecar_image_name is defined | ||
- auditing_timescaledb_backup_restore_sidecar_image_tag is defined | ||
|
||
- name: Create namespace | ||
k8s: | ||
definition: | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: "{{ auditing_timescaledb_namespace }}" | ||
labels: | ||
name: "{{ auditing_timescaledb_namespace }}" | ||
|
||
- name: Deploy auditing timescale db | ||
include_role: | ||
name: metal-roles/control-plane/roles/postgres-backup-restore | ||
vars: | ||
postgres_name: "{{ auditing_timescaledb_name }}" | ||
postgres_namespace: "{{ auditing_timescaledb_namespace }}" | ||
postgres_image_pull_policy: "{{ auditing_timescaledb_image_pull_policy }}" | ||
postgres_image_name: "{{ auditing_timescaledb_image_name }}" | ||
postgres_image_tag: "{{ auditing_timescaledb_image_tag }}" | ||
postgres_registry_auth_enabled: "{{ auditing_timescaledb_registry_auth_enabled }}" | ||
postgres_registry_auth: "{{ auditing_timescaledb_registry_auth }}" | ||
postgres_storage_size: "{{ auditing_timescaledb_storage_size }}" | ||
postgres_storage_class: "{{ auditing_timescaledb_storage_class }}" | ||
postgres_db: "{{ auditing_timescaledb_db }}" | ||
postgres_user: "{{ auditing_timescaledb_user }}" | ||
postgres_password: "{{ auditing_timescaledb_password }}" | ||
postgres_max_connections: "{{ auditing_timescaledb_max_connections }}" | ||
postgres_shared_libraries_preload: "{{ auditing_timescaledb_shared_libraries_preload }}" | ||
postgres_backup_restore_sidecar_image_pull_policy: "{{ auditing_timescaledb_backup_restore_sidecar_image_pull_policy }}" | ||
postgres_backup_restore_sidecar_image_name: "{{ auditing_timescaledb_backup_restore_sidecar_image_name }}" | ||
postgres_backup_restore_sidecar_image_tag: "{{ auditing_timescaledb_backup_restore_sidecar_image_tag }}" | ||
postgres_backup_restore_sidecar_provider: "{{ auditing_timescaledb_backup_restore_sidecar_provider }}" | ||
postgres_backup_restore_sidecar_backup_cron_schedule: "{{ auditing_timescaledb_backup_restore_sidecar_backup_cron_schedule }}" | ||
postgres_backup_restore_sidecar_log_level: "{{ auditing_timescaledb_backup_restore_sidecar_log_level }}" | ||
postgres_backup_restore_sidecar_object_prefix: "{{ auditing_timescaledb_backup_restore_sidecar_object_prefix }}" | ||
postgres_backup_restore_sidecar_gcp_bucket_name: "{{ auditing_timescaledb_backup_restore_sidecar_gcp_bucket_name }}" | ||
postgres_backup_restore_sidecar_gcp_backup_location: "{{ auditing_timescaledb_backup_restore_sidecar_gcp_backup_location }}" | ||
postgres_backup_restore_sidecar_gcp_project_id: "{{ auditing_timescaledb_backup_restore_sidecar_gcp_project_id }}" | ||
postgres_backup_restore_sidecar_gcp_serviceaccount_json: "{{ auditing_timescaledb_backup_restore_sidecar_gcp_serviceaccount_json }}" | ||
postgres_resources: "{{ auditing_timescaledb_resources }}" | ||
postgres_backup_restore_sidecar_object_max_keep: "{{ auditing_timescaledb_backup_restore_sidecar_object_max_keep }}" |
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