Skip to content

Secrets engine resources · Kind catalogue · Examples

PKIRole

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

PKIRole manages a certificate role of a PKI secrets engine at `<mount>/roles/<name>`: which names, key types, lifetimes and usages certificates issued or signed through it (`<mount>/issue/<name>`, `<mount>/sign/<name>`) may have.

Example:

spec:
  connectionRef:
    name: openbao
  mountPath: pki-int
  name: web-server
  allowedDomains: [example.com]
  allowSubdomains: true
  maxTTL: 2160h

Example

examples/secrets/pkirole.yaml
# A certificate role on the intermediate CA mount that issues 24-hour certificates for subdomains of
# openbao-config.example.com, including a domain templated from the requester's entity metadata.
apiVersion: secrets.openbaoconfig.io/v1alpha1
kind: PKIRole
metadata:
  name: obco-web
  namespace: openbao-config
spec:
  connectionRef:
    kind: OpenBaoConnection
    name: openbao
  creationPolicy: CreateOrAdopt
  deletionPolicy: Delete
  driftDetection: Enabled
  mountPath: obco-pki-int
  name: obco-web
  issuer:
    issuerRef:
      name: obco-int-2026
  ttl: 24h
  maxTTL: 720h
  allowLocalhost: false
  allowedDomains:
    - openbao-config.example.com
    - "{{identity.entity.metadata.team}}.openbao-config.example.com"
  allowedDomainsTemplate: true
  allowGlobsInIdentityTemplates: false
  allowBareDomains: false
  allowSubdomains: true
  allowGlobDomains: false
  allowWildcardCertificates: false
  allowAnyName: false
  enforceHostnames: true
  allowIPSANs: true
  allowedIPSANsCIDR:
    - 10.0.0.0/8
  allowedURISANs:
    - spiffe://openbao-config.example.com/*
  allowedURISANsTemplate: false
  allowedOtherSANs:
    - 1.3.6.1.4.1.311.20.2.3;UTF8:*@openbao-config.example.com
  allowedSerialNumbers:
    - obco-*
  allowedUserIDs:
    - "*"
  serverFlag: true
  clientFlag: true
  codeSigningFlag: false
  emailProtectionFlag: false
  keyType: ec
  keyBits: 256
  signatureBits: 256
  usePSS: false
  keyUsage:
    - DigitalSignature
    - KeyAgreement
  extKeyUsage:
    - ServerAuth
    - ClientAuth
  extKeyUsageOIDs:
    - 1.3.6.1.5.5.7.3.1
  useCSRCommonName: true
  useCSRSANs: true
  ou:
    - Platform
  organization:
    - OBCO Sandbox
  country:
    - DE
  locality:
    - Berlin
  province:
    - Berlin
  streetAddress:
    - Example Street 1
  postalCode:
    - "10115"
  generateLease: false
  noStore: false
  requireCN: true
  cnValidations:
    - hostname
  policyIdentifiers:
    - 1.3.6.1.4.1.44947.1.1.1
  basicConstraintsValidForNonCA: false
  notBeforeDuration: 30s
  notBefore: "2026-01-01T00:00:00Z"
  notBeforeBound: permit
  notAfter: "2030-01-01T00:00:00Z"
  notAfterBound: ttl-limited
---
apiVersion: secrets.openbaoconfig.io/v1alpha1
kind: PKIRole
metadata:
  name: obco-acme
  namespace: openbao-config
spec:
  connectionRef:
    name: openbao
  mountPath: obco-pki-int
  issuer:
    issuerName: obco-int-2026
  allowedDomains:
    - acme.openbao-config.example.com
  allowSubdomains: true
  maxTTL: 2160h

On GitHub: pkirole.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 role of a PKI secrets engine at `<mountPath>/roles/<name>`: the policy for certificates that clients issue or sign through it (cert-manager, ACME or the issue and sign endpoints). Fields left unset take the OpenBao default.
ConstraintsCEL: has(self.mountPath) == has(oldSelf.mountPath) && (!has(self.mountPath) || 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: !has(self.ttl) || !has(self.maxTTL) || duration(self.maxTTL) == duration('0s') || duration(self.ttl) <= duration(self.maxTTL) (ttl must not exceed maxTTL)
CEL: !has(self.keyBits) || (self.?keyType.orValue('rsa') == 'rsa' ? self.keyBits in [2048, 3072, 4096, 8192] : self.?keyType.orValue('rsa') == 'ec' ? self.keyBits in [224, 256, 384, 521] : self.?keyType.orValue('rsa') == 'mldsa' && self.keyBits in [44, 65, 87]) (keyBits must be 2048, 3072, 4096 or 8192 for keyType rsa (the default), 224, 256, 384 or 521 for ec, 44, 65 or 87 for mldsa, and is not allowed for ed25519 or any)
CEL: !(self.?generateLease.orValue(false) && self.?noStore.orValue(false)) (generateLease requires the certificate to be stored; unset noStore)
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.allowAnyNamebooleannoallowAnyName allows any common name and DNS SAN (`allow_any_name`). Defaults to false.
spec.allowBareDomainsbooleannoallowBareDomains allows certificates for the allowed domains themselves (`allow_bare_domains`). Defaults to false.
spec.allowGlobDomainsbooleannoallowGlobDomains treats allowedDomains entries as glob patterns (`allow_glob_domains`). Defaults to false.
spec.allowGlobsInIdentityTemplatesbooleannoallowGlobsInIdentityTemplates evaluates glob patterns inside rendered identity templates (`allow_globs_in_identity_templates`). Defaults to false.
spec.allowIPSANsbooleannoallowIPSANs allows IP subject alternative names (`allow_ip_sans`). Defaults to true.
spec.allowLocalhostbooleannoallowLocalhost allows localhost and localdomain as names (`allow_localhost`). Defaults to true.
spec.allowSubdomainsbooleannoallowSubdomains allows certificates for subdomains of the allowed domains (`allow_subdomains`). Defaults to false.
spec.allowWildcardCertificatesbooleannoallowWildcardCertificates allows wildcard names such as `*.example.com` (`allow_wildcard_certificates`). Defaults to true.
spec.allowedDomains[]stringnoallowedDomains are the domains certificates may be issued for (`allowed_domains`), interpreted by the allow flags below. Example: `[example.com]`.
Constraintsitems: <=256
list type: set
each item: pattern: ^[^,]+$
each item: length: <=256
spec.allowedDomainsTemplatebooleannoallowedDomainsTemplate allows identity templates in allowedDomains (`allowed_domains_template`). Defaults to false.
spec.allowedIPSANsCIDR[]stringnoallowedIPSANsCIDR limits IP subject alternative names to these networks (`allowed_ip_sans_cidr`), in canonical form (10.0.0.0/8, not 10.1.2.3/8). Example: `[10.0.0.0/8]`.
Constraintsitems: <=64
list type: set
CEL: self.all(c, isCIDR(c) && cidr(c) == cidr(c).masked()) (entries must be canonical CIDRs)
each item: length: <=64
spec.allowedOtherSANs[]stringnoallowedOtherSANs are the custom subject alternative names allowed, in the form `<oid>;<type>:<value>` (`allowed_other_sans`); `*` allows any. Example: `["1.3.6.1.4.1.311.20.2.3;UTF8:*"]`.
Constraintsitems: <=64
list type: set
each item: pattern: ^[^,]+$
each item: length: <=512
spec.allowedSerialNumbers[]stringnoallowedSerialNumbers are the subject serialNumber values allowed (`allowed_serial_numbers`); globs are supported. Example: `["DEV-*"]`.
Constraintsitems: <=64
list type: set
each item: pattern: ^[^,]+$
each item: length: <=256
spec.allowedURISANs[]stringnoallowedURISANs are the URI subject alternative names allowed (`allowed_uri_sans`); globs are supported. Example: `["spiffe://example.com/*"]`.
Constraintsitems: <=256
list type: set
each item: pattern: ^[^,]+$
each item: length: <=512
spec.allowedURISANsTemplatebooleannoallowedURISANsTemplate allows identity templates in allowedURISANs (`allowed_uri_sans_template`). Defaults to false.
spec.allowedUserIDs[]stringnoallowedUserIDs are the subject UID values allowed (`allowed_user_ids`); globs are supported. Example: `[alice]`.
Constraintsitems: <=64
list type: set
each item: pattern: ^[^,]+$
each item: length: <=256
spec.basicConstraintsValidForNonCAbooleannobasicConstraintsValidForNonCA marks the basic constraints extension valid on non-CA certificates (`basic_constraints_valid_for_non_ca`). Defaults to false.
spec.clientFlagbooleannoclientFlag adds the client authentication extended key usage (`client_flag`). Defaults to true.
spec.cnValidations[]stringnocnValidations lists the checks applied to the common name (`cn_validations`): email, hostname, or disabled alone. Defaults to email and hostname. Example: `[hostname]`.
Constraintsitems: <=2
list type: set
each item: one of: email, hostname, disabled
spec.codeSigningFlagbooleannocodeSigningFlag adds the code signing extended key usage (`code_signing_flag`). Defaults to false.
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.country[]stringnocountry is the country of issued certificates (`country`). Example: `[DE]`.
Constraintsitems: <=16
list type: set
each item: pattern: ^[^,]+$
each item: length: <=256
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.emailProtectionFlagbooleannoemailProtectionFlag adds the email protection extended key usage (`email_protection_flag`). Defaults to false.
spec.enforceHostnamesbooleannoenforceHostnames requires names to be valid hostnames (`enforce_hostnames`). Defaults to true.
spec.extKeyUsage[]stringnoextKeyUsage lists additional extended key usages (`ext_key_usage`). Example: `[TimeStamping]`.
Constraintsitems: <=14
list type: set
each item: one of: ServerAuth, ClientAuth, CodeSigning, EmailProtection, IPSECEndSystem, IPSECTunnel, IPSECUser, TimeStamping, OCSPSigning, MicrosoftServerGatedCrypto, NetscapeServerGatedCrypto, MicrosoftCommercialCodeSigning, MicrosoftKernelCodeSigning, Any
spec.extKeyUsageOIDs[]stringnoextKeyUsageOIDs lists additional extended key usages as OIDs (`ext_key_usage_oids`). Example: `["1.3.6.1.5.5.7.3.8"]`.
Constraintsitems: <=32
list type: set
each item: pattern: ^[0-9]+(\.[0-9]+)+$
each item: length: <=128
spec.generateLeasebooleannogenerateLease attaches a lease to issued certificates so they are revoked when the lease ends (`generate_lease`); requires noStore unset. Defaults to false.
spec.issuerobjectnoissuer selects the issuer that signs certificates of this role (`issuer_ref`). Defaults to the mount's default issuer. Example: `{issuerRef: {name: int-2026}}`.
ConstraintsCEL: has(self.issuerName) != has(self.issuerRef) (set exactly one of issuerName and issuerRef)
spec.issuer.issuerNamestringnoissuerName is the name or ID of the issuer in OpenBao. Example: `int-2026`.
Constraintslength: >=1, <=128
spec.issuer.issuerRefobjectnoissuerRef names a PKIIssuer in the same namespace and PKI mount; it must be Ready. Example: `{name: int-2026}`.
spec.issuer.issuerRef.namestringyesName of the referenced object, in the same namespace as this resource. Example: my-app
Constraintslength: >=1, <=253
spec.keyBitsinteger (int32)nokeyBits is the key size required of the certificate key (`key_bits`): 2048, 3072, 4096 or 8192 for rsa; 224, 256, 384 or 521 for ec; 44, 65 or 87 for mldsa. Not for ed25519 or any. Defaults to 2048 for rsa, 256 for ec and 44 for mldsa.
Constraintsone of: 44, 65, 87, 224, 256, 384, 521, 2048, 3072, 4096, 8192
spec.keyTypestringnokeyType is the algorithm required of the certificate key (`key_type`); `any` accepts every type. Allowed: rsa, ec, ed25519, mldsa, any. Defaults to rsa.
Constraintsone of: rsa, ec, ed25519, mldsa, any
spec.keyUsage[]stringnokeyUsage lists the key usages of issued certificates (`key_usage`). Defaults to DigitalSignature, KeyAgreement and KeyEncipherment. Example: `[DigitalSignature, KeyEncipherment]`.
Constraintsitems: <=9
list type: set
each item: one of: DigitalSignature, ContentCommitment, KeyEncipherment, DataEncipherment, KeyAgreement, CertSign, CRLSign, EncipherOnly, DecipherOnly
spec.locality[]stringnolocality is the locality (city) of issued certificates (`locality`). Example: `[Berlin]`.
Constraintsitems: <=16
list type: set
each item: pattern: ^[^,]+$
each item: length: <=256
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.maxTTLstringnomaxTTL is the longest validity period a request may ask for (`max_ttl`), a duration. Defaults to the mount's max lease TTL. Example: `2160h`.
Constraintspattern: ^(0|([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+)$
spec.mountPathstringno"pki"mountPath is the path of the PKI secrets engine mount. Defaults to `pki`. Immutable. Example: `pki-int`.
Constraintspattern: ^[A-Za-z0-9_.-]+(/[A-Za-z0-9_.-]+)*$
length: <=128
spec.namestringnoname is the role name in OpenBao. Defaults to metadata.name. Immutable. Example: `web-server`.
Constraintspattern: ^[A-Za-z0-9_]([A-Za-z0-9_.-]*[A-Za-z0-9_])?$
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.noStorebooleannonoStore skips storing issued certificates (`no_store`), which then cannot be listed or revoked by serial. Defaults to false.
spec.notAfterstringnonotAfter sets a fixed expiry on issued certificates, as a UTC timestamp (`not_after`). Example: `2027-01-01T00:00:00Z`.
Constraintspattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$
spec.notAfterBoundstringnonotAfterBound controls whether requests may set not_after (`not_after_bound`): `permit`, `ttl-limited`, `forbid`, or a UTC timestamp no certificate may exceed. Defaults to permit. Example: `ttl-limited`.
Constraintspattern: ^(permit|ttl-limited|forbid|[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z)$
spec.notBeforestringnonotBefore sets a fixed not-before time on issued certificates, as a UTC timestamp (`not_before`). Example: `2026-01-01T00:00:00Z`.
Constraintspattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$
spec.notBeforeBoundstringnonotBeforeBound controls whether requests may set not_before (`not_before_bound`): `permit`, `duration` (only through not_before_duration) or `forbid`. Defaults to permit.
Constraintsone of: permit, duration, forbid
spec.notBeforeDurationstringnonotBeforeDuration backdates issued certificates (`not_before_duration`), a duration. Defaults to `30s`.
Constraintspattern: ^(0|([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+)$
spec.organization[]stringnoorganization is the organization of issued certificates (`organization`). Example: `[Example Corp]`.
Constraintsitems: <=16
list type: set
each item: pattern: ^[^,]+$
each item: length: <=256
spec.ou[]stringnoou is the organizational unit of issued certificates (`ou`). Example: `[Platform]`.
Constraintsitems: <=16
list type: set
each item: pattern: ^[^,]+$
each item: length: <=256
spec.policyIdentifiers[]stringnopolicyIdentifiers are certificate policy OIDs added to issued certificates (`policy_identifiers`). Example: `["1.3.6.1.4.1.44947.1.1.1"]`.
Constraintsitems: <=32
list type: set
each item: pattern: ^[0-9]+(\.[0-9]+)+$
each item: length: <=128
spec.postalCode[]stringnopostalCode is the postal code of issued certificates (`postal_code`). Example: `["10115"]`.
Constraintsitems: <=16
list type: set
each item: pattern: ^[^,]+$
each item: length: <=256
spec.province[]stringnoprovince is the province (state) of issued certificates (`province`). Example: `[Berlin]`.
Constraintsitems: <=16
list type: set
each item: pattern: ^[^,]+$
each item: length: <=256
spec.requireCNbooleannorequireCN rejects requests without a common name (`require_cn`). Defaults to true.
spec.serverFlagbooleannoserverFlag adds the server authentication extended key usage (`server_flag`). Defaults to true.
spec.signatureBitsinteger (int32)nosignatureBits selects the signature hash (`signature_bits`). Allowed: 256, 384, 512. Unset lets OpenBao pick one from the issuer key.
Constraintsone of: 256, 384, 512
spec.streetAddress[]stringnostreetAddress is the street address of issued certificates (`street_address`). Example: `[Main Street 1]`.
Constraintsitems: <=16
list type: set
each item: pattern: ^[^,]+$
each item: length: <=256
spec.ttlstringnottl is the default validity period of issued certificates (`ttl`), a duration. Must not exceed maxTTL. Defaults to the mount's default lease TTL. Example: `720h`.
Constraintspattern: ^(0|([0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h))+)$
spec.useCSRCommonNamebooleannouseCSRCommonName takes the common name from the CSR when signing (`use_csr_common_name`). Defaults to true.
spec.useCSRSANsbooleannouseCSRSANs takes the subject alternative names from the CSR when signing (`use_csr_sans`). Defaults to true.
spec.usePSSbooleannousePSS signs with RSASSA-PSS when the issuer key is rsa (`use_pss`). Defaults to false.
statusobjectnostatus is the observed state of the PKI role.
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.