259 lines
12 KiB
YAML
259 lines
12 KiB
YAML
---
|
|
apiVersion: apiextensions.k8s.io/v1
|
|
kind: CustomResourceDefinition
|
|
metadata:
|
|
annotations:
|
|
controller-gen.kubebuilder.io/version: v0.14.0
|
|
name: capacitybuffers.autoscaling.x-k8s.io
|
|
spec:
|
|
group: autoscaling.x-k8s.io
|
|
names:
|
|
kind: CapacityBuffer
|
|
listKind: CapacityBufferList
|
|
plural: capacitybuffers
|
|
shortNames:
|
|
- cb
|
|
singular: capacitybuffer
|
|
scope: Cluster
|
|
versions:
|
|
- additionalPrinterColumns:
|
|
- description: The strategy used for provisioning buffer capacity.
|
|
jsonPath: .spec.provisioningStrategy
|
|
name: Strategy
|
|
type: string
|
|
- description: The desired number of buffer chunks, if specified.
|
|
jsonPath: .spec.replicas
|
|
name: Replicas
|
|
type: integer
|
|
- description: The readiness status of the CapacityBuffer.
|
|
jsonPath: .status.conditions[?(@.type=='Ready')].reason
|
|
name: Status
|
|
type: string
|
|
- description: The age of the CapacityBuffer.
|
|
jsonPath: .metadata.creationTimestamp
|
|
name: Age
|
|
type: date
|
|
name: v1
|
|
schema:
|
|
openAPIV3Schema:
|
|
description: |-
|
|
CapacityBuffer is the configuration that an autoscaler can use to provision buffer capacity within a cluster.
|
|
This buffer is represented by placeholder pods that trigger the Cluster Autoscaler to scale up nodes in advance,
|
|
ensuring that there is always spare capacity available to handle sudden workload spikes or to speed up scaling events.
|
|
properties:
|
|
apiVersion:
|
|
description: |-
|
|
APIVersion defines the versioned schema of this representation of an object.
|
|
Servers should convert recognized schemas to the latest internal value, and
|
|
may reject unrecognized values.
|
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
|
type: string
|
|
kind:
|
|
description: |-
|
|
Kind is a string value representing the REST resource this object represents.
|
|
Servers may infer this from the endpoint the client submits requests to.
|
|
Cannot be updated.
|
|
In CamelCase.
|
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
spec:
|
|
description: Spec defines the desired characteristics of the buffer.
|
|
properties:
|
|
limits:
|
|
additionalProperties:
|
|
anyOf:
|
|
- type: integer
|
|
- type: string
|
|
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
|
x-kubernetes-int-or-string: true
|
|
description: |-
|
|
Limits, if specified, will limit the number of chunks created for this buffer
|
|
based on total resource requests (e.g., CPU, memory). If there are no other
|
|
limitations for the number of chunks (i.e., `replicas` or `percentage` are not set),
|
|
this will be used to create as many chunks as fit into these limits.
|
|
type: object
|
|
percentage:
|
|
description: |-
|
|
Percentage defines the desired buffer capacity as a percentage of the
|
|
`scalableRef`'s current replicas. This is only applicable if `scalableRef` is set.
|
|
The absolute number of replicas is calculated from the percentage by rounding up to a minimum of 1.
|
|
For example, if `scalableRef` has 10 replicas and `percentage` is 20, 2 buffer chunks will be created.
|
|
This field is mutually exclusive with `replicas`.
|
|
format: int32
|
|
maximum: 100
|
|
minimum: 0
|
|
type: integer
|
|
podTemplateRef:
|
|
description: |-
|
|
PodTemplateRef is a reference to a PodTemplate resource in the same namespace
|
|
that declares the shape of a single chunk of the buffer. The pods created
|
|
from this template will be used as placeholder pods for the buffer capacity.
|
|
Exactly one of `podTemplateRef`, `scalableRef` should be specified.
|
|
properties:
|
|
name:
|
|
description: Name of the object.
|
|
minLength: 1
|
|
type: string
|
|
required:
|
|
- name
|
|
type: object
|
|
provisioningStrategy:
|
|
default: buffer.x-k8s.io/active-capacity
|
|
description: |-
|
|
ProvisioningStrategy defines how the buffer is utilized.
|
|
"buffer.x-k8s.io/active-capacity" is the default strategy, where the buffer actively scales up the cluster by creating placeholder pods.
|
|
enum:
|
|
- buffer.x-k8s.io/active-capacity
|
|
type: string
|
|
replicas:
|
|
description: |-
|
|
Replicas defines the desired number of buffer chunks to provision.
|
|
If neither `replicas` nor `percentage` is set, as many chunks as fit within
|
|
defined resource limits (if any) will be created. If both are set, the maximum
|
|
of the two will be used.
|
|
This field is mutually exclusive with `percentage` when `scalableRef` is set.
|
|
format: int32
|
|
minimum: 0
|
|
type: integer
|
|
scalableRef:
|
|
description: |-
|
|
ScalableRef is a reference to an object of a kind that has a scale subresource
|
|
and specifies its label selector field. This allows the CapacityBuffer to
|
|
manage the buffer by scaling an existing scalable resource.
|
|
Exactly one of `podTemplateRef`, `scalableRef` should be specified.
|
|
properties:
|
|
apiGroup:
|
|
description: |-
|
|
APIGroup of the scalable object.
|
|
Empty string for the core API group
|
|
type: string
|
|
kind:
|
|
description: Kind of the scalable object (e.g., "Deployment",
|
|
"StatefulSet").
|
|
minLength: 1
|
|
type: string
|
|
name:
|
|
description: Name of the scalable object.
|
|
minLength: 1
|
|
type: string
|
|
required:
|
|
- kind
|
|
- name
|
|
type: object
|
|
type: object
|
|
status:
|
|
description: Status represents the current state of the buffer and its
|
|
readiness for autoprovisioning.
|
|
properties:
|
|
conditions:
|
|
description: |-
|
|
Conditions provide a standard mechanism for reporting the buffer's state.
|
|
The "Ready" condition indicates if the buffer is successfully provisioned
|
|
and active. Other conditions may report on various aspects of the buffer's
|
|
health and provisioning process.
|
|
items:
|
|
description: "Condition contains details for one aspect of the current
|
|
state of this API Resource.\n---\nThis struct is intended for
|
|
direct use as an array at the field path .status.conditions. For
|
|
example,\n\n\n\ttype FooStatus struct{\n\t // Represents the
|
|
observations of a foo's current state.\n\t // Known .status.conditions.type
|
|
are: \"Available\", \"Progressing\", and \"Degraded\"\n\t //
|
|
+patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t
|
|
\ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\"
|
|
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t
|
|
\ // other fields\n\t}"
|
|
properties:
|
|
lastTransitionTime:
|
|
description: |-
|
|
lastTransitionTime is the last time the condition transitioned from one status to another.
|
|
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
|
|
format: date-time
|
|
type: string
|
|
message:
|
|
description: |-
|
|
message is a human readable message indicating details about the transition.
|
|
This may be an empty string.
|
|
maxLength: 32768
|
|
type: string
|
|
observedGeneration:
|
|
description: |-
|
|
observedGeneration represents the .metadata.generation that the condition was set based upon.
|
|
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
|
|
with respect to the current state of the instance.
|
|
format: int64
|
|
minimum: 0
|
|
type: integer
|
|
reason:
|
|
description: |-
|
|
reason contains a programmatic identifier indicating the reason for the condition's last transition.
|
|
Producers of specific condition types may define expected values and meanings for this field,
|
|
and whether the values are considered a guaranteed API.
|
|
The value should be a CamelCase string.
|
|
This field may not be empty.
|
|
maxLength: 1024
|
|
minLength: 1
|
|
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
|
|
type: string
|
|
status:
|
|
description: status of the condition, one of True, False, Unknown.
|
|
enum:
|
|
- "True"
|
|
- "False"
|
|
- Unknown
|
|
type: string
|
|
type:
|
|
description: |-
|
|
type of condition in CamelCase or in foo.example.com/CamelCase.
|
|
---
|
|
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be
|
|
useful (see .node.status.conditions), the ability to deconflict is important.
|
|
The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
|
|
maxLength: 316
|
|
pattern: ^([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_.]*)?[A-Za-z0-9])$
|
|
type: string
|
|
required:
|
|
- lastTransitionTime
|
|
- message
|
|
- reason
|
|
- status
|
|
- type
|
|
type: object
|
|
type: array
|
|
x-kubernetes-list-map-keys:
|
|
- type
|
|
x-kubernetes-list-type: map
|
|
podTemplateGeneration:
|
|
description: |-
|
|
PodTemplateGeneration is the observed generation of the PodTemplate, used
|
|
to determine if the status is up-to-date with the desired `spec.podTemplateRef`.
|
|
format: int64
|
|
type: integer
|
|
podTemplateRef:
|
|
description: |-
|
|
PodTemplateRef is the observed reference to the PodTemplate that was used
|
|
to provision the buffer. If this field is not set, and the `conditions`
|
|
indicate an error, it provides details about the error state.
|
|
properties:
|
|
name:
|
|
description: Name of the object.
|
|
minLength: 1
|
|
type: string
|
|
required:
|
|
- name
|
|
type: object
|
|
replicas:
|
|
description: Replicas is the actual number of buffer chunks currently
|
|
provisioned.
|
|
format: int32
|
|
type: integer
|
|
type: object
|
|
required:
|
|
- spec
|
|
type: object
|
|
served: true
|
|
storage: true
|
|
subresources:
|
|
status: {}
|