feat(ci): add CRD schema generation for kubeconform validation

Add scripts to extract OpenAPI v3 schemas from CRD definitions in all
kustomize overlays and write JSON schema files to ci/crd-schemas/ for
kubeconform validation. This allows kubeconform to validate CRD instances
(Elasticsearch, Kibana, CNPG Cluster, VictoriaMetrics, etc.) instead of
skipping or erroring on them.

- ci/generate-crd-schemas.py: extracts schemas from CRD YAML on stdin
- ci/generate-crd-schemas.sh: iterates overlays, pipes to Python script
- ci/validate-apps.sh, ci/validate-clusters.sh: add local schema-location fallback
- Makefile: add generate-schemas target
- ci/crd-schemas/: 67 generated schemas (cert-manager, cnpg, elastic, victoriametrics, argocd, gateway)
- .pre-commit-config.yaml: raise large-file limit to 2 MB for generated schemas

Run `make generate-schemas` to regenerate after CRD version changes.
This commit is contained in:
2026-05-30 23:09:34 +10:00
parent 1b781e0885
commit d21d9a92d3
73 changed files with 87982 additions and 1 deletions
@@ -0,0 +1,464 @@
{
"$schema": "http://json-schema.org/schema#",
"description": "A Backup resource is a request for a PostgreSQL backup by the user.",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"description": "Specification of the desired behavior of the backup.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
"properties": {
"cluster": {
"description": "The cluster to backup",
"properties": {
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"method": {
"default": "barmanObjectStore",
"description": "The backup method to be used, possible options are `barmanObjectStore`,\n`volumeSnapshot` or `plugin`. Defaults to: `barmanObjectStore`.",
"enum": [
"barmanObjectStore",
"volumeSnapshot",
"plugin"
],
"type": "string"
},
"online": {
"description": "Whether the default type of backup with volume snapshots is\nonline/hot (`true`, default) or offline/cold (`false`)\nOverrides the default setting specified in the cluster field '.spec.backup.volumeSnapshot.online'",
"type": "boolean"
},
"onlineConfiguration": {
"description": "Configuration parameters to control the online/hot backup with volume snapshots\nOverrides the default settings specified in the cluster '.backup.volumeSnapshot.onlineConfiguration' stanza",
"properties": {
"immediateCheckpoint": {
"description": "Control whether the I/O workload for the backup initial checkpoint will\nbe limited, according to the `checkpoint_completion_target` setting on\nthe PostgreSQL server. If set to true, an immediate checkpoint will be\nused, meaning PostgreSQL will complete the checkpoint as soon as\npossible. `false` by default.",
"type": "boolean"
},
"waitForArchive": {
"default": true,
"description": "If false, the function will return immediately after the backup is completed,\nwithout waiting for WAL to be archived.\nThis behavior is only useful with backup software that independently monitors WAL archiving.\nOtherwise, WAL required to make the backup consistent might be missing and make the backup useless.\nBy default, or when this parameter is true, pg_backup_stop will wait for WAL to be archived when archiving is\nenabled.\nOn a standby, this means that it will wait only when archive_mode = always.\nIf write activity on the primary is low, it may be useful to run pg_switch_wal on the primary in order to trigger\nan immediate segment switch.",
"type": "boolean"
}
},
"type": "object"
},
"pluginConfiguration": {
"description": "Configuration parameters passed to the plugin managing this backup",
"properties": {
"name": {
"description": "Name is the name of the plugin managing this backup",
"type": "string"
},
"parameters": {
"additionalProperties": {
"type": "string"
},
"description": "Parameters are the configuration parameters passed to the backup\nplugin for this backup",
"type": "object"
}
},
"required": [
"name"
],
"type": "object"
},
"target": {
"description": "The policy to decide which instance should perform this backup. If empty,\nit defaults to `cluster.spec.backup.target`.\nAvailable options are empty string, `primary` and `prefer-standby`.\n`primary` to have backups run always on primary instances,\n`prefer-standby` to have backups run preferably on the most updated\nstandby, if available.",
"enum": [
"primary",
"prefer-standby"
],
"type": "string"
}
},
"required": [
"cluster"
],
"type": "object",
"x-kubernetes-validations": [
{
"message": "BackupSpec is immutable once set",
"rule": "oldSelf == self"
}
]
},
"status": {
"description": "Most recently observed status of the backup. This data may not be up to\ndate. Populated by the system. Read-only.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
"properties": {
"azureCredentials": {
"description": "The credentials to use to upload data to Azure Blob Storage",
"properties": {
"connectionString": {
"description": "The connection string to be used",
"properties": {
"key": {
"description": "The key to select",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
},
"inheritFromAzureAD": {
"description": "Use the Azure AD based authentication without providing explicitly the keys.",
"type": "boolean"
},
"storageAccount": {
"description": "The storage account where to upload data",
"properties": {
"key": {
"description": "The key to select",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
},
"storageKey": {
"description": "The storage account key to be used in conjunction\nwith the storage account name",
"properties": {
"key": {
"description": "The key to select",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
},
"storageSasToken": {
"description": "A shared-access-signature to be used in conjunction with\nthe storage account name",
"properties": {
"key": {
"description": "The key to select",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
}
},
"type": "object"
},
"backupId": {
"description": "The ID of the Barman backup",
"type": "string"
},
"backupLabelFile": {
"description": "Backup label file content as returned by Postgres in case of online (hot) backups",
"format": "byte",
"type": "string"
},
"backupName": {
"description": "The Name of the Barman backup",
"type": "string"
},
"beginLSN": {
"description": "The starting xlog",
"type": "string"
},
"beginWal": {
"description": "The starting WAL",
"type": "string"
},
"commandError": {
"description": "The backup command output in case of error",
"type": "string"
},
"commandOutput": {
"description": "Unused. Retained for compatibility with old versions.",
"type": "string"
},
"destinationPath": {
"description": "The path where to store the backup (i.e. s3://bucket/path/to/folder)\nthis path, with different destination folders, will be used for WALs\nand for data. This may not be populated in case of errors.",
"type": "string"
},
"encryption": {
"description": "Encryption method required to S3 API",
"type": "string"
},
"endLSN": {
"description": "The ending xlog",
"type": "string"
},
"endWal": {
"description": "The ending WAL",
"type": "string"
},
"endpointCA": {
"description": "EndpointCA store the CA bundle of the barman endpoint.\nUseful when using self-signed certificates to avoid\nerrors with certificate issuer and barman-cloud-wal-archive.",
"properties": {
"key": {
"description": "The key to select",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
},
"endpointURL": {
"description": "Endpoint to be used to upload data to the cloud,\noverriding the automatic endpoint discovery",
"type": "string"
},
"error": {
"description": "The detected error",
"type": "string"
},
"googleCredentials": {
"description": "The credentials to use to upload data to Google Cloud Storage",
"properties": {
"applicationCredentials": {
"description": "The secret containing the Google Cloud Storage JSON file with the credentials",
"properties": {
"key": {
"description": "The key to select",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
},
"gkeEnvironment": {
"description": "If set to true, will presume that it's running inside a GKE environment,\ndefault to false.",
"type": "boolean"
}
},
"type": "object"
},
"instanceID": {
"description": "Information to identify the instance where the backup has been taken from",
"properties": {
"ContainerID": {
"description": "The container ID",
"type": "string"
},
"podName": {
"description": "The pod name",
"type": "string"
}
},
"type": "object"
},
"majorVersion": {
"description": "The PostgreSQL major version that was running when the\nbackup was taken.",
"type": "integer"
},
"method": {
"description": "The backup method being used",
"type": "string"
},
"online": {
"description": "Whether the backup was online/hot (`true`) or offline/cold (`false`)",
"type": "boolean"
},
"phase": {
"description": "The last backup status",
"type": "string"
},
"pluginMetadata": {
"additionalProperties": {
"type": "string"
},
"description": "A map containing the plugin metadata",
"type": "object"
},
"s3Credentials": {
"description": "The credentials to use to upload data to S3",
"properties": {
"accessKeyId": {
"description": "The reference to the access key id",
"properties": {
"key": {
"description": "The key to select",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
},
"inheritFromIAMRole": {
"description": "Use the role based authentication without providing explicitly the keys.",
"type": "boolean"
},
"region": {
"description": "The reference to the secret containing the region name",
"properties": {
"key": {
"description": "The key to select",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
},
"secretAccessKey": {
"description": "The reference to the secret access key",
"properties": {
"key": {
"description": "The key to select",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
},
"sessionToken": {
"description": "The references to the session key",
"properties": {
"key": {
"description": "The key to select",
"type": "string"
},
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"key",
"name"
],
"type": "object"
}
},
"type": "object"
},
"serverName": {
"description": "The server name on S3, the cluster name is used if this\nparameter is omitted",
"type": "string"
},
"snapshotBackupStatus": {
"description": "Status of the volumeSnapshot backup",
"properties": {
"elements": {
"description": "The elements list, populated with the gathered volume snapshots",
"items": {
"description": "BackupSnapshotElementStatus is a volume snapshot that is part of a volume snapshot method backup",
"properties": {
"name": {
"description": "Name is the snapshot resource name",
"type": "string"
},
"tablespaceName": {
"description": "TablespaceName is the name of the snapshotted tablespace. Only set\nwhen type is PG_TABLESPACE",
"type": "string"
},
"type": {
"description": "Type is tho role of the snapshot in the cluster, such as PG_DATA, PG_WAL and PG_TABLESPACE",
"type": "string"
}
},
"required": [
"name",
"type"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"startedAt": {
"description": "When the backup was started",
"format": "date-time",
"type": "string"
},
"stoppedAt": {
"description": "When the backup was terminated",
"format": "date-time",
"type": "string"
},
"tablespaceMapFile": {
"description": "Tablespace map file content as returned by Postgres in case of online (hot) backups",
"format": "byte",
"type": "string"
}
},
"type": "object"
}
},
"required": [
"metadata",
"spec"
],
"type": "object"
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/schema#",
"description": "ClusterImageCatalog is the Schema for the clusterimagecatalogs API",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"description": "Specification of the desired behavior of the ClusterImageCatalog.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
"properties": {
"images": {
"description": "List of CatalogImages available in the catalog",
"items": {
"description": "CatalogImage defines the image and major version",
"properties": {
"image": {
"description": "The image reference",
"type": "string"
},
"major": {
"description": "The PostgreSQL major version of the image. Must be unique within the catalog.",
"minimum": 10,
"type": "integer"
}
},
"required": [
"image",
"major"
],
"type": "object"
},
"maxItems": 8,
"minItems": 1,
"type": "array",
"x-kubernetes-validations": [
{
"message": "Images must have unique major versions",
"rule": "self.all(e, self.filter(f, f.major==e.major).size() == 1)"
}
]
}
},
"required": [
"images"
],
"type": "object"
}
},
"required": [
"metadata",
"spec"
],
"type": "object"
}
@@ -0,0 +1,607 @@
{
"$schema": "http://json-schema.org/schema#",
"description": "Database is the Schema for the databases API",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"description": "Specification of the desired Database.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
"properties": {
"allowConnections": {
"description": "Maps to the `ALLOW_CONNECTIONS` parameter of `CREATE DATABASE` and\n`ALTER DATABASE`. If false then no one can connect to this database.",
"type": "boolean"
},
"builtinLocale": {
"description": "Maps to the `BUILTIN_LOCALE` parameter of `CREATE DATABASE`. This\nsetting cannot be changed. Specifies the locale name when the\nbuiltin provider is used. This option requires `localeProvider` to\nbe set to `builtin`. Available from PostgreSQL 17.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "builtinLocale is immutable",
"rule": "self == oldSelf"
}
]
},
"cluster": {
"description": "The name of the PostgreSQL cluster hosting the database.",
"properties": {
"name": {
"default": "",
"description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
"type": "string"
}
},
"type": "object",
"x-kubernetes-map-type": "atomic"
},
"collationVersion": {
"description": "Maps to the `COLLATION_VERSION` parameter of `CREATE DATABASE`. This\nsetting cannot be changed.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "collationVersion is immutable",
"rule": "self == oldSelf"
}
]
},
"connectionLimit": {
"description": "Maps to the `CONNECTION LIMIT` clause of `CREATE DATABASE` and\n`ALTER DATABASE`. How many concurrent connections can be made to\nthis database. -1 (the default) means no limit.",
"type": "integer"
},
"databaseReclaimPolicy": {
"default": "retain",
"description": "The policy for end-of-life maintenance of this database.",
"enum": [
"delete",
"retain"
],
"type": "string"
},
"encoding": {
"description": "Maps to the `ENCODING` parameter of `CREATE DATABASE`. This setting\ncannot be changed. Character set encoding to use in the database.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "encoding is immutable",
"rule": "self == oldSelf"
}
]
},
"ensure": {
"default": "present",
"description": "Ensure the PostgreSQL database is `present` or `absent` - defaults to \"present\".",
"enum": [
"present",
"absent"
],
"type": "string"
},
"extensions": {
"description": "The list of extensions to be managed in the database",
"items": {
"description": "ExtensionSpec configures an extension in a database",
"properties": {
"ensure": {
"default": "present",
"description": "Specifies whether an object (e.g schema) should be present or absent\nin the database. If set to `present`, the object will be created if\nit does not exist. If set to `absent`, the extension/schema will be\nremoved if it exists.",
"enum": [
"present",
"absent"
],
"type": "string"
},
"name": {
"description": "Name of the object (extension, schema, FDW, server)",
"type": "string"
},
"schema": {
"description": "The name of the schema in which to install the extension's objects,\nin case the extension allows its contents to be relocated. If not\nspecified (default), and the extension's control file does not\nspecify a schema either, the current default object creation schema\nis used.",
"type": "string"
},
"version": {
"description": "The version of the extension to install. If empty, the operator will\ninstall the default version (whatever is specified in the\nextension's control file)",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"type": "array"
},
"fdws": {
"description": "The list of foreign data wrappers to be managed in the database",
"items": {
"description": "FDWSpec configures an Foreign Data Wrapper in a database",
"properties": {
"ensure": {
"default": "present",
"description": "Specifies whether an object (e.g schema) should be present or absent\nin the database. If set to `present`, the object will be created if\nit does not exist. If set to `absent`, the extension/schema will be\nremoved if it exists.",
"enum": [
"present",
"absent"
],
"type": "string"
},
"handler": {
"description": "Name of the handler function (e.g., \"postgres_fdw_handler\").\nThis will be empty if no handler is specified. In that case,\nthe default handler is registered when the FDW extension is created.",
"type": "string"
},
"name": {
"description": "Name of the object (extension, schema, FDW, server)",
"type": "string"
},
"options": {
"description": "Options specifies the configuration options for the FDW.",
"items": {
"description": "OptionSpec holds the name, value and the ensure field for an option",
"properties": {
"ensure": {
"default": "present",
"description": "Specifies whether an option should be present or absent in\nthe database. If set to `present`, the option will be\ncreated if it does not exist. If set to `absent`, the\noption will be removed if it exists.",
"enum": [
"present",
"absent"
],
"type": "string"
},
"name": {
"description": "Name of the option",
"type": "string"
},
"value": {
"description": "Value of the option",
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"type": "array"
},
"owner": {
"description": "Owner specifies the database role that will own the Foreign Data Wrapper.\nThe role must have superuser privileges in the target database.",
"type": "string"
},
"usage": {
"description": "List of roles for which `USAGE` privileges on the FDW are granted or revoked.",
"items": {
"description": "UsageSpec configures a usage for a foreign data wrapper",
"properties": {
"name": {
"description": "Name of the usage",
"type": "string",
"x-kubernetes-validations": [
{
"message": "name is required",
"rule": "self != ''"
}
]
},
"type": {
"default": "grant",
"description": "The type of usage",
"enum": [
"grant",
"revoke"
],
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"type": "array"
},
"validator": {
"description": "Name of the validator function (e.g., \"postgres_fdw_validator\").\nThis will be empty if no validator is specified. In that case,\nthe default validator is registered when the FDW extension is created.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"type": "array"
},
"icuLocale": {
"description": "Maps to the `ICU_LOCALE` parameter of `CREATE DATABASE`. This\nsetting cannot be changed. Specifies the ICU locale when the ICU\nprovider is used. This option requires `localeProvider` to be set to\n`icu`. Available from PostgreSQL 15.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "icuLocale is immutable",
"rule": "self == oldSelf"
}
]
},
"icuRules": {
"description": "Maps to the `ICU_RULES` parameter of `CREATE DATABASE`. This setting\ncannot be changed. Specifies additional collation rules to customize\nthe behavior of the default collation. This option requires\n`localeProvider` to be set to `icu`. Available from PostgreSQL 16.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "icuRules is immutable",
"rule": "self == oldSelf"
}
]
},
"isTemplate": {
"description": "Maps to the `IS_TEMPLATE` parameter of `CREATE DATABASE` and `ALTER\nDATABASE`. If true, this database is considered a template and can\nbe cloned by any user with `CREATEDB` privileges.",
"type": "boolean"
},
"locale": {
"description": "Maps to the `LOCALE` parameter of `CREATE DATABASE`. This setting\ncannot be changed. Sets the default collation order and character\nclassification in the new database.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "locale is immutable",
"rule": "self == oldSelf"
}
]
},
"localeCType": {
"description": "Maps to the `LC_CTYPE` parameter of `CREATE DATABASE`. This setting\ncannot be changed.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "localeCType is immutable",
"rule": "self == oldSelf"
}
]
},
"localeCollate": {
"description": "Maps to the `LC_COLLATE` parameter of `CREATE DATABASE`. This\nsetting cannot be changed.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "localeCollate is immutable",
"rule": "self == oldSelf"
}
]
},
"localeProvider": {
"description": "Maps to the `LOCALE_PROVIDER` parameter of `CREATE DATABASE`. This\nsetting cannot be changed. This option sets the locale provider for\ndatabases created in the new cluster. Available from PostgreSQL 16.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "localeProvider is immutable",
"rule": "self == oldSelf"
}
]
},
"name": {
"description": "The name of the database to create inside PostgreSQL. This setting cannot be changed.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "name is immutable",
"rule": "self == oldSelf"
},
{
"message": "the name postgres is reserved",
"rule": "self != 'postgres'"
},
{
"message": "the name template0 is reserved",
"rule": "self != 'template0'"
},
{
"message": "the name template1 is reserved",
"rule": "self != 'template1'"
}
]
},
"owner": {
"description": "Maps to the `OWNER` parameter of `CREATE DATABASE`.\nMaps to the `OWNER TO` command of `ALTER DATABASE`.\nThe role name of the user who owns the database inside PostgreSQL.",
"type": "string"
},
"schemas": {
"description": "The list of schemas to be managed in the database",
"items": {
"description": "SchemaSpec configures a schema in a database",
"properties": {
"ensure": {
"default": "present",
"description": "Specifies whether an object (e.g schema) should be present or absent\nin the database. If set to `present`, the object will be created if\nit does not exist. If set to `absent`, the extension/schema will be\nremoved if it exists.",
"enum": [
"present",
"absent"
],
"type": "string"
},
"name": {
"description": "Name of the object (extension, schema, FDW, server)",
"type": "string"
},
"owner": {
"description": "The role name of the user who owns the schema inside PostgreSQL.\nIt maps to the `AUTHORIZATION` parameter of `CREATE SCHEMA` and the\n`OWNER TO` command of `ALTER SCHEMA`.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"type": "array"
},
"servers": {
"description": "The list of foreign servers to be managed in the database",
"items": {
"description": "ServerSpec configures a server of a foreign data wrapper",
"properties": {
"ensure": {
"default": "present",
"description": "Specifies whether an object (e.g schema) should be present or absent\nin the database. If set to `present`, the object will be created if\nit does not exist. If set to `absent`, the extension/schema will be\nremoved if it exists.",
"enum": [
"present",
"absent"
],
"type": "string"
},
"fdw": {
"description": "The name of the Foreign Data Wrapper (FDW)",
"type": "string",
"x-kubernetes-validations": [
{
"message": "fdw is required",
"rule": "self != ''"
}
]
},
"name": {
"description": "Name of the object (extension, schema, FDW, server)",
"type": "string"
},
"options": {
"description": "Options specifies the configuration options for the server\n(key is the option name, value is the option value).",
"items": {
"description": "OptionSpec holds the name, value and the ensure field for an option",
"properties": {
"ensure": {
"default": "present",
"description": "Specifies whether an option should be present or absent in\nthe database. If set to `present`, the option will be\ncreated if it does not exist. If set to `absent`, the\noption will be removed if it exists.",
"enum": [
"present",
"absent"
],
"type": "string"
},
"name": {
"description": "Name of the option",
"type": "string"
},
"value": {
"description": "Value of the option",
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"type": "array"
},
"usage": {
"description": "List of roles for which `USAGE` privileges on the server are granted or revoked.",
"items": {
"description": "UsageSpec configures a usage for a foreign data wrapper",
"properties": {
"name": {
"description": "Name of the usage",
"type": "string",
"x-kubernetes-validations": [
{
"message": "name is required",
"rule": "self != ''"
}
]
},
"type": {
"default": "grant",
"description": "The type of usage",
"enum": [
"grant",
"revoke"
],
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"fdw",
"name"
],
"type": "object"
},
"type": "array"
},
"tablespace": {
"description": "Maps to the `TABLESPACE` parameter of `CREATE DATABASE`.\nMaps to the `SET TABLESPACE` command of `ALTER DATABASE`.\nThe name of the tablespace (in PostgreSQL) that will be associated\nwith the new database. This tablespace will be the default\ntablespace used for objects created in this database.",
"type": "string"
},
"template": {
"description": "Maps to the `TEMPLATE` parameter of `CREATE DATABASE`. This setting\ncannot be changed. The name of the template from which to create\nthis database.",
"type": "string",
"x-kubernetes-validations": [
{
"message": "template is immutable",
"rule": "self == oldSelf"
}
]
}
},
"required": [
"cluster",
"name",
"owner"
],
"type": "object",
"x-kubernetes-validations": [
{
"message": "builtinLocale is only available when localeProvider is set to `builtin`",
"rule": "!has(self.builtinLocale) || self.localeProvider == 'builtin'"
},
{
"message": "icuLocale is only available when localeProvider is set to `icu`",
"rule": "!has(self.icuLocale) || self.localeProvider == 'icu'"
},
{
"message": "icuRules is only available when localeProvider is set to `icu`",
"rule": "!has(self.icuRules) || self.localeProvider == 'icu'"
}
]
},
"status": {
"description": "Most recently observed status of the Database. This data may not be up to\ndate. Populated by the system. Read-only.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
"properties": {
"applied": {
"description": "Applied is true if the database was reconciled correctly",
"type": "boolean"
},
"extensions": {
"description": "Extensions is the status of the managed extensions",
"items": {
"description": "DatabaseObjectStatus is the status of the managed database objects",
"properties": {
"applied": {
"description": "True of the object has been installed successfully in\nthe database",
"type": "boolean"
},
"message": {
"description": "Message is the object reconciliation message",
"type": "string"
},
"name": {
"description": "The name of the object",
"type": "string"
}
},
"required": [
"applied",
"name"
],
"type": "object"
},
"type": "array"
},
"fdws": {
"description": "FDWs is the status of the managed FDWs",
"items": {
"description": "DatabaseObjectStatus is the status of the managed database objects",
"properties": {
"applied": {
"description": "True of the object has been installed successfully in\nthe database",
"type": "boolean"
},
"message": {
"description": "Message is the object reconciliation message",
"type": "string"
},
"name": {
"description": "The name of the object",
"type": "string"
}
},
"required": [
"applied",
"name"
],
"type": "object"
},
"type": "array"
},
"message": {
"description": "Message is the reconciliation output message",
"type": "string"
},
"observedGeneration": {
"description": "A sequence number representing the latest\ndesired state that was synchronized",
"format": "int64",
"type": "integer"
},
"schemas": {
"description": "Schemas is the status of the managed schemas",
"items": {
"description": "DatabaseObjectStatus is the status of the managed database objects",
"properties": {
"applied": {
"description": "True of the object has been installed successfully in\nthe database",
"type": "boolean"
},
"message": {
"description": "Message is the object reconciliation message",
"type": "string"
},
"name": {
"description": "The name of the object",
"type": "string"
}
},
"required": [
"applied",
"name"
],
"type": "object"
},
"type": "array"
},
"servers": {
"description": "Servers is the status of the managed servers",
"items": {
"description": "DatabaseObjectStatus is the status of the managed database objects",
"properties": {
"applied": {
"description": "True of the object has been installed successfully in\nthe database",
"type": "boolean"
},
"message": {
"description": "Message is the object reconciliation message",
"type": "string"
},
"name": {
"description": "The name of the object",
"type": "string"
}
},
"required": [
"applied",
"name"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
},
"required": [
"metadata",
"spec"
],
"type": "object"
}
@@ -0,0 +1,46 @@
{
"$schema": "http://json-schema.org/schema#",
"description": "FailoverQuorum contains the information about the current failover\nquorum status of a PG cluster. It is updated by the instance manager\nof the primary node and reset to zero by the operator to trigger\nan update.",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"status": {
"description": "Most recently observed status of the failover quorum.",
"properties": {
"method": {
"description": "Contains the latest reported Method value.",
"type": "string"
},
"primary": {
"description": "Primary is the name of the primary instance that updated\nthis object the latest time.",
"type": "string"
},
"standbyNames": {
"description": "StandbyNames is the list of potentially synchronous\ninstance names.",
"items": {
"type": "string"
},
"type": "array"
},
"standbyNumber": {
"description": "StandbyNumber is the number of synchronous standbys that transactions\nneed to wait for replies from.",
"type": "integer"
}
},
"type": "object"
}
},
"required": [
"metadata"
],
"type": "object"
}
@@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/schema#",
"description": "ImageCatalog is the Schema for the imagecatalogs API",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"description": "Specification of the desired behavior of the ImageCatalog.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
"properties": {
"images": {
"description": "List of CatalogImages available in the catalog",
"items": {
"description": "CatalogImage defines the image and major version",
"properties": {
"image": {
"description": "The image reference",
"type": "string"
},
"major": {
"description": "The PostgreSQL major version of the image. Must be unique within the catalog.",
"minimum": 10,
"type": "integer"
}
},
"required": [
"image",
"major"
],
"type": "object"
},
"maxItems": 8,
"minItems": 1,
"type": "array",
"x-kubernetes-validations": [
{
"message": "Images must have unique major versions",
"rule": "self.all(e, self.filter(f, f.major==e.major).size() == 1)"
}
]
}
},
"required": [
"images"
],
"type": "object"
}
},
"required": [
"metadata",
"spec"
],
"type": "object"
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,178 @@
{
"$schema": "http://json-schema.org/schema#",
"description": "Publication is the Schema for the publications API",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"description": "PublicationSpec defines the desired state of Publication",
"properties": {
"cluster": {
"description": "The name of the PostgreSQL cluster that identifies the \"publisher\"",
"properties": {
"name": {
"default": "",
"description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
"type": "string"
}
},
"type": "object",
"x-kubernetes-map-type": "atomic"
},
"dbname": {
"description": "The name of the database where the publication will be installed in\nthe \"publisher\" cluster",
"type": "string",
"x-kubernetes-validations": [
{
"message": "dbname is immutable",
"rule": "self == oldSelf"
}
]
},
"name": {
"description": "The name of the publication inside PostgreSQL",
"type": "string",
"x-kubernetes-validations": [
{
"message": "name is immutable",
"rule": "self == oldSelf"
}
]
},
"parameters": {
"additionalProperties": {
"type": "string"
},
"description": "Publication parameters part of the `WITH` clause as expected by\nPostgreSQL `CREATE PUBLICATION` command",
"type": "object"
},
"publicationReclaimPolicy": {
"default": "retain",
"description": "The policy for end-of-life maintenance of this publication",
"enum": [
"delete",
"retain"
],
"type": "string"
},
"target": {
"description": "Target of the publication as expected by PostgreSQL `CREATE PUBLICATION` command",
"properties": {
"allTables": {
"description": "Marks the publication as one that replicates changes for all tables\nin the database, including tables created in the future.\nCorresponding to `FOR ALL TABLES` in PostgreSQL.",
"type": "boolean",
"x-kubernetes-validations": [
{
"message": "allTables is immutable",
"rule": "self == oldSelf"
}
]
},
"objects": {
"description": "Just the following schema objects",
"items": {
"description": "PublicationTargetObject is an object to publish",
"properties": {
"table": {
"description": "Specifies a list of tables to add to the publication. Corresponding\nto `FOR TABLE` in PostgreSQL.",
"properties": {
"columns": {
"description": "The columns to publish",
"items": {
"type": "string"
},
"type": "array"
},
"name": {
"description": "The table name",
"type": "string"
},
"only": {
"description": "Whether to limit to the table only or include all its descendants",
"type": "boolean"
},
"schema": {
"description": "The schema name",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"tablesInSchema": {
"description": "Marks the publication as one that replicates changes for all tables\nin the specified list of schemas, including tables created in the\nfuture. Corresponding to `FOR TABLES IN SCHEMA` in PostgreSQL.",
"type": "string"
}
},
"type": "object",
"x-kubernetes-validations": [
{
"message": "tablesInSchema and table are mutually exclusive",
"rule": "(has(self.tablesInSchema) && !has(self.table)) || (!has(self.tablesInSchema) && has(self.table))"
}
]
},
"maxItems": 100000,
"type": "array",
"x-kubernetes-validations": [
{
"message": "specifying a column list when the publication also publishes tablesInSchema is not supported",
"rule": "!(self.exists(o, has(o.table) && has(o.table.columns)) && self.exists(o, has(o.tablesInSchema)))"
}
]
}
},
"type": "object",
"x-kubernetes-validations": [
{
"message": "allTables and objects are mutually exclusive",
"rule": "(has(self.allTables) && !has(self.objects)) || (!has(self.allTables) && has(self.objects))"
}
]
}
},
"required": [
"cluster",
"dbname",
"name",
"target"
],
"type": "object"
},
"status": {
"description": "PublicationStatus defines the observed state of Publication",
"properties": {
"applied": {
"description": "Applied is true if the publication was reconciled correctly",
"type": "boolean"
},
"message": {
"description": "Message is the reconciliation output message",
"type": "string"
},
"observedGeneration": {
"description": "A sequence number representing the latest\ndesired state that was synchronized",
"format": "int64",
"type": "integer"
}
},
"type": "object"
}
},
"required": [
"metadata",
"spec"
],
"type": "object"
}
@@ -0,0 +1,145 @@
{
"$schema": "http://json-schema.org/schema#",
"description": "ScheduledBackup is the Schema for the scheduledbackups API",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"description": "Specification of the desired behavior of the ScheduledBackup.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
"properties": {
"backupOwnerReference": {
"default": "none",
"description": "Indicates which ownerReference should be put inside the created backup resources.<br />\n- none: no owner reference for created backup objects (same behavior as before the field was introduced)<br />\n- self: sets the Scheduled backup object as owner of the backup<br />\n- cluster: set the cluster as owner of the backup<br />",
"enum": [
"none",
"self",
"cluster"
],
"type": "string"
},
"cluster": {
"description": "The cluster to backup",
"properties": {
"name": {
"description": "Name of the referent.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"immediate": {
"description": "If the first backup has to be immediately start after creation or not",
"type": "boolean"
},
"method": {
"default": "barmanObjectStore",
"description": "The backup method to be used, possible options are `barmanObjectStore`,\n`volumeSnapshot` or `plugin`. Defaults to: `barmanObjectStore`.",
"enum": [
"barmanObjectStore",
"volumeSnapshot",
"plugin"
],
"type": "string"
},
"online": {
"description": "Whether the default type of backup with volume snapshots is\nonline/hot (`true`, default) or offline/cold (`false`)\nOverrides the default setting specified in the cluster field '.spec.backup.volumeSnapshot.online'",
"type": "boolean"
},
"onlineConfiguration": {
"description": "Configuration parameters to control the online/hot backup with volume snapshots\nOverrides the default settings specified in the cluster '.backup.volumeSnapshot.onlineConfiguration' stanza",
"properties": {
"immediateCheckpoint": {
"description": "Control whether the I/O workload for the backup initial checkpoint will\nbe limited, according to the `checkpoint_completion_target` setting on\nthe PostgreSQL server. If set to true, an immediate checkpoint will be\nused, meaning PostgreSQL will complete the checkpoint as soon as\npossible. `false` by default.",
"type": "boolean"
},
"waitForArchive": {
"default": true,
"description": "If false, the function will return immediately after the backup is completed,\nwithout waiting for WAL to be archived.\nThis behavior is only useful with backup software that independently monitors WAL archiving.\nOtherwise, WAL required to make the backup consistent might be missing and make the backup useless.\nBy default, or when this parameter is true, pg_backup_stop will wait for WAL to be archived when archiving is\nenabled.\nOn a standby, this means that it will wait only when archive_mode = always.\nIf write activity on the primary is low, it may be useful to run pg_switch_wal on the primary in order to trigger\nan immediate segment switch.",
"type": "boolean"
}
},
"type": "object"
},
"pluginConfiguration": {
"description": "Configuration parameters passed to the plugin managing this backup",
"properties": {
"name": {
"description": "Name is the name of the plugin managing this backup",
"type": "string"
},
"parameters": {
"additionalProperties": {
"type": "string"
},
"description": "Parameters are the configuration parameters passed to the backup\nplugin for this backup",
"type": "object"
}
},
"required": [
"name"
],
"type": "object"
},
"schedule": {
"description": "The schedule does not follow the same format used in Kubernetes CronJobs\nas it includes an additional seconds specifier,\nsee https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format",
"type": "string"
},
"suspend": {
"description": "If this backup is suspended or not",
"type": "boolean"
},
"target": {
"description": "The policy to decide which instance should perform this backup. If empty,\nit defaults to `cluster.spec.backup.target`.\nAvailable options are empty string, `primary` and `prefer-standby`.\n`primary` to have backups run always on primary instances,\n`prefer-standby` to have backups run preferably on the most updated\nstandby, if available.",
"enum": [
"primary",
"prefer-standby"
],
"type": "string"
}
},
"required": [
"cluster",
"schedule"
],
"type": "object"
},
"status": {
"description": "Most recently observed status of the ScheduledBackup. This data may not be up\nto date. Populated by the system. Read-only.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
"properties": {
"lastCheckTime": {
"description": "The latest time the schedule",
"format": "date-time",
"type": "string"
},
"lastScheduleTime": {
"description": "Information when was the last time that backup was successfully scheduled.",
"format": "date-time",
"type": "string"
},
"nextScheduleTime": {
"description": "Next time we will run a backup",
"format": "date-time",
"type": "string"
}
},
"type": "object"
}
},
"required": [
"metadata",
"spec"
],
"type": "object"
}
@@ -0,0 +1,114 @@
{
"$schema": "http://json-schema.org/schema#",
"description": "Subscription is the Schema for the subscriptions API",
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"type": "object"
},
"spec": {
"description": "SubscriptionSpec defines the desired state of Subscription",
"properties": {
"cluster": {
"description": "The name of the PostgreSQL cluster that identifies the \"subscriber\"",
"properties": {
"name": {
"default": "",
"description": "Name of the referent.\nThis field is effectively required, but due to backwards compatibility is\nallowed to be empty. Instances of this type with an empty value here are\nalmost certainly wrong.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
"type": "string"
}
},
"type": "object",
"x-kubernetes-map-type": "atomic"
},
"dbname": {
"description": "The name of the database where the publication will be installed in\nthe \"subscriber\" cluster",
"type": "string",
"x-kubernetes-validations": [
{
"message": "dbname is immutable",
"rule": "self == oldSelf"
}
]
},
"externalClusterName": {
"description": "The name of the external cluster with the publication (\"publisher\")",
"type": "string"
},
"name": {
"description": "The name of the subscription inside PostgreSQL",
"type": "string",
"x-kubernetes-validations": [
{
"message": "name is immutable",
"rule": "self == oldSelf"
}
]
},
"parameters": {
"additionalProperties": {
"type": "string"
},
"description": "Subscription parameters included in the `WITH` clause of the PostgreSQL\n`CREATE SUBSCRIPTION` command. Most parameters cannot be changed\nafter the subscription is created and will be ignored if modified\nlater, except for a limited set documented at:\nhttps://www.postgresql.org/docs/current/sql-altersubscription.html#SQL-ALTERSUBSCRIPTION-PARAMS-SET",
"type": "object"
},
"publicationDBName": {
"description": "The name of the database containing the publication on the external\ncluster. Defaults to the one in the external cluster definition.",
"type": "string"
},
"publicationName": {
"description": "The name of the publication inside the PostgreSQL database in the\n\"publisher\"",
"type": "string"
},
"subscriptionReclaimPolicy": {
"default": "retain",
"description": "The policy for end-of-life maintenance of this subscription",
"enum": [
"delete",
"retain"
],
"type": "string"
}
},
"required": [
"cluster",
"dbname",
"externalClusterName",
"name",
"publicationName"
],
"type": "object"
},
"status": {
"description": "SubscriptionStatus defines the observed state of Subscription",
"properties": {
"applied": {
"description": "Applied is true if the subscription was reconciled correctly",
"type": "boolean"
},
"message": {
"description": "Message is the reconciliation output message",
"type": "string"
},
"observedGeneration": {
"description": "A sequence number representing the latest\ndesired state that was synchronized",
"format": "int64",
"type": "integer"
}
},
"type": "object"
}
},
"required": [
"metadata",
"spec"
],
"type": "object"
}