{
  "description": "CapacityBuffer is the configuration that an autoscaler can use to provision buffer capacity within a cluster.\nThis buffer is represented by placeholder pods that trigger the Cluster Autoscaler to scale up nodes in advance,\nensuring 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.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ]
    },
    "spec": {
      "additionalProperties": false,
      "description": "Spec defines the desired characteristics of the buffer.",
      "properties": {
        "limits": {
          "additionalProperties": {
            "oneOf": [
              {
                "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                "type": "string"
              },
              {
                "type": "integer"
              }
            ],
            "x-kubernetes-int-or-string": true
          },
          "description": "Limits, if specified, will limit the number of chunks created for this buffer\nbased on total resource requests (e.g., CPU, memory). If there are no other\nlimitations for the number of chunks (i.e., `replicas` or `percentage` are not set),\nthis will be used to create as many chunks as fit into these limits.",
          "type": [
            "object",
            "null"
          ]
        },
        "percentage": {
          "description": "Percentage defines the desired buffer capacity as a percentage of the\n`scalableRef`'s current replicas. This is only applicable if `scalableRef` is set.\nThe absolute number of replicas is calculated from the percentage by rounding up to a minimum of 1.\nFor example, if `scalableRef` has 10 replicas and `percentage` is 20, 2 buffer chunks will be created.",
          "format": "int32",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "podTemplateRef": {
          "additionalProperties": false,
          "description": "PodTemplateRef is a reference to a PodTemplate resource in the same namespace\nthat declares the shape of a single chunk of the buffer. The pods created\nfrom this template will be used as placeholder pods for the buffer capacity.\nExactly one of `podTemplateRef`, `scalableRef` should be specified.",
          "properties": {
            "name": {
              "description": "Name of the object.",
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "type": [
            "object",
            "null"
          ]
        },
        "provisioningStrategy": {
          "default": "buffer.x-k8s.io/active-capacity",
          "description": "ProvisioningStrategy defines how the buffer is utilized.\n\"buffer.x-k8s.io/active-capacity\" is the default strategy, where the buffer actively scales up the cluster by creating placeholder pods.",
          "type": [
            "string",
            "null"
          ]
        },
        "replicas": {
          "description": "Replicas defines the desired number of buffer chunks to provision.\nIf neither `replicas` nor `percentage` is set, as many chunks as fit within\ndefined resource limits (if any) will be created. If both are set, the maximum\nof the two will be used.",
          "format": "int32",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "scalableRef": {
          "additionalProperties": false,
          "description": "ScalableRef is a reference to an object of a kind that has a scale subresource\nand specifies its label selector field. This allows the CapacityBuffer to\nmanage the buffer by scaling an existing scalable resource.\nExactly one of `podTemplateRef`, `scalableRef` should be specified.",
          "properties": {
            "apiGroup": {
              "description": "APIGroup of the scalable object.\nEmpty string for the core API group",
              "type": [
                "string",
                "null"
              ]
            },
            "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",
            "null"
          ]
        }
      },
      "type": "object",
      "x-kubernetes-validations": [
        {
          "message": "If X is set, replicas or limits must also be set",
          "rule": "!has(self.podTemplateRef) || has(self.replicas) || has(self.limits)"
        },
        {
          "message": "You must define both PodTemplateRef and ScalableRef",
          "rule": "!(has(self.podTemplateRef) \u0026\u0026 has(self.scalableRef))"
        }
      ]
    },
    "status": {
      "additionalProperties": false,
      "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.\nThe \"Ready\" condition indicates if the buffer is successfully provisioned\nand active. Other conditions may report on various aspects of the buffer's\nhealth and provisioning process.",
          "items": {
            "additionalProperties": false,
            "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.\nThis 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.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis 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.\n---\nMany .condition.type values are consistent across resources like Available, but because arbitrary conditions can be\nuseful (see .node.status.conditions), the ability to deconflict is important.\nThe 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",
            "null"
          ],
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "x-kubernetes-list-type": "map"
        },
        "podTemplateGeneration": {
          "description": "PodTemplateGeneration is the observed generation of the PodTemplate, used\nto determine if the status is up-to-date with the desired `spec.podTemplateRef`.",
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "podTemplateRef": {
          "additionalProperties": false,
          "description": "PodTemplateRef is the observed reference to the PodTemplate that was used\nto provision the buffer. If this field is not set, and the `conditions`\nindicate an error, it provides details about the error state.",
          "properties": {
            "name": {
              "description": "Name of the object.",
              "minLength": 1,
              "type": "string"
            }
          },
          "required": [
            "name"
          ],
          "type": [
            "object",
            "null"
          ]
        },
        "provisioningStrategy": {
          "description": "ProvisioningStrategy defines how the buffer should be utilized.",
          "type": [
            "string",
            "null"
          ]
        },
        "replicas": {
          "description": "Replicas is the actual number of buffer chunks currently provisioned.",
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}