mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-07-27 02:23:29 +00:00
Run the E2E test on kind / get-go-version (push) Failing after 50s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Successful in 12s
Main CI / Build (push) Failing after 41s
Wildcard namespaces: Log warning on empty resolution
2.0 KiB
2.0 KiB
title, layout
| title | layout |
|---|---|
| Namespace Glob Patterns | docs |
When using --include-namespaces and --exclude-namespaces flags with backup and restore commands, you can use glob patterns to match multiple namespaces.
Note: If the resolution of namespace patterns results in no namespaces, the backup will succeed with a warning.
Supported Patterns
Velero supports the following glob pattern characters:
-
*- Matches any sequence of charactersvelero backup create my-backup --include-namespaces "app-*" # Matches: app-prod, app-staging, app-dev, etc. -
?- Matches exactly one charactervelero backup create my-backup --include-namespaces "ns?" # Matches: ns1, ns2, nsa, but NOT ns10 -
[abc]- Matches any single character in the bracketsvelero backup create my-backup --include-namespaces "ns[123]" # Matches: ns1, ns2, ns3 -
[a-z]- Matches any single character in the rangevelero backup create my-backup --include-namespaces "ns[a-c]" # Matches: nsa, nsb, nsc
Unsupported Patterns
The following patterns are not supported and will cause validation errors:
**- Consecutive asterisks|- Alternation (regex operator)()- Grouping (regex operators)!- Negation{}- Brace expansion,- Comma (used in brace expansion)
Special Cases
*alone means "all namespaces" and is not expanded- Empty brackets
[]are invalid - Unmatched or unclosed brackets will cause validation errors
Examples
Combine patterns with include and exclude flags:
# Backup all production namespaces except test
velero backup create prod-backup \
--include-namespaces "*-prod" \
--exclude-namespaces "test-*"
# Backup specific numbered namespaces
velero backup create numbered-backup \
--include-namespaces "app-[0-9]"
# Restore namespaces matching multiple patterns
velero restore create my-restore \
--from-backup my-backup \
--include-namespaces "frontend-*,backend-*"