core.openbaoconfig.io examples¶
Each kind shows its curated example first, then any variants, then the generated sample with every spec field set. The fields are described in the API reference.
ClusterOpenBaoConnection¶
The platform team's connection logs in to the Kubernetes auth mount as a dedicated ServiceAccount of the operator namespace, with a short-lived TokenRequest token for the openbao audience, which the OpenBao role must expect.
examples/core/clusteropenbaoconnection.yaml
# The platform team's connection logs in to the Kubernetes auth mount as a dedicated ServiceAccount of the operator
# namespace, with a short-lived TokenRequest token for the openbao audience, which the OpenBao role must expect.
# Resources in namespaces labelled openbaoconfig.io/platform=true use it with connectionRef kind
# ClusterOpenBaoConnection. The -injectedidentity and -filesystem variants log in as the operator itself.
apiVersion: core.openbaoconfig.io/v1alpha1
kind: ClusterOpenBaoConnection
metadata:
name: platform-sa
spec:
serverRef:
name: openbao
auth:
kubernetes:
mountPath: kubernetes
role: platform-configurer
serviceAccountRef:
namespace: openbao-config-operator
name: platform-configurer
audiences:
- openbao
allowedNamespaces:
matchLabels:
openbaoconfig.io/platform: "true"
examples/core/clusteropenbaoconnection-filesystem.yaml
# The token is read from a file in the operator pod at every login, such as the token sink of an agent sidecar
# that keeps it renewed (for example one injected through the chart's podAnnotations).
apiVersion: core.openbaoconfig.io/v1alpha1
kind: ClusterOpenBaoConnection
metadata:
name: platform-agent
spec:
serverRef:
name: openbao
auth:
token:
filesystem:
path: /vault/secrets/token
allowedNamespaces:
matchLabels:
openbaoconfig.io/platform: "true"
examples/core/clusteropenbaoconnection-injectedidentity.yaml
# The operator logs in as itself with the token of the projected volume the chart mounts by default
# (injectedIdentity.projectedToken). The OpenBao role must bind the operator's ServiceAccount and the audience
# set in injectedIdentity.projectedToken.audience (default openbao-config-operator).
apiVersion: core.openbaoconfig.io/v1alpha1
kind: ClusterOpenBaoConnection
metadata:
name: platform
spec:
serverRef:
name: openbao
auth:
kubernetes:
role: openbao-config-operator
injectedIdentity:
tokenPath: /var/run/secrets/openbao/token
allowedNamespaces:
matchLabels:
openbaoconfig.io/platform: "true"
---
apiVersion: core.openbaoconfig.io/v1alpha1
kind: ClusterOpenBaoConnection
metadata:
name: platform-jwt
spec:
serverRef:
name: openbao
auth:
jwt:
mountPath: jwt-k8s
role: openbao-config-operator
injectedIdentity:
tokenPath: /var/run/secrets/openbao/token
allowedNamespaces:
matchLabels:
openbaoconfig.io/platform: "true"
examples-generated/core/clusteropenbaoconnection.yaml
# ClusterOpenBaoConnection (core.openbaoconfig.io/v1alpha1)
# ClusterOpenBaoConnection is a cluster-scoped login to an OpenBaoServer owned by the platform team, usable by
# resources in every namespace its allowedNamespaces selects (spec.connectionRef.kind: ClusterOpenBaoConnection).
#
# Generated from the CRD by hack/samplegen (make samples); do not edit. Every spec field is set to a placeholder that
# passes the CRD's OpenAPI and CEL validation, so the sample shows the shape of the kind, not a working configuration.
# The Secrets after it hold fake values for the secret references. Required spec fields: auth, serverRef.
#
# Reference: https://alexandrust88.github.io/openbao-config-operator/reference/api/core/#clusteropenbaoconnection
# Curated example: examples/core/clusteropenbaoconnection.yaml
apiVersion: core.openbaoconfig.io/v1alpha1
kind: ClusterOpenBaoConnection
metadata:
name: example
spec:
allowedNamespaces:
matchExpressions:
- key: example
operator: In
values:
- example
matchLabels:
example: example
auth:
token:
secretRef:
key: value
name: clusteropenbaoconnection-secret-ref
namespace: openbao-config
authNamespace: example
namespace: example
serverRef:
name: example
---
apiVersion: v1
kind: Secret
metadata:
name: clusteropenbaoconnection-secret-ref
namespace: openbao-config
stringData:
value: fake-value-not-a-secret
type: Opaque
OpenBaoConnection¶
A tenant connection logs in as a ServiceAccount of its own namespace with a TokenRequest token for the OpenBao audience.
examples/core/openbaoconnection.yaml
# A tenant connection logs in as a ServiceAccount of its own namespace with a TokenRequest token for the
# OpenBao audience. The OpenBaoServer must select this namespace and allow the audience. Injected identity and file
# sources exist only on ClusterOpenBaoConnection.
apiVersion: core.openbaoconfig.io/v1alpha1
kind: OpenBaoConnection
metadata:
name: openbao
namespace: team-a
spec:
serverRef:
name: openbao
namespace: tenants/team-a
auth:
kubernetes:
role: team-a-configurer
serviceAccountRef:
name: openbao-configurer
audiences:
- openbao
examples-generated/core/openbaoconnection.yaml
# OpenBaoConnection (core.openbaoconfig.io/v1alpha1)
# OpenBaoConnection is a tenant's login to an OpenBaoServer, usable only by resources in its own Kubernetes namespace
# through spec.connectionRef.
#
# Generated from the CRD by hack/samplegen (make samples); do not edit. Every spec field is set to a placeholder that
# passes the CRD's OpenAPI and CEL validation, so the sample shows the shape of the kind, not a working configuration.
# The Secrets after it hold fake values for the secret references. Required spec fields: auth, serverRef.
#
# Reference: https://alexandrust88.github.io/openbao-config-operator/reference/api/core/#openbaoconnection
# Curated example: examples/core/openbaoconnection.yaml
apiVersion: core.openbaoconfig.io/v1alpha1
kind: OpenBaoConnection
metadata:
name: example
namespace: openbao-config
spec:
auth:
token:
secretRef:
key: value
name: openbaoconnection-secret-ref
authNamespace: example
namespace: example
serverRef:
name: example
---
apiVersion: v1
kind: Secret
metadata:
name: openbaoconnection-secret-ref
namespace: openbao-config
stringData:
value: fake-value-not-a-secret
type: Opaque
OpenBaoEndpoint¶
Manages any OpenBao path the typed kinds do not cover; here a KV v2 secrets engine mount.
examples/core/openbaoendpoint.yaml
# Manages any OpenBao path the typed kinds do not cover; here a KV v2 secrets engine mount.
# OpenBaoEndpoint is destructive: path and deletePath are free-form, so deletionPolicy Delete takes effect only
# with the annotation openbaoconfig.io/allow-destructive-delete: "true" (otherwise reason DeleteGuarded).
apiVersion: core.openbaoconfig.io/v1alpha1
kind: OpenBaoEndpoint
metadata:
name: team-kv
namespace: openbao-config
annotations:
openbaoconfig.io/allow-destructive-delete: "true"
spec:
connectionRef:
name: openbao
path: sys/mounts/team-kv
readPath: sys/mounts/team-kv/tune
deletionPolicy: Delete
data:
type: kv
options:
version: "2"
examples-generated/core/openbaoendpoint.yaml
# OpenBaoEndpoint (core.openbaoconfig.io/v1alpha1)
# OpenBaoEndpoint writes any JSON payload to any OpenBao API path and keeps it in sync: the escape hatch for settings
# without a typed kind.
#
# Generated from the CRD by hack/samplegen (make samples); do not edit. Every spec field is set to a placeholder that
# passes the CRD's OpenAPI and CEL validation, so the sample shows the shape of the kind, not a working configuration.
# The Secrets after it hold fake values for the secret references. Required spec fields: connectionRef, path.
#
# Reference: https://alexandrust88.github.io/openbao-config-operator/reference/api/core/#openbaoendpoint
# Curated example: examples/core/openbaoendpoint.yaml
apiVersion: core.openbaoconfig.io/v1alpha1
kind: OpenBaoEndpoint
metadata:
name: example
namespace: openbao-config
spec:
connectionRef:
kind: OpenBaoConnection
name: openbao
creationPolicy: Create
data:
key: value
dataSecretRef:
key: value
name: openbaoendpoint-data-secret-ref
deletePath: example
deletionPolicy: Orphan
disableDelete: true
disableRead: true
driftDetection: Enabled
driftInterval: 1h
ignoreAbsentFields: true
managementPolicy: Manage
namespace: example
path: example
readPath: example
writeOnlyFields:
- example
---
apiVersion: v1
kind: Secret
metadata:
name: openbaoendpoint-data-secret-ref
namespace: openbao-config
stringData:
value: fake-value-not-a-secret
type: Opaque
OpenBaoServer¶
The platform team declares the OpenBao server once.
examples/core/openbaoserver.yaml
# The platform team declares the OpenBao server once. Tenants in namespaces labelled
# openbaoconfig.io/tenant=true may connect to it with OpenBaoConnections that request the openbao token audience;
# the Kubernetes API server's own audiences are always refused.
apiVersion: core.openbaoconfig.io/v1alpha1
kind: OpenBaoServer
metadata:
name: openbao
spec:
address: https://openbao.openbao.svc:8200
caBundle:
configMapRef:
namespace: openbao
name: openbao-ca
allowedNamespaces:
matchLabels:
openbaoconfig.io/tenant: "true"
allowedAudiences:
- openbao
rateLimit:
qps: 50
burst: 100
requestTimeout: 30s
examples-generated/core/openbaoserver.yaml
# OpenBaoServer (core.openbaoconfig.io/v1alpha1)
# OpenBaoServer is a cluster-scoped OpenBao server that the platform team makes available to connections.
#
# Generated from the CRD by hack/samplegen (make samples); do not edit. Every spec field is set to a placeholder that
# passes the CRD's OpenAPI and CEL validation, so the sample shows the shape of the kind, not a working configuration.
# The Secrets after it hold fake values for the secret references. Required spec fields: address.
#
# Reference: https://alexandrust88.github.io/openbao-config-operator/reference/api/core/#openbaoserver
# Curated example: examples/core/openbaoserver.yaml
apiVersion: core.openbaoconfig.io/v1alpha1
kind: OpenBaoServer
metadata:
name: example
spec:
address: https://openbao.example.com:8200
allowInsecureHTTP: true
allowedAudiences:
- example
allowedNamespaces:
matchExpressions:
- key: example
operator: In
values:
- example
matchLabels:
example: example
caBundle:
secretRef:
key: ca.crt
name: openbaoserver-secret-ref
namespace: openbao-config
rateLimit:
burst: 1
qps: 1
requestTimeout: 1h
---
apiVersion: v1
kind: Secret
metadata:
name: openbaoserver-secret-ref
namespace: openbao-config
stringData:
ca.crt: fake-value-not-a-secret
type: Opaque