Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions intent_types/postgres/v1alpha1/README.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 6 additions & 0 deletions intent_types/postgres/v1alpha1/intent_type.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "PostgreSQL Database",
"api_version": "v1alpha1",
"description": "An Intent Type for deploying PostgreSql databases, following Kubernetes style version naming."
}

37 changes: 37 additions & 0 deletions intent_types/postgres/v1alpha1/sample.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
112 changes: 112 additions & 0 deletions intent_types/postgres/v1alpha1/schema.json
Original file line number Diff line number Diff line change
@@ -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"]
}