A KongVault with backend: konnect stores its secrets in a Konnect Config Store, which is
identified by a config_store_id. Instead of creating the Config Store out-of-band and copying its ID into
spec.config, you can manage the Config Store with a KonnectConfigStore resource and reference it from
spec.configStoreRef.
Config Store-backed Vaults
Resources involved
Four Kubernetes resources describe the setup:
|
Resource |
Purpose |
|---|---|
KonnectConfigStore
|
Creates the Config Store container in Konnect that holds the secret entries. It manages the container only, never the secret values inside it. |
KongReferenceGrant
|
Authorizes the cluster-scoped KongVault to reference the namespaced KonnectConfigStore.
|
KongVault
|
Creates a Vault with the konnect backend and resolves spec.configStoreRef into the config_store_id of the
Vault configuration sent to Konnect.
|
KongCertificate
|
Holds the public certificate inline and a vault reference in place of the private key. |
By default, the secret value itself is the one step that isn’t declarative: it’s written straight to Konnect, out-of-band, to avoid storing the secret value in etcd. If the secret value is already stored in a Kubernetes Secret, you can sync it to the Config Store instead.
Sync secrets from Kubernetes v2.4+
A KonnectConfigStoreSync keeps entries of a KonnectConfigStore in sync with the data of a Kubernetes Secret. The
Secret stays the source of truth, so certificate rotation, for example by cert-manager, is only a change to the Secret
data: Kong Operator updates the entry in place and the vault references don’t change. The sync uses the
control plane and authentication of the referenced KonnectConfigStore.
spec.mode controls how the Secret data is mapped to entries:
|
Mode |
Behavior |
|---|---|
Combined (default)
|
Validates that the certificate and key form a valid pair, then writes both to a single entry as a JSON object with
certificate and key fields. By default, the certificate is read from tls.crt and the key from tls.key.
Reference the fields with {vault://PREFIX/STORE_KEY/certificate} and {vault://PREFIX/STORE_KEY/key}.
Use this mode for TLS certificates, because the pair is always updated at once.
|
Split
|
Writes each listed Secret field to its own entry, referenced with {vault://PREFIX/STORE_KEY}. Use this mode for
single-field and non-TLS values.
|
The following rules apply to a KonnectConfigStoreSync:
- The block that matches
spec.modemust be set, so usecombined: {}to accept theCombineddefaults. - If you don’t set a store key, it’s derived from the
KonnectConfigStoreSyncnamespace and name, in the formatk8s-<len(namespace)>-<namespace>-<len(name)>-<name>. InSplitmode, the field name is appended.status.referenceslists the suffix to use after the Vault prefix in each vault reference. spec.mode,spec.configStoreRef, and store keys are immutable once set. To change them, create a newKonnectConfigStoreSync, move your references to its entries, then delete the old one.spec.secretRefis mutable and doesn’t change the entry names.- Referencing a
KonnectConfigStoreor a Secret in another namespace requires aKongReferenceGrantin that namespace. - Each entry value is limited to 5120 bytes and each store key to 512 bytes. In
Combinedmode, the limit applies to the JSON object that holds both PEM values. - If the Secret is missing or its data is invalid, nothing is written and the last synced value keeps serving.
- Status, logs, and events never contain the secret value.
status.entriesonly reports a hash, the size, the certificate expiry, and timestamps for each entry.
For a complete example, see Sync a Kubernetes TLS Secret to a Konnect Config Store.
Field behavior
spec.configStoreRefis only supported withbackend: konnect, and it’s mutually exclusive with settingconfig_store_idunderspec.config.spec.prefixis what you use in vault references later, and it’s immutable after creation.KongVaultis cluster-scoped andKonnectConfigStoreis namespaced, so the reference always crosses a namespace boundary and requires aKongReferenceGrant.- Kong Operator reports the outcome of the reference in the
ConfigStoreRefValidcondition.
Security boundary
Referencing a secret from a Config Store moves it out of every place you manage with GitOps, but it doesn’t remove it from Konnect:
|
Location |
Holds the secret? |
|---|---|
| Git repository and Kubernetes manifests | No, only the vault reference. |
| Kubernetes API and etcd |
No, only the vault reference, when values are written directly to the Config Store.
With KonnectConfigStoreSync, the source Kubernetes Secret also contains the secret value.
|
| Konnect certificate object | No, only the vault reference. |
| Konnect Config Store | Yes. Access is controlled by Konnect roles and permissions. |
| Kong Gateway data plane memory | Yes, while the secret is in use. Konnect resolves the reference after the data plane connects to the control plane. |
Anyone who can write secrets into the Config Store can replace the key that your listener serves, so treat Config Store write access as equivalent to certificate issuance rights.
If you sync the secret from Kubernetes, the secret value is also stored in the Kubernetes Secret, and therefore in the Kubernetes API and etcd. The Konnect certificate object still only holds the vault reference.
Lifecycle and deletion
-
v2.4+ Kong Operator doesn’t delete a Config Store that still holds secrets, because a deleted key breaks every certificate that references it. The
KonnectConfigStorestays inTerminating, which also blocks the deletion of its namespace, and reportsProgrammed=Falsewith reasonDeletionBlocked. Deletion proceeds automatically once you remove the secrets from the Config Store in Konnect. To leave the Config Store and its secrets in Konnect instead, remove thegateway.konghq.com/konnect-cleanupfinalizer from theKonnectConfigStore.In Kong Operator 2.3, deleting the
KonnectConfigStoredeletes the Config Store in Konnect along with every secret stored in it, including keys that other Vaults or certificates still reference. - v2.4+
spec.deletionPolicyof aKonnectConfigStoreSynccontrols what happens to its entries when the sync is deleted. WithOrphan, the default, the entries are kept. WithDelete, the entries are deleted unless aKongCertificatestill references them, in which case the sync reportsSynced=Falsewith reasonEntryInUseand waits. This check only coversKongCertificateresources, so make sure that nothing else uses the entries. While theKonnectConfigStoreis being deleted, the sync doesn’t write or delete entries. spec.configStoreRefis mutable. Removing it clears theConfigStoreRefValidcondition and leaves anyconfig_store_idyou set directly underspec.configuntouched.- Removing the
KongReferenceGrantstops further updates to a programmedKongVault, but the Vault that already exists in Konnect, including itsconfig_store_id, isn’t rolled back or removed. - Rotating a key is a Config Store operation: update the secret value in place, and the vault reference keeps
resolving without any change to your Kubernetes resources. If the entry is managed by a
KonnectConfigStoreSync, update the Kubernetes Secret instead.