Delete expired keys globally for a specific namespace.
This task will delete expired keys from the Kestra KV store. By default, it will only delete expired keys, but you can choose to delete all keys by setting expiredOnly to false. You can also filter keys by a specific pattern and choose to include child namespaces.
type: "io.kestra.plugin.core.kv.PurgeKV"Examples
Delete expired keys globally for a specific namespace, with or without including child namespaces.
id: purge_kv_store
namespace: system
tasks:
- id: purge_kv
type: io.kestra.plugin.core.kv.PurgeKV
expiredOnly: true
namespaces:
- company
includeChildNamespaces: true
Properties
behavior PurgeBehaviorstring
{"type":"key","expiredOnly":true}Purge behavior
Defines how keys are purged.
includeChildNamespaces booleanstring
trueDelete keys from child namespaces
Defaults to true. This means that if you set namespaces to company, it will also delete keys from company.team, company.data, etc.
keyPattern string
Key pattern, e.g. 'AI_*'
Delete only keys matching the glob pattern.
namespacePattern string
Glob pattern for the namespaces to delete keys from
If not set (e.g., AI_*), all namespaces will be considered. Can't be used with namespaces - use one or the other.
namespaces array
List of namespaces to delete keys from
If not set, all namespaces will be considered. Can't be used with namespacePattern - use one or the other.
Outputs
size integer
The number of purged KV pairs
Definitions
io.kestra.plugin.core.kv.Key
type *Requiredobject
expiredOnly boolean
trueDelete only expired keys
io.kestra.plugin.core.kv.PurgeBehavior
io.kestra.plugin.core.kv.Version
type *Requiredobject
before string
The date before which versions should be purged.
Using this filter will never delete the last version of a KV to avoid accidental full data loss.
keepAmount integer
How much versions should be kept for each matching KV.
By default, every matching versions will be purged.