mirror of
https://github.com/zalando-incubator/kube-metrics-adapter.git
synced 2024-12-22 19:16:06 +00:00
3d450ad2c2
Some cases and users actually know when their applications will have a high workload and, therefore, autoscaling support for time based scaling is a desired feature. This commit creates the first version of two CRDs called `ScalingSchedule` and `ClusterScalingSchedule`. The CRDs describe one or multiples schedules inside them. The schedules contains the information of when the time based scaling starts, if it happens once or multiple times, its duration and, a configurable value that later can be used by HPAs to scale applications. The only difference between the two CRDs is their scope. `ClusterScalingSchedule` aims to attend cluster wide schedules, to multiple applications, while `ScalingSchedule` has to be deployed with each application into the same namespace. This commit does not creates any metric, it's a noop change that creates just the CRD and import tools required to generate the CRD and others required code, as `deepCopy` functions and clients. Signed-off-by: Jonathan Juares Beber <jonathanbeber@gmail.com>
120 lines
4.8 KiB
YAML
120 lines
4.8 KiB
YAML
|
|
---
|
|
apiVersion: apiextensions.k8s.io/v1
|
|
kind: CustomResourceDefinition
|
|
metadata:
|
|
annotations:
|
|
controller-gen.kubebuilder.io/version: v0.5.0
|
|
creationTimestamp: null
|
|
name: scalingschedules.zalando.org
|
|
spec:
|
|
group: zalando.org
|
|
names:
|
|
kind: ScalingSchedule
|
|
listKind: ScalingScheduleList
|
|
plural: scalingschedules
|
|
singular: scalingschedule
|
|
scope: Namespaced
|
|
versions:
|
|
- name: v1
|
|
schema:
|
|
openAPIV3Schema:
|
|
description: ScalingSchedule describes a namespaced time based metric to be
|
|
used in autoscaling operations.
|
|
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: ScalingScheduleSpec is the spec part of the ScalingSchedule.
|
|
properties:
|
|
schedules:
|
|
description: Schedules is the list of schedules for this ScalingSchedule
|
|
resource. All the schedules defined here will result on the value
|
|
to the same metric. New metrics require a new ScalingSchedule resource.
|
|
items:
|
|
description: Schedule is the schedule details to be used inside
|
|
a ScalingSchedule.
|
|
properties:
|
|
date:
|
|
description: Defines the starting date of a OneTime schedule.
|
|
It has to be a RFC3339 formated date.
|
|
format: date-time
|
|
type: string
|
|
durationMinutes:
|
|
description: The duration in minutes that the configured value
|
|
will be returned for the defined schedule.
|
|
type: integer
|
|
period:
|
|
description: Defines the details of a Repeating schedule.
|
|
properties:
|
|
days:
|
|
description: The days that this schedule will be active.
|
|
items:
|
|
description: ScheduleDay represents the valid inputs for
|
|
days in a SchedulePeriod.
|
|
enum:
|
|
- Sun
|
|
- Mon
|
|
- Tue
|
|
- Wed
|
|
- Thu
|
|
- Fri
|
|
- Sat
|
|
type: string
|
|
type: array
|
|
startTime:
|
|
description: The startTime has the format HH:MM
|
|
pattern: (([0-1][0-9])|([2][0-3])):([0-5][0-9])
|
|
type: string
|
|
timezone:
|
|
description: The location name corresponding to a file in
|
|
the IANA Time Zone database, like Europe/Berlin.
|
|
type: string
|
|
required:
|
|
- days
|
|
- startTime
|
|
- timezone
|
|
type: object
|
|
type:
|
|
description: Defines if the schedule is a OneTime schedule or
|
|
Repeating one. If OneTime, date has to be defined. If Repeating,
|
|
Period has to be defined.
|
|
enum:
|
|
- OneTime
|
|
- Repeating
|
|
type: string
|
|
value:
|
|
description: The metric value that will be returned for the
|
|
defined schedule.
|
|
type: integer
|
|
required:
|
|
- durationMinutes
|
|
- type
|
|
- value
|
|
type: object
|
|
type: array
|
|
required:
|
|
- schedules
|
|
type: object
|
|
required:
|
|
- spec
|
|
type: object
|
|
served: true
|
|
storage: true
|
|
status:
|
|
acceptedNames:
|
|
kind: ""
|
|
plural: ""
|
|
conditions: []
|
|
storedVersions: []
|