storage-class resource¶
Description¶
StorageClassResource manages a cluster-scoped StorageClass.
Source: internal/api/storage/v1/storage_class_rsrc.go:30
Example usage:
imports: {
kubernetes-storage-v1: 'github.com/cloudboss/unobin-library-kubernetes//api/storage/v1'
}
resources: {
example: kubernetes-storage-v1.storage-class {
# Set input fields here.
}
}
Inputs¶
metadata
object
object({
name: optional(string)
generate-name: optional(string)
labels: optional(map(string))
annotations: optional(map(string))
})
provisioner
string
parameters
optional(map(string))
reclaim-policy
optional(string)
volume-binding-mode
optional(string)
allow-volume-expansion
optional(boolean)
mount-options
optional(list(string))
allowed-topologies
optional(list(object))
optional(
list(
object({
match-label-expressions: optional(
list(
object({
key: optional(string)
values: optional(list(string))
})
)
)
})
)
)
ignore-annotations
optional(list(string))
ignore-labels
optional(list(string))
Input Constraints¶
Metadata rules
Exactly one of metadata.name or metadata.generate-name.
metadata.name must be a DNS subdomain of at most 253 bytes.
Rule logic
- Require
@core.is-match(input.metadata.name, '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$')
&& @core.length(input.metadata.name ?? '') <= 253
metadata.generate-name must be a valid DNS label prefix.
Rule logic
- Require
@core.is-match(input.metadata.generate-name, '^([a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?|[\\x00-\\x7f]-|[a-z0-9][-a-z0-9]{0,61}[\\x00-\\x7f]-)$')
metadata.labels keys must be Kubernetes qualified names.
Rule logic
- For each
input.metadata.labels ?? {}- Require
@core.is-match(@each.key, '^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?[A-Za-z0-9]([-A-Za-z0-9_.]{0,61}[A-Za-z0-9])?$')
&& @core.is-match(@each.key, '^([^/]{1,253}/)?[^/]+$')
metadata.labels values must be valid Kubernetes label values.
Rule logic
- For each
input.metadata.labels ?? {}- Require
@core.is-match(@each.value, '^([A-Za-z0-9]([-A-Za-z0-9_.]{0,61}[A-Za-z0-9])?)?$')
metadata.annotations keys must be qualified names after lowercasing.
Rule logic
- For each
input.metadata.annotations ?? {}- Require
@core.is-match(@each.key, '^([A-Za-z0-9İK]([-A-Za-z0-9İK]*[A-Za-z0-9İK])?(\\.[A-Za-z0-9İK]([-A-Za-z0-9İK]*[A-Za-z0-9İK])?)*/)?[A-Za-z0-9İK]([-A-Za-z0-9_.İK]{0,61}[A-Za-z0-9İK])?$')
&& @core.is-match(@each.key, '^([^/]{1,253}/)?[^/]+$')
Reclaim policy rules
reclaim-policy must be Recycle, Delete, or Retain.
Rule logic
- When
input.reclaim-policy != null- Require
input.reclaim-policy == 'Recycle'
|| input.reclaim-policy == 'Delete'
|| input.reclaim-policy == 'Retain'
Volume binding mode rules
volume-binding-mode must be Immediate or WaitForFirstConsumer.
Rule logic
- When
input.volume-binding-mode != null- Require
input.volume-binding-mode == 'Immediate'
|| input.volume-binding-mode == 'WaitForFirstConsumer'
Allowed topologies rules
allowed-topologies must contain at most one term.
Rule logic
- Require
@core.length(input.allowed-topologies ?? []) <= 1
Ignore annotations rules
ignore-annotations entries must be valid regular expressions.
Rule logic
- For each
input.ignore-annotations ?? []- Require
@core.is-format(@each.value, 'regex')
Ignore labels rules
ignore-labels entries must be valid regular expressions.
Rule logic
- For each
input.ignore-labels ?? []- Require
@core.is-format(@each.value, 'regex')
Outputs¶
server
string
api-version
string
kind
string
metadata
object
object({
name: string
generate-name: string
uid: string
labels: map(string)
annotations: map(string)
})
provisioner
string
parameters
map(string)
reclaim-policy
string
volume-binding-mode
string
allow-volume-expansion
boolean
mount-options
list(string)
allowed-topologies
list(object)
list(
object({
match-label-expressions: list(
object({
key: string
values: list(string)
})
)
})
)