API Reference
Packages
kubecloudscaler.cloud/common
Package common contains shared API Schema definitions for the kubecloudscaler project.
Package common contains shared API Schema definitions for the kubecloudscaler project.
Package common provides shared API Schema definitions for the kubecloudscaler project.
FixedPeriod
FixedPeriod defines a fixed time period for scaling operations.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
startTime string | Pattern: ^\d\{4\}-(0?[1-9]|1[0,1,2])-(0?[1-9]|[12][0-9]|3[01]) ([0-1]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9]$ | ||
endTime string | Pattern: ^\d\{4\}-(0?[1-9]|1[0,1,2])-(0?[1-9]|[12][0-9]|3[01]) ([0-1]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9]$ | ||
timezone string | |||
once boolean | Run once at StartTime | ||
gracePeriod string | Grace period in seconds for deployments before scaling down | Pattern: ^\d*s$ | |
reverse boolean | Reverse the period |
RecurringPeriod
RecurringPeriod defines a recurring time period for scaling operations.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
days string array | |||
startTime string | Pattern: ^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$ | ||
endTime string | Pattern: ^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$ | ||
timezone string | |||
once boolean | Run once at StartTime | ||
gracePeriod string | Pattern: ^\d*s$ | ||
reverse boolean | Reverse the period |
Resources
Resources defines the configuration for managed resources.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
types string array | Types of resources K8s: deployments, statefulsets, … (default: deployments) GCP: VM-instances, … (default: vm-instances) | ||
names string array | Names of resources to manage | ||
labelSelector LabelSelector | Labels selectors |
ScalerPeriod
ScalerPeriod defines a scaling period with time constraints and replica limits.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
type string | Enum: [down up] | ||
time TimePeriod | |||
minReplicas integer | Minimum replicas | ||
maxReplicas integer | Maximum replicas | ||
name string | Name of the period | Pattern: ^(|[a-zA-Z0-9][a-zA-Z0-9_-]*)$ |
ScalerStatus
ScalerStatus defines the observed state of Scaler.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
currentPeriod ScalerStatusPeriod | |||
comments string |
ScalerStatusFailed
ScalerStatusFailed represents a failed scaling operation.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
kind string | |||
name string | |||
reason string |
ScalerStatusPeriod
ScalerStatusPeriod defines the current period status for a scaler.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
spec RecurringPeriod | |||
specSHA string | |||
type string | |||
success ScalerStatusSuccess array | |||
failed ScalerStatusFailed array |
ScalerStatusSuccess
ScalerStatusSuccess represents a successful scaling operation.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
kind string | |||
name string | |||
comment string |
TimePeriod
TimePeriod defines the time configuration for a scaling period.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
recurring RecurringPeriod | |||
fixed FixedPeriod |
kubecloudscaler.cloud/v1alpha3
Package v1alpha3 contains API Schema definitions for the kubecloudscaler v1alpha3 API group.
Package v1alpha3 contains API Schema definitions for the v1alpha3 API group.
Resource Types
Flow
Flow is the Schema for the flows API
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string | kubecloudscaler.cloud/v1alpha3 | ||
kind string | Flow | ||
metadata ObjectMeta | Refer to Kubernetes API documentation for fields of metadata. | ||
spec FlowSpec | spec defines the desired state of Flow | ||
status FlowStatus | status defines the observed state of Flow |
FlowList
FlowList contains a list of Flow
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string | kubecloudscaler.cloud/v1alpha3 | ||
kind string | FlowList | ||
metadata ListMeta | Refer to Kubernetes API documentation for fields of metadata. | ||
items Flow array |
FlowResource
FlowResource defines a resource within a flow.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
name string | |||
delay string | Delay is the duration to delay the start of the period It is a duration in minutes It is optional and if not provided, the period will start at the start time of the period | Pattern: ^\d*m$ |
FlowSpec
FlowSpec defines the desired state of Flow
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
periods ScalerPeriod array | Time period to scale | ||
resources Resources | Resources | ||
flows Flows array |
FlowStatus
FlowStatus defines the observed state of Flow.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
conditions Condition array | conditions represent the current state of the Flow resource. Each condition has a unique type and reflects the status of a specific aspect of the resource. Standard condition types include: - “Available”: the resource is fully functional - “Progressing”: the resource is being created or updated - “Degraded”: the resource failed to reach or maintain its desired state The status of each condition is one of True, False, or Unknown. |
Flows
Flows defines a flow configuration with period and resources.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
periodName string | |||
resources FlowResource array |
Gcp
Gcp is the Schema for the gcps API
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string | kubecloudscaler.cloud/v1alpha3 | ||
kind string | Gcp | ||
metadata ObjectMeta | Refer to Kubernetes API documentation for fields of metadata. | ||
spec GcpSpec | spec defines the desired state of Gcp | ||
status ScalerStatus | status defines the observed state of Gcp |
GcpConfig
GcpConfig defines the configuration for GCP resource management.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
projectId string | ProjectID | ||
region string | Region | ||
authSecret string | AuthSecret name | ||
restoreOnDelete boolean | Restore resource state on CR deletion (default: true) | true | |
waitForOperation boolean | Wait for operation to complete | ||
defaultPeriodType string | Default status for resources | down | Enum: [down up] |
GcpResource
GcpResource defines a GCP resource configuration in a flow.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
name string | |||
resources Resources | |||
config GcpConfig |
GcpSpec
GcpSpec defines the desired state of Gcp
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
dryRun boolean | dry-run mode | ||
periods ScalerPeriod array | Time period to scale | ||
resources Resources | Resources | ||
config GcpConfig |
K8s
K8s is the Schema for the k8s API
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string | kubecloudscaler.cloud/v1alpha3 | ||
kind string | K8s | ||
metadata ObjectMeta | Refer to Kubernetes API documentation for fields of metadata. | ||
spec K8sSpec | spec defines the desired state of K8s | ||
status ScalerStatus | status defines the observed state of K8s |
K8sConfig
K8sConfig defines the configuration for Kubernetes resource management.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
namespaces string array | Namespaces | ||
excludeNamespaces string array | Exclude namespaces from downscaling; will be ignored if Namespaces is set | ||
forceExcludeSystemNamespaces boolean | Force exclude system namespaces | true | |
deploymentTimeAnnotation string | Deployment time annotation | ||
disableEvents boolean | Disable events | ||
authSecret string | AuthSecret name | ||
restoreOnDelete boolean | Restore resource state on CR deletion (default: true) | true |
K8sResource
K8sResource defines a Kubernetes resource configuration in a flow.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
name string | |||
resources Resources | |||
config K8sConfig |
K8sSpec
K8sSpec defines the desired state of K8s
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
dryRun boolean | dry-run mode | ||
periods ScalerPeriod array | Time period to scale | ||
resources Resources | Resources | ||
config K8sConfig |
Resources
Resources defines the configuration for managed resources in a flow.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
k8s K8sResource array | |||
gcp GcpResource array |