Identifiers
Kubernetes Pod Name (RFC 1123)
Validate Kubernetes pod names per the RFC 1123 DNS label rules — lowercase, ≤63 chars, no leading/trailing hyphen.
Try it in RegexPro →Available in
Pattern
regexengine-agnostic
^[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9])?$Raw source: ^[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9])?$
How it works
Stricter than the general hostname pattern: pod names must be LOWERCASE only (per K8s spec). [a-z0-9] for first char. (?:[a-z0-9\-]{0,61}[a-z0-9])? optionally allows up to 61 more chars ending in a non-hyphen. Total length ≤63 chars per RFC 1123 label limits.
Examples
Input
nginx-deployment-66b6c48dd5-abcd1Matches
nginx-deployment-66b6c48dd5-abcd1
Input
my-appMatches
my-app
Input
MyAppNo match
—Common use cases
- •Helm chart values validation
- •Custom controller / operator input checks
- •GitOps tooling sanity rules
- •Cluster admission webhook policy
Related patterns
AWS S3 Bucket Name
IdentifiersValidate AWS S3 bucket names per the standard naming rules: 3–63 chars, lowercase, alphanumeric + dots + hyphens.
Kubernetes Label (key=value)
IdentifiersValidate Kubernetes label `key=value` pairs per the K8s naming spec.
Hostname (Single Label, RFC 1123)
NetworkingValidate a single-label hostname per RFC 1123: 1–63 chars, letters/digits/hyphens, can't start or end with hyphen.
npm Package Name
IdentifiersValidate npm package names including scoped packages (@org/package), per the npm naming spec.