Skip to content

Secrets engine resources · Kind catalogue · Examples

DatabaseConnection

API version: secrets.openbaoconfig.io/v1alpha1
Scope: Namespaced
Resource: databaseconnections.secrets.openbaoconfig.io
Categories: openbao

DatabaseConnection manages a connection of a database secrets engine at `<mount>/config/<name>`: the plugin, the root credentials (from a Secret) and the roles allowed to use it. DatabaseRole and DatabaseStaticRole objects issue credentials through it.

Example:

spec:
  connectionRef:
    name: openbao
  mountPath: database
  name: billing-postgres
  pluginName: postgresql-database-plugin
  allowedRoles: [billing-app]
  passwordSecretRef: {name: pg-root, key: password}
  postgresql:
    connectionURL: postgresql://{{username}}:{{password}}@pg:5432/billing
    username: openbao

Example

examples/secrets/databaseconnection.yaml
# Connects the database secrets engine to PostgreSQL with root credentials and TLS material read from Secrets, and
# allows the roles that issue credentials from it.
apiVersion: v1
kind: Secret
metadata:
  name: obco-db-root
  namespace: openbao-config
type: Opaque
stringData:
  password: fake-root-password-not-real
  private-key: fake-private-key-not-real
---
apiVersion: v1
kind: Secret
metadata:
  name: obco-db-tls
  namespace: openbao-config
type: Opaque
stringData:
  client.pem: fake-client-certificate-and-key-not-real
  bundle.pem: fake-pem-bundle-not-real
  issue.json: '{"certificate":"fake-not-real","private_key":"fake-not-real","issuing_ca":"fake-not-real"}'
---
apiVersion: secrets.openbaoconfig.io/v1alpha1
kind: DatabaseConnection
metadata:
  name: obco-postgres
  namespace: openbao-config
spec:
  connectionRef:
    kind: OpenBaoConnection
    name: openbao
  creationPolicy: CreateOrAdopt
  deletionPolicy: Delete
  driftDetection: Enabled
  mountPath: database
  name: postgres
  pluginName: postgresql-database-plugin
  verifyConnection: true
  allowedRoles:
    - obco-app-ro
    - obco-app-cert
    - obco-app-static
  rootRotationStatements:
    - ALTER USER "{{name}}" WITH PASSWORD '{{password}}';
  passwordPolicy: obco-db
  passwordSecretRef:
    name: obco-db-root
    key: password
  rotateRootOnCreate: true
  postgresql:
    connectionURL: postgresql://{{username}}:{{password}}@postgres.openbao-config.svc:5432/app?sslmode=require
    username: openbao-root
    maxOpenConnections: 8
    maxIdleConnections: 4
    maxConnectionLifetime: 5m
    usernameTemplate: '{{ printf "v-%s-%s" (.RoleName | truncate 16) (random 8) }}'
    disableEscaping: false
    passwordAuthentication: scram-sha-256
---
apiVersion: secrets.openbaoconfig.io/v1alpha1
kind: DatabaseConnection
metadata:
  name: obco-mysql
  namespace: openbao-config
spec:
  connectionRef:
    name: openbao
  mountPath: database
  pluginName: mysql-database-plugin
  verifyConnection: false
  allowedRoles:
    - '*'
  passwordSecretRef:
    name: obco-db-root
    key: password
  mysql:
    connectionURL: '{{username}}:{{password}}@tcp(mysql.openbao-config.svc:3306)/'
    username: openbao-root
    maxOpenConnections: 4
    maxIdleConnections: 2
    maxConnectionLifetime: 1m
    usernameTemplate: '{{ .RoleName | truncate 10 }}-{{ random 6 }}'
    tlsCA: |
      -----BEGIN CERTIFICATE-----
      ZmFrZS1jYS1ub3QtcmVhbA==
      -----END CERTIFICATE-----
    tlsCertificateKeySecretRef:
      name: obco-db-tls
      key: client.pem
    tlsServerName: mysql.openbao-config.svc
    tlsSkipVerify: false
---
apiVersion: secrets.openbaoconfig.io/v1alpha1
kind: DatabaseConnection
metadata:
  name: obco-cassandra
  namespace: openbao-config
spec:
  connectionRef:
    name: openbao
  mountPath: database
  pluginName: cassandra-database-plugin
  verifyConnection: false
  allowedRoles:
    - obco-cassandra
  passwordSecretRef:
    name: obco-db-root
    key: password
  cassandra:
    hosts:
      - cassandra-0.cassandra.openbao-config.svc
      - cassandra-1.cassandra.openbao-config.svc
    port: 9042
    protocolVersion: 4
    username: cassandra
    tls: true
    insecureTLS: false
    tlsServerName: cassandra.openbao-config.svc
    tlsMinVersion: tls12
    pemBundleSecretRef:
      name: obco-db-tls
      key: bundle.pem
    skipVerification: false
    connectTimeout: 5s
    socketKeepAlive: 30s
    consistency: LOCAL_QUORUM
    localDatacenter: dc1
    usernameTemplate: '{{ .RoleName }}_{{ random 8 }}'
---
apiVersion: secrets.openbaoconfig.io/v1alpha1
kind: DatabaseConnection
metadata:
  name: obco-influxdb
  namespace: openbao-config
spec:
  connectionRef:
    name: openbao
  mountPath: database
  pluginName: influxdb-database-plugin
  verifyConnection: false
  allowedRoles:
    - obco-influx
  passwordSecretRef:
    name: obco-db-root
    key: password
  influxdb:
    host: influxdb.openbao-config.svc
    port: 8086
    username: admin
    tls: true
    insecureTLS: false
    tlsMinVersion: tls12
    pemJSONSecretRef:
      name: obco-db-tls
      key: issue.json
    connectTimeout: 5s
    usernameTemplate: '{{ .RoleName }}_{{ random 8 }}'
---
apiVersion: secrets.openbaoconfig.io/v1alpha1
kind: DatabaseConnection
metadata:
  name: obco-valkey
  namespace: openbao-config
spec:
  connectionRef:
    name: openbao
  mountPath: database
  pluginName: valkey-database-plugin
  verifyConnection: false
  allowedRoles:
    - obco-cache
  passwordSecretRef:
    name: obco-db-root
    key: password
  valkey:
    host: valkey.openbao-config.svc
    port: 6379
    username: default
    tls: true
    insecureTLS: false
    caCert: |
      -----BEGIN CERTIFICATE-----
      ZmFrZS1jYS1ub3QtcmVhbA==
      -----END CERTIFICATE-----
---
apiVersion: secrets.openbaoconfig.io/v1alpha1
kind: DatabaseConnection
metadata:
  name: obco-redis-url
  namespace: openbao-config
spec:
  connectionRef:
    name: openbao
  mountPath: database
  pluginName: redis-database-plugin
  verifyConnection: false
  valkey:
    connectionURL: rediss://redis.openbao-config.svc:6379
---
apiVersion: secrets.openbaoconfig.io/v1alpha1
kind: DatabaseConnection
metadata:
  name: obco-snowflake
  namespace: openbao-config
spec:
  connectionRef:
    name: openbao
  mountPath: database
  pluginName: snowflake-database-plugin
  pluginVersion: v0.13.0
  verifyConnection: false
  allowedRoles:
    - obco-analytics
  privateKeySecretRef:
    name: obco-db-root
    key: private-key
  pluginConfig:
    connection_url: '{{username}}@obco-account/analytics'
    username: OPENBAO_ROOT
    max_open_connections: "4"

On GitHub: databaseconnection.yaml, generated sample with every field.

Fields

Defaults below are CRD schema defaults. A blank cell does not imply zero, false or an empty value; see the field description for omission behaviour. Required fields inside an optional object apply only when that object is set.

FieldTypeRequiredDefaultDescriptionValidation
specobjectyesspec is the desired connection of a database secrets engine at `<mountPath>/config/<name>`. At most one plugin section matching pluginName may be set; pluginConfig carries settings of any other plugin or extra settings of a builtin one. An omitted allowedRoles, rootRotationStatements or passwordPolicy is reset to its default. OpenBao merges connection settings on update, so a setting removed from the spec keeps its last value until the connection is created again.
ConstraintsCEL: self.mountPath == oldSelf.mountPath (mountPath is immutable)
CEL: has(self.name) == has(oldSelf.name) && (!has(self.name) || self.name == oldSelf.name) (name is immutable)
CEL: self.pluginName == oldSelf.pluginName (pluginName is immutable)
CEL: !has(self.postgresql) || self.pluginName == 'postgresql-database-plugin' (postgresql requires pluginName postgresql-database-plugin)
CEL: !has(self.mysql) || self.pluginName in ['mysql-database-plugin', 'mysql-aurora-database-plugin', 'mysql-rds-database-plugin', 'mysql-legacy-database-plugin'] (mysql requires a mysql pluginName)
CEL: !has(self.cassandra) || self.pluginName == 'cassandra-database-plugin' (cassandra requires pluginName cassandra-database-plugin)
CEL: !has(self.influxdb) || self.pluginName == 'influxdb-database-plugin' (influxdb requires pluginName influxdb-database-plugin)
CEL: !has(self.valkey) || self.pluginName in ['valkey-database-plugin', 'redis-database-plugin'] (valkey requires pluginName valkey-database-plugin or redis-database-plugin)
CEL: !has(self.pluginConfig) || ['name', 'plugin_name', 'plugin_version', 'verify_connection', 'allowed_roles', 'root_rotation_statements', 'password_policy', 'password', 'private_key'].all(k, !(k in self.pluginConfig)) (pluginConfig must not set top-level fields or secret material; use the typed fields and secret references)
CEL: !has(self.rotateRootOnCreate) || !self.rotateRootOnCreate || has(self.passwordSecretRef) || has(self.privateKeySecretRef) (rotateRootOnCreate requires passwordSecretRef or privateKeySecretRef)
CEL: has(self.__namespace__) == has(oldSelf.__namespace__) && (!has(self.__namespace__) || self.__namespace__ == oldSelf.__namespace__) (namespace is immutable)
CEL: self.connectionRef == oldSelf.connectionRef (connectionRef is immutable)
spec.allowedRoles[]stringnoallowedRoles lists the roles that may use this connection (`allowed_roles`); `*` allows every role, empty allows none. Up to 256. Example: `[billing-app, billing-migrations]`.
Constraintsitems: <=256
list type: set
each item: length: <=128
spec.cassandraobjectnocassandra holds the settings of cassandra-database-plugin.
ConstraintsCEL: !(has(self.pemBundleSecretRef) && has(self.pemJSONSecretRef)) (set at most one of pemBundleSecretRef and pemJSONSecretRef)
spec.cassandra.connectTimeoutstringnoconnectTimeout is the timeout for connecting to the database (`connect_timeout`), a duration. Example: `5s`.
Constraintspattern: ^(0|([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+)$
spec.cassandra.consistencystringnoconsistency is the consistency level for statements (`consistency`). Example: `LOCAL_QUORUM`.
Constraintslength: <=32
spec.cassandra.hosts[]stringyeshosts are the Cassandra hosts to connect to (`hosts`, comma-joined). 1-64. Example: `[cassandra-0.db.svc, cassandra-1.db.svc]`.
Constraintsitems: >=1, <=64
each item: length: <=253
spec.cassandra.insecureTLSbooleannoinsecureTLS skips verification of the database server certificate (`insecure_tls`). Defaults to false.
spec.cassandra.localDatacenterstringnolocalDatacenter makes the driver prefer hosts of this datacenter (`local_datacenter`). Example: `dc1`.
Constraintslength: <=128
spec.cassandra.pemBundleSecretRefobjectnopemBundleSecretRef selects the Secret key holding a PEM bundle with the client certificate, its private key and the CA chain (`pem_bundle`). Read from a Secret key; never stored in status. Write-only. Example: `{name: cassandra-client, key: bundle.pem}`.
spec.cassandra.pemBundleSecretRef.keystringyesKey in the Secret's data whose value is used. Example: password
Constraintslength: >=1, <=253
spec.cassandra.pemBundleSecretRef.namestringyesName of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials
Constraintslength: >=1, <=253
spec.cassandra.pemJSONSecretRefobjectnopemJSONSecretRef selects the Secret key holding the JSON output of an OpenBao PKI issue call (`pem_json`), as an alternative to pemBundleSecretRef. Read from a Secret key; never stored in status. Write-only. Example: `{name: cassandra-client, key: issue.json}`.
spec.cassandra.pemJSONSecretRef.keystringyesKey in the Secret's data whose value is used. Example: password
Constraintslength: >=1, <=253
spec.cassandra.pemJSONSecretRef.namestringyesName of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials
Constraintslength: >=1, <=253
spec.cassandra.portinteger (int32)noport is the native protocol port (`port`). 1-65535. Defaults to 9042.
Constraintsvalue: >=1, <=65535
spec.cassandra.protocolVersioninteger (int32)noprotocolVersion is the CQL protocol version (`protocol_version`). Defaults to 2. Example: `4`.
Constraintsvalue: >=1
spec.cassandra.skipVerificationbooleannoskipVerification skips the consistency check of the root credentials on connect (`skip_verification`). Defaults to false.
spec.cassandra.socketKeepAlivestringnosocketKeepAlive is the keep-alive period of connections (`socket_keep_alive`), a duration. Example: `30s`.
Constraintspattern: ^(0|([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+)$
spec.cassandra.tlsbooleannotls enables TLS to the database (`tls`). Defaults to false.
spec.cassandra.tlsMinVersionstringnotlsMinVersion is the minimum TLS version (`tls_min_version`). Allowed: tls10, tls11, tls12, tls13. Defaults to tls12.
Constraintsone of: tls10, tls11, tls12, tls13
spec.cassandra.tlsServerNamestringnotlsServerName overrides the server name used to verify the Cassandra server certificate (`tls_server_name`). Example: `cassandra.db.svc`.
Constraintslength: <=253
spec.cassandra.usernamestringnousername is the root user (`username`). Example: `openbao`.
Constraintslength: <=256
spec.cassandra.usernameTemplatestringnousernameTemplate is the template for the names of generated users (`username_template`). Empty uses the plugin default. Example: `{{.RoleName}}_{{random 8}}`.
Constraintslength: <=1024
spec.connectionRefobjectyesConnection used to reach and log in to OpenBao. Immutable.
spec.connectionRef.kindstringno"OpenBaoConnection"Kind of the connection: OpenBaoConnection (in the same Kubernetes namespace as this resource) or ClusterOpenBaoConnection (cluster-scoped; its allowedNamespaces must select this namespace). Default: OpenBaoConnection.
Constraintsone of: OpenBaoConnection, ClusterOpenBaoConnection
spec.connectionRef.namestringyesName of the OpenBaoConnection or ClusterOpenBaoConnection. Example: openbao
Constraintslength: >=1, <=253
spec.creationPolicystringno"Create"How an object that already exists in OpenBao, and is not yet owned by this resource, is treated. Create (default): create the object; an existing one is refused with reason Conflict. Adopt: take over an existing object and never create one. CreateOrAdopt: create it, or take over an existing one. Settings that always exist in OpenBao (configuration singletons) need Adopt or CreateOrAdopt.
Constraintsone of: Create, Adopt, CreateOrAdopt
spec.deletionPolicystringno"Orphan"What happens in OpenBao when this resource is deleted. Orphan (default): the OpenBao object stays. Delete: the object is removed (a configuration singleton is reset to its defaults); data and key holders (mounts, namespaces, KV data, audit devices, endpoints, transit, PKI, SSH CA and TOTP keys, MFA methods, entities) are removed only while the resource carries the annotation openbaoconfig.io/allow-destructive-delete: "true". Kinds whose OpenBao object cannot be deleted reject Delete.
Constraintsone of: Delete, Orphan
spec.driftDetectionstringno"Enabled"Whether OpenBao is re-read periodically to detect and repair out-of-band changes. Enabled (default): re-read every driftInterval. Disabled: write only when the spec or a referenced Secret changes.
Constraintsone of: Enabled, Disabled
spec.driftIntervalstringnoHow often OpenBao is re-read for drift, as a duration of at least 30s. Default: the operator's interval for the kind (15m for kinds that grant access such as policies, auth mounts and roles, 1h for the rest), with jitter. Example: 30m
Constraintslength: <=32
CEL: duration(self) >= duration('30s') (driftInterval must be at least 30s)
spec.influxdbobjectnoinfluxdb holds the settings of influxdb-database-plugin.
ConstraintsCEL: !(has(self.pemBundleSecretRef) && has(self.pemJSONSecretRef)) (set at most one of pemBundleSecretRef and pemJSONSecretRef)
spec.influxdb.connectTimeoutstringnoconnectTimeout is the timeout for connecting to the database (`connect_timeout`), a duration. Example: `5s`.
Constraintspattern: ^(0|([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+)$
spec.influxdb.hoststringyeshost is the InfluxDB host (`host`). Example: `influxdb.monitoring.svc`.
Constraintslength: >=1, <=253
spec.influxdb.insecureTLSbooleannoinsecureTLS skips verification of the database server certificate (`insecure_tls`). Defaults to false.
spec.influxdb.pemBundleSecretRefobjectnopemBundleSecretRef selects the Secret key holding a PEM bundle with the client certificate, its private key and the CA chain (`pem_bundle`). Read from a Secret key; never stored in status. Write-only. Example: `{name: cassandra-client, key: bundle.pem}`.
spec.influxdb.pemBundleSecretRef.keystringyesKey in the Secret's data whose value is used. Example: password
Constraintslength: >=1, <=253
spec.influxdb.pemBundleSecretRef.namestringyesName of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials
Constraintslength: >=1, <=253
spec.influxdb.pemJSONSecretRefobjectnopemJSONSecretRef selects the Secret key holding the JSON output of an OpenBao PKI issue call (`pem_json`), as an alternative to pemBundleSecretRef. Read from a Secret key; never stored in status. Write-only. Example: `{name: cassandra-client, key: issue.json}`.
spec.influxdb.pemJSONSecretRef.keystringyesKey in the Secret's data whose value is used. Example: password
Constraintslength: >=1, <=253
spec.influxdb.pemJSONSecretRef.namestringyesName of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials
Constraintslength: >=1, <=253
spec.influxdb.portinteger (int32)noport is the InfluxDB port (`port`). 1-65535. Defaults to 8086.
Constraintsvalue: >=1, <=65535
spec.influxdb.tlsbooleannotls enables TLS to the database (`tls`). Defaults to false.
spec.influxdb.tlsMinVersionstringnotlsMinVersion is the minimum TLS version (`tls_min_version`). Allowed: tls10, tls11, tls12, tls13. Defaults to tls12.
Constraintsone of: tls10, tls11, tls12, tls13
spec.influxdb.usernamestringyesusername is the root user (`username`). Example: `openbao`.
Constraintslength: >=1, <=256
spec.influxdb.usernameTemplatestringnousernameTemplate is the template for the names of generated users (`username_template`). Empty uses the plugin default. Example: `{{.RoleName}}_{{random 8}}`.
Constraintslength: <=1024
spec.managementPolicystringno"Manage"Whether the operator writes to OpenBao. Manage (default): converge OpenBao to the spec, create and delete as the policies say. Observe: only read the object and report drift in the conditions; never write or delete.
Constraintsone of: Manage, Observe
spec.mountPathstringyesmountPath is the path of the database secrets engine mount, without leading or trailing slashes. Immutable. Example: `database`.
Constraintspattern: ^[A-Za-z0-9_.-]+(/[A-Za-z0-9_.-]+)*$
length: >=1, <=128
spec.mysqlobjectnomysql holds the settings of the mysql, mysql-aurora, mysql-rds and mysql-legacy database plugins.
spec.mysql.connectionURLstringyesconnectionURL is the connection string (`connection_url`). Use the `{{username}}` and `{{password}}` templates instead of literal credentials so the root password can be rotated. Example: `postgresql://{{username}}:{{password}}@pg.db.svc:5432/billing`.
Constraintslength: >=1, <=2048
CEL: !self.matches('^([A-Za-z][A-Za-z0-9+.-]*://)?[^/?#@:]*:[^/?#@]*@') || self.matches('^([A-Za-z][A-Za-z0-9+.-]*://)?[^/?#@:]*:[{][{]password[}][}]@') (connectionURL must not contain a literal password: use the {{password}} template and passwordSecretRef)
spec.mysql.maxConnectionLifetimestringnomaxConnectionLifetime is the maximum time a connection may be reused (`max_connection_lifetime`), a duration. 0 means no limit. Example: `30s`.
Constraintspattern: ^(0|([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+)$
spec.mysql.maxIdleConnectionsinteger (int32)nomaxIdleConnections is the maximum number of idle connections to the database (`max_idle_connections`). 0 means maxOpenConnections. Defaults to 0.
Constraintsvalue: >=0
spec.mysql.maxOpenConnectionsinteger (int32)nomaxOpenConnections is the maximum number of open connections to the database (`max_open_connections`). Defaults to 4.
Constraintsvalue: >=0
spec.mysql.tlsCAstringnotlsCA is the PEM-encoded CA certificate that verifies the MySQL server (`tls_ca`). Example: `-----BEGIN CERTIFICATE-----...`.
Constraintslength: <=65536
spec.mysql.tlsCertificateKeySecretRefobjectnotlsCertificateKeySecretRef selects the Secret key holding the PEM-encoded client certificate and private key (`tls_certificate_key`). Read from a Secret key; never stored in status. Write-only. Example: `{name: mysql-client, key: tls.pem}`.
spec.mysql.tlsCertificateKeySecretRef.keystringyesKey in the Secret's data whose value is used. Example: password
Constraintslength: >=1, <=253
spec.mysql.tlsCertificateKeySecretRef.namestringyesName of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials
Constraintslength: >=1, <=253
spec.mysql.tlsServerNamestringnotlsServerName overrides the server name used to verify the MySQL server certificate (`tls_server_name`). Example: `mysql.db.svc`.
Constraintslength: <=253
spec.mysql.tlsSkipVerifybooleannotlsSkipVerify disables verification of the MySQL server certificate (`tls_skip_verify`). Defaults to false.
spec.mysql.usernamestringnousername is the root user substituted for `{{username}}` (`username`). Example: `openbao`.
Constraintslength: <=256
spec.mysql.usernameTemplatestringnousernameTemplate is the template for the names of generated users (`username_template`). Empty uses the plugin default. Example: `{{.RoleName}}-{{random 8}}`.
Constraintslength: <=1024
spec.namestringnoname is the connection name in OpenBao. Defaults to metadata.name. Immutable. Example: `billing-postgres`.
Constraintspattern: ^\w([\w.-]*\w)?$
length: >=1, <=128
spec.namespacestringnoOpenBao namespace of the object, relative to the connection's base namespace; empty means the connection namespace itself. Segments are separated by "/", without leading or trailing slash. Immutable: it cannot be added, changed or removed after creation. Example: team-a/apps
Constraintspattern: ^[A-Za-z0-9_-][A-Za-z0-9._-]*(/[A-Za-z0-9_-][A-Za-z0-9._-]*)*$
length: <=256
spec.passwordPolicystringnopasswordPolicy is the OpenBao password policy that generates passwords for this connection (`password_policy`). Empty uses the plugin default. Example: `postgres`.
Constraintslength: <=128
spec.passwordSecretRefobjectnopasswordSecretRef selects the Secret key holding the root password (`password`). Read from a Secret key; never stored in status. Write-only: OpenBao never returns it; a change of the Secret is written again. Example: `{name: pg-root, key: password}`.
spec.passwordSecretRef.keystringyesKey in the Secret's data whose value is used. Example: password
Constraintslength: >=1, <=253
spec.passwordSecretRef.namestringyesName of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials
Constraintslength: >=1, <=253
spec.pluginConfigmap[string]stringnopluginConfig holds further connection settings by their OpenBao parameter name, for plugins without a section above. Values are sent as strings and must not be secret; top-level fields and secret material are rejected. Up to 64. Example: `{connection_url: "snowflake://{{username}}:{{password}}@acct/db"}`.
Constraintsproperties: <=64
spec.pluginNamestringyespluginName is the database plugin (`plugin_name`): a builtin plugin or one registered in the plugin catalog. Immutable. Example: `postgresql-database-plugin`.
Constraintslength: >=1, <=128
spec.pluginVersionstringnopluginVersion pins a version of a catalog plugin (`plugin_version`), in the canonical form OpenBao stores. Leave it empty for builtin plugins. Example: `v1.2.0`.
Constraintspattern: ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?$
length: <=64
spec.postgresqlobjectnopostgresql holds the settings of postgresql-database-plugin.
spec.postgresql.connectionURLstringyesconnectionURL is the connection string (`connection_url`). Use the `{{username}}` and `{{password}}` templates instead of literal credentials so the root password can be rotated. Example: `postgresql://{{username}}:{{password}}@pg.db.svc:5432/billing`.
Constraintslength: >=1, <=2048
CEL: !self.matches('^([A-Za-z][A-Za-z0-9+.-]*://)?[^/?#@:]*:[^/?#@]*@') || self.matches('^([A-Za-z][A-Za-z0-9+.-]*://)?[^/?#@:]*:[{][{]password[}][}]@') (connectionURL must not contain a literal password: use the {{password}} template and passwordSecretRef)
spec.postgresql.disableEscapingbooleannodisableEscaping turns off URL escaping of the username and password in the connection URL (`disable_escaping`). Defaults to false.
spec.postgresql.maxConnectionLifetimestringnomaxConnectionLifetime is the maximum time a connection may be reused (`max_connection_lifetime`), a duration. 0 means no limit. Example: `30s`.
Constraintspattern: ^(0|([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+)$
spec.postgresql.maxIdleConnectionsinteger (int32)nomaxIdleConnections is the maximum number of idle connections to the database (`max_idle_connections`). 0 means maxOpenConnections. Defaults to 0.
Constraintsvalue: >=0
spec.postgresql.maxOpenConnectionsinteger (int32)nomaxOpenConnections is the maximum number of open connections to the database (`max_open_connections`). Defaults to 4.
Constraintsvalue: >=0
spec.postgresql.passwordAuthenticationstringnopasswordAuthentication is how passwords are sent to the PostgreSQL server (`password_authentication`). Allowed: password, scram-sha-256. Defaults to password.
Constraintsone of: password, scram-sha-256
spec.postgresql.usernamestringnousername is the root user substituted for `{{username}}` (`username`). Example: `openbao`.
Constraintslength: <=256
spec.postgresql.usernameTemplatestringnousernameTemplate is the template for the names of generated users (`username_template`). Empty uses the plugin default. Example: `{{.RoleName}}-{{random 8}}`.
Constraintslength: <=1024
spec.privateKeySecretRefobjectnoprivateKeySecretRef selects the Secret key holding the root private key, for plugins that authenticate with a key pair (`private_key`). Read from a Secret key; never stored in status. Write-only. Example: `{name: snowflake-root, key: rsa_key.p8}`.
spec.privateKeySecretRef.keystringyesKey in the Secret's data whose value is used. Example: password
Constraintslength: >=1, <=253
spec.privateKeySecretRef.namestringyesName of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials
Constraintslength: >=1, <=253
spec.rootRotationStatements[]stringnorootRotationStatements are the database statements run to rotate the root credentials (`root_rotation_statements`). Empty uses the plugin default. Up to 64. Example: `["ALTER USER \"{{name}}\" WITH PASSWORD '{{password}}';"]`.
Constraintsitems: <=64
each item: length: <=4096
spec.rotateRootOnCreatebooleannorotateRootOnCreate rotates the root credentials once (`<mountPath>/rotate-root/<name>`), right after the connection is created, so only OpenBao knows them. The password or private key in the Secret is then stale: it is sent only when the connection is created again. Requires passwordSecretRef or privateKeySecretRef. Defaults to false.
spec.valkeyobjectnovalkey holds the settings of valkey-database-plugin and redis-database-plugin.
ConstraintsCEL: has(self.connectionURL) != (has(self.host) || has(self.port) || has(self.username)) (set either connectionURL or host, port and username)
spec.valkey.caCertstringnocaCert is the PEM-encoded CA certificate that verifies the server (`ca_cert`). Example: `-----BEGIN CERTIFICATE-----...`.
Constraintslength: <=65536
spec.valkey.connectionURLstringnoconnectionURL is the server URL (`connection_url`); it excludes host, port and username. Example: `valkeys://valkey.cache.svc:6379`.
Constraintslength: <=2048
CEL: !self.matches('^([A-Za-z][A-Za-z0-9+.-]*://)?[^/?#@:]*:[^/?#@]*@') || self.matches('^([A-Za-z][A-Za-z0-9+.-]*://)?[^/?#@:]*:[{][{]password[}][}]@') (connectionURL must not contain a literal password: use the {{password}} template and passwordSecretRef)
spec.valkey.hoststringnohost is the server host (`host`). Example: `valkey.cache.svc`.
Constraintslength: <=253
spec.valkey.insecureTLSbooleannoinsecureTLS skips verification of the server certificate (`insecure_tls`). Defaults to false.
spec.valkey.portinteger (int32)noport is the server port (`port`). 1-65535. Example: `6379`.
Constraintsvalue: >=1, <=65535
spec.valkey.tlsbooleannotls enables TLS (`tls`); it requires caCert. Defaults to false.
spec.valkey.usernamestringnousername is the root user (`username`). Example: `default`.
Constraintslength: <=256
spec.verifyConnectionbooleannoverifyConnection makes OpenBao connect to the database on every write of this connection (`verify_connection`). Sent with every write and never read back. Defaults to true.
statusobjectnostatus is the observed state of the database connection.
status.acquiredstringnoHow the operator came to own the object: Created (it created it) or Adopted (it took over an existing one). Empty until owned.
status.conditions[]objectnoCurrent state as conditions: Ready (the OpenBao object matches the spec) and Synced (the last reconcile succeeded), each with a reason such as Available, Drifted, Conflict, ConnectionNotReady or PermissionDenied, and the generation it describes.
Constraintslist type: map (keys: type)
status.conditions[]objectnoCondition contains details for one aspect of the current state of this API Resource.
status.conditions[].lastTransitionTimestring (date-time)yeslastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
status.conditions[].messagestringyesmessage is a human readable message indicating details about the transition. This may be an empty string.
Constraintslength: <=32768
status.conditions[].observedGenerationinteger (int64)noobservedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
Constraintsvalue: >=0
status.conditions[].reasonstringyesreason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
Constraintspattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
length: >=1, <=1024
status.conditions[].statusstringyesstatus of the condition, one of True, False, Unknown.
Constraintsone of: True, False, Unknown
status.conditions[].typestringyestype of condition in CamelCase or in foo.example.com/CamelCase.
Constraintspattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
length: <=316
status.idstringnoIdentifier OpenBao generated for the object (an entity, group or alias ID, or a mount accessor), for kinds that have one; other resources reference it. Example: 6c9f3e0a-1b2c-4d5e-8f90-123456789abc
status.namespacestringnoAbsolute OpenBao namespace the object was written in; empty means the root namespace. If it later differs from the spec, reconciling stops with reason NamespaceChanged. Example: team-a/apps
status.observedGenerationinteger (int64)noThe metadata.generation of this resource that the operator last reconciled.
status.pathstringnoFull OpenBao API path of the object, including its namespace, as last written; deletion uses it even after the spec changed. Example: team-a/sys/policies/acl/app-read
status.rotationNoncestringnoValue of the resource's rotation nonce when one-time inputs, such as a root credential that OpenBao rotates afterwards, were last sent; changing the nonce in the spec sends them again.
status.serverIDstringnoCluster ID of the OpenBao server the object was acquired on. If the connection later reaches another server, reconciling stops with reason ServerChanged and nothing is written or deleted. Example: 80f7de92-c12e-e960-4754-255c32fc6b53
status.writeOnlyHashstringnoKeyed hash (HMAC-SHA256) of the write-only inputs, such as passwords read from Secrets; a change forces a write. It never contains or reveals the values.