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:
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: openbaoExample¶
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.
| Field | Type | Required | Default | Description | Validation |
|---|---|---|---|---|---|
spec | object | yes | spec 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 | []string | no | allowedRoles 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: <=256list type: set each item: length: <=128 | |
spec.cassandra | object | no | cassandra holds the settings of cassandra-database-plugin. | ConstraintsCEL:!(has(self.pemBundleSecretRef) && has(self.pemJSONSecretRef)) (set at most one of pemBundleSecretRef and pemJSONSecretRef) | |
spec.cassandra.connectTimeout | string | no | connectTimeout 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.consistency | string | no | consistency is the consistency level for statements (`consistency`). Example: `LOCAL_QUORUM`. | Constraintslength: <=32 | |
spec.cassandra.hosts | []string | yes | hosts are the Cassandra hosts to connect to (`hosts`, comma-joined). 1-64. Example: `[cassandra-0.db.svc, cassandra-1.db.svc]`. | Constraintsitems: >=1, <=64each item: length: <=253 | |
spec.cassandra.insecureTLS | boolean | no | insecureTLS skips verification of the database server certificate (`insecure_tls`). Defaults to false. | ||
spec.cassandra.localDatacenter | string | no | localDatacenter makes the driver prefer hosts of this datacenter (`local_datacenter`). Example: `dc1`. | Constraintslength: <=128 | |
spec.cassandra.pemBundleSecretRef | object | no | pemBundleSecretRef 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.key | string | yes | Key in the Secret's data whose value is used. Example: password | Constraintslength: >=1, <=253 | |
spec.cassandra.pemBundleSecretRef.name | string | yes | Name of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials | Constraintslength: >=1, <=253 | |
spec.cassandra.pemJSONSecretRef | object | no | pemJSONSecretRef 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.key | string | yes | Key in the Secret's data whose value is used. Example: password | Constraintslength: >=1, <=253 | |
spec.cassandra.pemJSONSecretRef.name | string | yes | Name of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials | Constraintslength: >=1, <=253 | |
spec.cassandra.port | integer (int32) | no | port is the native protocol port (`port`). 1-65535. Defaults to 9042. | Constraintsvalue: >=1, <=65535 | |
spec.cassandra.protocolVersion | integer (int32) | no | protocolVersion is the CQL protocol version (`protocol_version`). Defaults to 2. Example: `4`. | Constraintsvalue: >=1 | |
spec.cassandra.skipVerification | boolean | no | skipVerification skips the consistency check of the root credentials on connect (`skip_verification`). Defaults to false. | ||
spec.cassandra.socketKeepAlive | string | no | socketKeepAlive 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.tls | boolean | no | tls enables TLS to the database (`tls`). Defaults to false. | ||
spec.cassandra.tlsMinVersion | string | no | tlsMinVersion is the minimum TLS version (`tls_min_version`). Allowed: tls10, tls11, tls12, tls13. Defaults to tls12. | Constraintsone of:tls10, tls11, tls12, tls13 | |
spec.cassandra.tlsServerName | string | no | tlsServerName overrides the server name used to verify the Cassandra server certificate (`tls_server_name`). Example: `cassandra.db.svc`. | Constraintslength: <=253 | |
spec.cassandra.username | string | no | username is the root user (`username`). Example: `openbao`. | Constraintslength: <=256 | |
spec.cassandra.usernameTemplate | string | no | usernameTemplate is the template for the names of generated users (`username_template`). Empty uses the plugin default. Example: `{{.RoleName}}_{{random 8}}`. | Constraintslength: <=1024 | |
spec.connectionRef | object | yes | Connection used to reach and log in to OpenBao. Immutable. | ||
spec.connectionRef.kind | string | no | "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.name | string | yes | Name of the OpenBaoConnection or ClusterOpenBaoConnection. Example: openbao | Constraintslength: >=1, <=253 | |
spec.creationPolicy | string | no | "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.deletionPolicy | string | no | "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.driftDetection | string | no | "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.driftInterval | string | no | How 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: <=32CEL: duration(self) >= duration('30s') (driftInterval must be at least 30s) | |
spec.influxdb | object | no | influxdb holds the settings of influxdb-database-plugin. | ConstraintsCEL:!(has(self.pemBundleSecretRef) && has(self.pemJSONSecretRef)) (set at most one of pemBundleSecretRef and pemJSONSecretRef) | |
spec.influxdb.connectTimeout | string | no | connectTimeout 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.host | string | yes | host is the InfluxDB host (`host`). Example: `influxdb.monitoring.svc`. | Constraintslength: >=1, <=253 | |
spec.influxdb.insecureTLS | boolean | no | insecureTLS skips verification of the database server certificate (`insecure_tls`). Defaults to false. | ||
spec.influxdb.pemBundleSecretRef | object | no | pemBundleSecretRef 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.key | string | yes | Key in the Secret's data whose value is used. Example: password | Constraintslength: >=1, <=253 | |
spec.influxdb.pemBundleSecretRef.name | string | yes | Name of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials | Constraintslength: >=1, <=253 | |
spec.influxdb.pemJSONSecretRef | object | no | pemJSONSecretRef 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.key | string | yes | Key in the Secret's data whose value is used. Example: password | Constraintslength: >=1, <=253 | |
spec.influxdb.pemJSONSecretRef.name | string | yes | Name of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials | Constraintslength: >=1, <=253 | |
spec.influxdb.port | integer (int32) | no | port is the InfluxDB port (`port`). 1-65535. Defaults to 8086. | Constraintsvalue: >=1, <=65535 | |
spec.influxdb.tls | boolean | no | tls enables TLS to the database (`tls`). Defaults to false. | ||
spec.influxdb.tlsMinVersion | string | no | tlsMinVersion is the minimum TLS version (`tls_min_version`). Allowed: tls10, tls11, tls12, tls13. Defaults to tls12. | Constraintsone of:tls10, tls11, tls12, tls13 | |
spec.influxdb.username | string | yes | username is the root user (`username`). Example: `openbao`. | Constraintslength: >=1, <=256 | |
spec.influxdb.usernameTemplate | string | no | usernameTemplate is the template for the names of generated users (`username_template`). Empty uses the plugin default. Example: `{{.RoleName}}_{{random 8}}`. | Constraintslength: <=1024 | |
spec.managementPolicy | string | no | "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.mountPath | string | yes | mountPath 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.mysql | object | no | mysql holds the settings of the mysql, mysql-aurora, mysql-rds and mysql-legacy database plugins. | ||
spec.mysql.connectionURL | string | yes | connectionURL 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, <=2048CEL: !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.maxConnectionLifetime | string | no | maxConnectionLifetime 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.maxIdleConnections | integer (int32) | no | maxIdleConnections is the maximum number of idle connections to the database (`max_idle_connections`). 0 means maxOpenConnections. Defaults to 0. | Constraintsvalue: >=0 | |
spec.mysql.maxOpenConnections | integer (int32) | no | maxOpenConnections is the maximum number of open connections to the database (`max_open_connections`). Defaults to 4. | Constraintsvalue: >=0 | |
spec.mysql.tlsCA | string | no | tlsCA is the PEM-encoded CA certificate that verifies the MySQL server (`tls_ca`). Example: `-----BEGIN CERTIFICATE-----...`. | Constraintslength: <=65536 | |
spec.mysql.tlsCertificateKeySecretRef | object | no | tlsCertificateKeySecretRef 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.key | string | yes | Key in the Secret's data whose value is used. Example: password | Constraintslength: >=1, <=253 | |
spec.mysql.tlsCertificateKeySecretRef.name | string | yes | Name of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials | Constraintslength: >=1, <=253 | |
spec.mysql.tlsServerName | string | no | tlsServerName overrides the server name used to verify the MySQL server certificate (`tls_server_name`). Example: `mysql.db.svc`. | Constraintslength: <=253 | |
spec.mysql.tlsSkipVerify | boolean | no | tlsSkipVerify disables verification of the MySQL server certificate (`tls_skip_verify`). Defaults to false. | ||
spec.mysql.username | string | no | username is the root user substituted for `{{username}}` (`username`). Example: `openbao`. | Constraintslength: <=256 | |
spec.mysql.usernameTemplate | string | no | usernameTemplate is the template for the names of generated users (`username_template`). Empty uses the plugin default. Example: `{{.RoleName}}-{{random 8}}`. | Constraintslength: <=1024 | |
spec.name | string | no | name is the connection name in OpenBao. Defaults to metadata.name. Immutable. Example: `billing-postgres`. | Constraintspattern:^\w([\w.-]*\w)?$length: >=1, <=128 | |
spec.namespace | string | no | OpenBao 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.passwordPolicy | string | no | passwordPolicy is the OpenBao password policy that generates passwords for this connection (`password_policy`). Empty uses the plugin default. Example: `postgres`. | Constraintslength: <=128 | |
spec.passwordSecretRef | object | no | passwordSecretRef 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.key | string | yes | Key in the Secret's data whose value is used. Example: password | Constraintslength: >=1, <=253 | |
spec.passwordSecretRef.name | string | yes | Name of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials | Constraintslength: >=1, <=253 | |
spec.pluginConfig | map[string]string | no | pluginConfig 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.pluginName | string | yes | pluginName 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.pluginVersion | string | no | pluginVersion 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.postgresql | object | no | postgresql holds the settings of postgresql-database-plugin. | ||
spec.postgresql.connectionURL | string | yes | connectionURL 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, <=2048CEL: !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.disableEscaping | boolean | no | disableEscaping turns off URL escaping of the username and password in the connection URL (`disable_escaping`). Defaults to false. | ||
spec.postgresql.maxConnectionLifetime | string | no | maxConnectionLifetime 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.maxIdleConnections | integer (int32) | no | maxIdleConnections is the maximum number of idle connections to the database (`max_idle_connections`). 0 means maxOpenConnections. Defaults to 0. | Constraintsvalue: >=0 | |
spec.postgresql.maxOpenConnections | integer (int32) | no | maxOpenConnections is the maximum number of open connections to the database (`max_open_connections`). Defaults to 4. | Constraintsvalue: >=0 | |
spec.postgresql.passwordAuthentication | string | no | passwordAuthentication 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.username | string | no | username is the root user substituted for `{{username}}` (`username`). Example: `openbao`. | Constraintslength: <=256 | |
spec.postgresql.usernameTemplate | string | no | usernameTemplate is the template for the names of generated users (`username_template`). Empty uses the plugin default. Example: `{{.RoleName}}-{{random 8}}`. | Constraintslength: <=1024 | |
spec.privateKeySecretRef | object | no | privateKeySecretRef 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.key | string | yes | Key in the Secret's data whose value is used. Example: password | Constraintslength: >=1, <=253 | |
spec.privateKeySecretRef.name | string | yes | Name of the Kubernetes Secret, in the same namespace as this resource. Example: openbao-credentials | Constraintslength: >=1, <=253 | |
spec.rootRotationStatements | []string | no | rootRotationStatements 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: <=64each item: length: <=4096 | |
spec.rotateRootOnCreate | boolean | no | rotateRootOnCreate 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.valkey | object | no | valkey 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.caCert | string | no | caCert is the PEM-encoded CA certificate that verifies the server (`ca_cert`). Example: `-----BEGIN CERTIFICATE-----...`. | Constraintslength: <=65536 | |
spec.valkey.connectionURL | string | no | connectionURL is the server URL (`connection_url`); it excludes host, port and username. Example: `valkeys://valkey.cache.svc:6379`. | Constraintslength: <=2048CEL: !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.host | string | no | host is the server host (`host`). Example: `valkey.cache.svc`. | Constraintslength: <=253 | |
spec.valkey.insecureTLS | boolean | no | insecureTLS skips verification of the server certificate (`insecure_tls`). Defaults to false. | ||
spec.valkey.port | integer (int32) | no | port is the server port (`port`). 1-65535. Example: `6379`. | Constraintsvalue: >=1, <=65535 | |
spec.valkey.tls | boolean | no | tls enables TLS (`tls`); it requires caCert. Defaults to false. | ||
spec.valkey.username | string | no | username is the root user (`username`). Example: `default`. | Constraintslength: <=256 | |
spec.verifyConnection | boolean | no | verifyConnection 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. | ||
status | object | no | status is the observed state of the database connection. | ||
status.acquired | string | no | How the operator came to own the object: Created (it created it) or Adopted (it took over an existing one). Empty until owned. | ||
status.conditions | []object | no | Current 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[] | object | no | Condition contains details for one aspect of the current state of this API Resource. | ||
status.conditions[].lastTransitionTime | string (date-time) | yes | lastTransitionTime 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[].message | string | yes | message is a human readable message indicating details about the transition. This may be an empty string. | Constraintslength: <=32768 | |
status.conditions[].observedGeneration | integer (int64) | no | observedGeneration 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[].reason | string | yes | reason 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[].status | string | yes | status of the condition, one of True, False, Unknown. | Constraintsone of:True, False, Unknown | |
status.conditions[].type | string | yes | type 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.id | string | no | Identifier 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.namespace | string | no | Absolute 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.observedGeneration | integer (int64) | no | The metadata.generation of this resource that the operator last reconciled. | ||
status.path | string | no | Full 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.rotationNonce | string | no | Value 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.serverID | string | no | Cluster 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.writeOnlyHash | string | no | Keyed 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. |