diff --git a/intent_types/postgres/v1alpha1/README.md b/intent_types/postgres/v1alpha1/README.md new file mode 100644 index 0000000..7eb15f8 --- /dev/null +++ b/intent_types/postgres/v1alpha1/README.md @@ -0,0 +1,26 @@ +# PostgreSQL Intent Type + +## Overview + +This intent type is designed to represent a PostgreSQL database configuration within an Infrastructure Catalog. It encapsulates the necessary information for provisioning and managing a PostgreSQL database instance. + +## Fields + +- `metadata`: Contains auxiliary information such as the maintainer, documentation link, labels, name, and description. +- `kind`: Specifies the kind of the resource, in this case, `PostgreSQL`. +- `spec`: Contains detailed information about the PostgreSQL instance including the PostgreSQL version and architecture. +- `disabled`: Indicates if the resource is disabled (`true`) or enabled (`false`) by default. +- `flavor`: Specifies the default implementation details, including the version and name. + +## Specification + +In the `spec` object: +- `version`: Specifies the PostgreSQL version (e.g., `5.7`, `8.0`). +- `configuration_parameters`: A field for specifying PostgreSQL parameters (e.g., `max_connections: "1000"`). +- `encryption`: A field to encrypt the db connection between client and server. +- `replication`: A field to define the type of replication. +- `backup`: A field to define if backup is to be taken and how frequently it is to be done. + +## Example + +See the `sample.json` file for an example instance of this intent type. diff --git a/intent_types/postgres/v1alpha1/intent_type.json b/intent_types/postgres/v1alpha1/intent_type.json new file mode 100644 index 0000000..5f5a5bc --- /dev/null +++ b/intent_types/postgres/v1alpha1/intent_type.json @@ -0,0 +1,6 @@ +{ + "name": "PostgreSQL Database", + "api_version": "v1alpha1", + "description": "An Intent Type for deploying PostgreSql databases, following Kubernetes style version naming." +} + \ No newline at end of file diff --git a/intent_types/postgres/v1alpha1/sample.json b/intent_types/postgres/v1alpha1/sample.json new file mode 100644 index 0000000..d883cd5 --- /dev/null +++ b/intent_types/postgres/v1alpha1/sample.json @@ -0,0 +1,37 @@ +{ + "api_version": "v1alpha1", + "metadata": { + "maintainer": "ishaan@example.com", + "documentation_link": "./README.md", + "labels": { + "owner": "infrastructure@example.com" + }, + "name": "postgres-instance", + "description": "A Postgres database instance." + }, + "kind": "postgreSQL", + "spec": { + "version": "16.1", + "configuration_parameters": { + "max_connections": "1000" + }, + "encryption": { + "enabled": true, + "type": "TLS" + }, + "replication": { + "enabled": true, + "type": "master" + }, + "backup": { + "enabled": true, + "frequency": "monthly" + } + }, + "disabled": false, + "flavor": { + "version": "1.0", + "name": "standard" + }, + "advanced": {} +} \ No newline at end of file diff --git a/intent_types/postgres/v1alpha1/schema.json b/intent_types/postgres/v1alpha1/schema.json new file mode 100644 index 0000000..e439630 --- /dev/null +++ b/intent_types/postgres/v1alpha1/schema.json @@ -0,0 +1,112 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "api_version": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "maintainer": { + "type": "string", + "format": "email" + }, + "documentation_link": { + "type": "string" + }, + "labels": { + "type": "object", + "properties": { + "owner": { + "type": "string", + "format": "email" + } + }, + "required": ["owner"] + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": ["maintainer", "documentation_link", "labels", "name", "description"] + }, + "kind": { + "type": "string" + }, + "spec": { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "configuration_parameters": { + "type": "object", + "additionalProperties": {"type": "string"}, + "description": "Configuration Parameters for PostgresSQL." + }, + "encryption": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "required": ["enabled", "type"] + }, + "replication": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "type": { + "type": "string" + }, + "replica_count": {"type": "integer"} + }, + "required": ["enabled", "type"] + }, + "backup": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "frequency": { + "type": "string" + } + }, + "required": ["enabled", "frequency"] + } + }, + "required": ["version", "configuration_parameters", "encryption", "replication", "backup"] + }, + "disabled": { + "type": "boolean" + }, + "flavor": { + "type": "object", + "properties": { + "version": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": ["version", "name"] + }, + "advanced": { + "type": "object" + } + }, + "required": ["api_version", "metadata", "kind", "spec", "disabled", "flavor"] +} + \ No newline at end of file