···2020 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121)
22222323-// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
2424-// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
2323+// CrossVersionObjectReference contains enough information to let you identify the referred resource.
2424+// borrowed from https://github.com/kubernetes/kubernetes/blob/0e71d2d28f29514e4e55e5a4f3d0e57436fe1f0b/pkg/apis/autoscaling/types.go#L63-L74
2525+type CrossVersionObjectReference struct {
2626+ // kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
2727+ Kind string `json:"kind"`
2828+2929+ // name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
3030+ Name string `json:"name"`
3131+3232+ // apiVersion is the API version of the referent
3333+ // +optional
3434+ APIVersion string `json:"apiVersion,omitempty"`
3535+}
25362637// PrometheusInformedScaleTargetSpec defines the desired state of PrometheusInformedScaleTarget
2738type PrometheusInformedScaleTargetSpec struct {
2828- // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
2929- // Important: Run "make" to regenerate code after modifying this file
3030- // The following markers will use OpenAPI v3 schema to validate the value
3131- // More info: https://book.kubebuilder.io/reference/markers/crd-validation.html
3939+ Query string `json:"query"`
4040+ ScaleTargetRef CrossVersionObjectReference `json:"scaleTargetRef"`
32413333- // foo is an example field of PrometheusInformedScaleTarget. Edit prometheusinformedscaletarget_types.go to remove/update
4242+ // minReplicas is the lower limit for the number of replicas to which the autoscaler
4343+ // can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
4444+ // alpha feature gate HPAScaleToZero is enabled and at least one Object or External
4545+ // metric is configured. Scaling is active as long as at least one metric value is
4646+ // available.
3447 // +optional
3535- Foo *string `json:"foo,omitempty"`
4848+ MinReplicas *int32 `json:"minReplicas,omitempty"`
4949+5050+ // maxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
5151+ // +required
5252+ MaxReplicas int32 `json:"maxReplicas"`
3653}
37543855// PrometheusInformedScaleTargetStatus defines the observed state of PrometheusInformedScaleTarget.
3956type PrometheusInformedScaleTargetStatus struct {
4040- // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
4141- // Important: Run "make" to regenerate code after modifying this file
4257}
43584459// +kubebuilder:object:root=true
4560// +kubebuilder:subresource:status
6161+// +kubebuilder:resource:shortName=pist
46624763// PrometheusInformedScaleTarget is the Schema for the prometheusinformedscaletargets API
4864type PrometheusInformedScaleTarget struct {
+19-3
api/v1alpha1/zz_generated.deepcopy.go
···2525)
26262727// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
2828+func (in *CrossVersionObjectReference) DeepCopyInto(out *CrossVersionObjectReference) {
2929+ *out = *in
3030+}
3131+3232+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossVersionObjectReference.
3333+func (in *CrossVersionObjectReference) DeepCopy() *CrossVersionObjectReference {
3434+ if in == nil {
3535+ return nil
3636+ }
3737+ out := new(CrossVersionObjectReference)
3838+ in.DeepCopyInto(out)
3939+ return out
4040+}
4141+4242+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
2843func (in *PrometheusInformedScaleTarget) DeepCopyInto(out *PrometheusInformedScaleTarget) {
2944 *out = *in
3045 out.TypeMeta = in.TypeMeta
···86101// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
87102func (in *PrometheusInformedScaleTargetSpec) DeepCopyInto(out *PrometheusInformedScaleTargetSpec) {
88103 *out = *in
8989- if in.Foo != nil {
9090- in, out := &in.Foo, &out.Foo
9191- *out = new(string)
104104+ out.ScaleTargetRef = in.ScaleTargetRef
105105+ if in.MinReplicas != nil {
106106+ in, out := &in.MinReplicas, &out.MinReplicas
107107+ *out = new(int32)
92108 **out = **in
93109 }
94110}
···1111 kind: PrometheusInformedScaleTarget
1212 listKind: PrometheusInformedScaleTargetList
1313 plural: prometheusinformedscaletargets
1414+ shortNames:
1515+ - pist
1416 singular: prometheusinformedscaletarget
1517 scope: Namespaced
1618 versions:
···4042 spec:
4143 description: spec defines the desired state of PrometheusInformedScaleTarget
4244 properties:
4343- foo:
4444- description: foo is an example field of PrometheusInformedScaleTarget.
4545- Edit prometheusinformedscaletarget_types.go to remove/update
4545+ maxReplicas:
4646+ description: maxReplicas is the upper limit for the number of pods
4747+ that can be set by the autoscaler; cannot be smaller than MinReplicas.
4848+ format: int32
4949+ type: integer
5050+ minReplicas:
5151+ description: |-
5252+ minReplicas is the lower limit for the number of replicas to which the autoscaler
5353+ can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
5454+ alpha feature gate HPAScaleToZero is enabled and at least one Object or External
5555+ metric is configured. Scaling is active as long as at least one metric value is
5656+ available.
5757+ format: int32
5858+ type: integer
5959+ query:
4660 type: string
6161+ scaleTargetRef:
6262+ description: |-
6363+ CrossVersionObjectReference contains enough information to let you identify the referred resource.
6464+ borrowed from https://github.com/kubernetes/kubernetes/blob/0e71d2d28f29514e4e55e5a4f3d0e57436fe1f0b/pkg/apis/autoscaling/types.go#L63-L74
6565+ properties:
6666+ apiVersion:
6767+ description: apiVersion is the API version of the referent
6868+ type: string
6969+ kind:
7070+ description: 'kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
7171+ type: string
7272+ name:
7373+ description: 'name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
7474+ type: string
7575+ required:
7676+ - kind
7777+ - name
7878+ type: object
7979+ required:
8080+ - maxReplicas
8181+ - query
8282+ - scaleTargetRef
4783 type: object
4884 status:
4985 description: status defines the observed state of PrometheusInformedScaleTarget