Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 3.21 KB

File metadata and controls

75 lines (60 loc) · 3.21 KB

Grant

The Grant Custom Resource Definition (CRD) is responsible for managing privileges (GRANT/REVOKE) on PostgreSQL objects.

Spec

Field Type Description Required Immutable
clusterRef ClusterReference Reference to the ClusterConnection to use. Yes No
database string The database containing the objects. Yes Yes
role string The role to which privileges are granted. Yes Yes
schema string The schema containing the objects. Required, unless objectType is database. Conditional Yes
objectType string The type of object. Yes Yes
objects array[string] List of object names. If empty, all objects of this objectType will be granted. Required, unless objectType is database or schema. Conditional No
privileges array[string] List of privileges to grant. Yes No

Object Types

Supported object types:

  • database
  • schema
  • sequence
  • table

Privileges

Supported privileges depend on the objectType:

  • connect
  • create
  • delete
  • insert
  • maintain
  • references
  • select
  • temporary
  • trigger
  • truncate
  • update
  • usage

ClusterReference

Field Type Description Required
name string Name of the ClusterConnection. Yes
namespace string Namespace of the ClusterConnection. If not specified, uses the CR's namespace. No

Example

apiVersion: postgresql.aboutbits.it/v1
kind: Grant
metadata:
  name: grant-select-tables
spec:
  clusterRef:
    name: my-postgres-connection
  database: my_database
  role: my_role
  objectType: table
  schema: public
  objects:
    - my_table
    - another_table
  privileges:
    - select
    - insert

Official Documentation