mirror of
https://github.com/zalando-incubator/kube-metrics-adapter.git
synced 2025-01-09 09:51:38 +00:00
Compare commits
67 Commits
bugfix/fix
...
v0.1.11
Author | SHA1 | Date | |
---|---|---|---|
|
d1969a3020 | ||
|
582c94255f | ||
|
c626f414db | ||
|
1d4beab7a4 | ||
|
eefd5ef512 | ||
|
599b3bf805 | ||
|
ecf21df9c0 | ||
|
ecd296e644 | ||
|
446b7f01ea | ||
|
0ad7296d56 | ||
|
9da155554b | ||
|
d7f9664d52 | ||
|
85f6dda229 | ||
|
64a6b85c73 | ||
|
f41af0d82b | ||
|
194bede7a3 | ||
|
c4f5efb6a7 | ||
|
51e9378ee6 | ||
|
ce27ef1798 | ||
|
a73ef467cd | ||
|
e6a04531fb | ||
|
7289e6f8e2 | ||
|
60b1dc097a | ||
|
6b46cc2599 | ||
|
6f9aba8db8 | ||
|
a382dbfe7b | ||
|
7a68304389 | ||
|
7044e79b08 | ||
|
e16bacb24e | ||
|
726c1e691d | ||
|
debc90ca72 | ||
|
6343c8ea15 | ||
|
eb0575f11e | ||
|
52bfbbb1b0 | ||
|
cf5872ef08 | ||
|
b5432fb1f3 | ||
|
5466badd90 | ||
|
aef1837e47 | ||
|
4e86d6ae34 | ||
|
2874c1a6a7 | ||
|
b5006746f0 | ||
|
9496ab7fd3 | ||
|
aa7f86291e | ||
|
486a6c4262 | ||
|
aaf66f31a0 | ||
|
e5bee93bf6 | ||
|
aae3772472 | ||
|
76d3726e5b | ||
|
ea4a651afe | ||
|
721c6553d8 | ||
|
5aa2272e37 | ||
|
b9300d1e46 | ||
|
5747b6c9de | ||
|
6d15a1635a | ||
|
4090ab8b32 | ||
|
1f56abf931 | ||
|
f216070630 | ||
|
8725f02db7 | ||
|
240452ca27 | ||
|
9bb7d976a0 | ||
|
816661f7fd | ||
|
7ae70d798d | ||
|
0ef5ad1cfe | ||
|
c86235636b | ||
|
2d119e68e4 | ||
|
df3efe0e39 | ||
|
a5b5cb91c3 |
@ -1,6 +1,8 @@
|
||||
FROM registry.opensource.zalan.do/library/alpine-3.12:latest
|
||||
LABEL maintainer="Team Teapot @ Zalando SE <team-teapot@zalando.de>"
|
||||
|
||||
RUN apk add --no-cache tzdata
|
||||
|
||||
# add binary
|
||||
ADD build/linux/kube-metrics-adapter /
|
||||
|
||||
|
10
Makefile
10
Makefile
@ -30,7 +30,7 @@ check: $(GENERATED)
|
||||
golangci-lint run --timeout=2m ./...
|
||||
|
||||
|
||||
$(GENERATED): go.mod $(CRD_TYPE_SOURCE)
|
||||
$(GENERATED): go.mod $(CRD_TYPE_SOURCE) $(OPENAPI)
|
||||
./hack/update-codegen.sh
|
||||
|
||||
$(GENERATED_CRDS): $(GENERATED) $(CRD_SOURCES)
|
||||
@ -48,17 +48,17 @@ $(OPENAPI): go.mod
|
||||
-O zz_generated.openapi \
|
||||
-r /dev/null
|
||||
|
||||
build.local: build/$(BINARY)
|
||||
build.local: build/$(BINARY) $(GENERATED_CRDS)
|
||||
build.linux: build/linux/$(BINARY)
|
||||
build.osx: build/osx/$(BINARY)
|
||||
|
||||
build/$(BINARY): go.mod $(SOURCES) $(OPENAPI)
|
||||
build/$(BINARY): go.mod $(SOURCES) $(GENERATED)
|
||||
CGO_ENABLED=0 go build -o build/$(BINARY) $(BUILD_FLAGS) -ldflags "$(LDFLAGS)" .
|
||||
|
||||
build/linux/$(BINARY): go.mod $(SOURCES) $(OPENAPI)
|
||||
build/linux/$(BINARY): go.mod $(SOURCES) $(GENERATED)
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/linux/$(BINARY) -ldflags "$(LDFLAGS)" .
|
||||
|
||||
build/osx/$(BINARY): go.mod $(SOURCES) $(OPENAPI)
|
||||
build/osx/$(BINARY): go.mod $(SOURCES) $(GENERATED)
|
||||
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/osx/$(BINARY) -ldflags "$(LDFLAGS)" .
|
||||
|
||||
build.docker: build.linux
|
||||
|
160
README.md
160
README.md
@ -110,6 +110,8 @@ metadata:
|
||||
metric-config.pods.requests-per-second.json-path/port: "9090"
|
||||
metric-config.pods.requests-per-second.json-path/scheme: "https"
|
||||
metric-config.pods.requests-per-second.json-path/aggregator: "max"
|
||||
metric-config.pods.requests-per-second.json-path/interval: "60s" # optional
|
||||
metric-config.pods.requests-per-second.json-path/min-pod-ready-age: "30s" # optional
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
@ -174,6 +176,11 @@ metric-config.pods.requests-per-second.json-path/connect-timeout: 500ms
|
||||
|
||||
The default for both of the above values is 15 seconds.
|
||||
|
||||
The `min-pod-ready-age` configuration option instructs the service to start collecting metrics from the pods only if they are "older" (time elapsed after pod reached "Ready" state) than the specified amount of time.
|
||||
This is handy when pods need to warm up before HPAs will start tracking their metrics.
|
||||
|
||||
The default value is 0 seconds.
|
||||
|
||||
## Prometheus collector
|
||||
|
||||
The Prometheus collector is a generic collector which can map Prometheus
|
||||
@ -202,16 +209,6 @@ the trade-offs between the two approaches.
|
||||
| `prometheus-query` | Generic metric which requires a user defined query. | External | | `>=1.12` |
|
||||
| *custom* | No predefined metrics. Metrics are generated from user defined queries. | Object | *any* | `>=1.12` |
|
||||
|
||||
### Configure Scrape Interval
|
||||
|
||||
There is a way to set the interval via an annotation like:
|
||||
|
||||
```yaml
|
||||
metric-config.external.prometheus-query.prometheus/interval: 30s
|
||||
```
|
||||
|
||||
Default is 1 minute.
|
||||
|
||||
### Example: External Metric
|
||||
|
||||
This is an example of an HPA configured to get metrics based on a Prometheus
|
||||
@ -234,6 +231,7 @@ metadata:
|
||||
# metric-config.<metricType>.<metricName>.<collectorType>/<configKey>
|
||||
metric-config.external.processed-events-per-second.prometheus/query: |
|
||||
scalar(sum(rate(event-service_events_count{application="event-service",processed="true"}[1m])))
|
||||
metric-config.external.processed-events-per-second.prometheus/interval: "60s" # optional
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
@ -411,6 +409,7 @@ metadata:
|
||||
// Rename "_value" to "metricvalue" for letting the metrics server properly unmarshal the result.
|
||||
|> rename(columns: {_value: "metricvalue"})
|
||||
|> keep(columns: ["metricvalue"])
|
||||
metric-config.external.queue-depth.influxdb/interval: "60s" # optional
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
@ -532,6 +531,7 @@ metadata:
|
||||
# metric-config.<metricType>.<metricName>.<collectorType>/<configKey>
|
||||
metric-config.external.my-zmon-check.zmon/key: "custom.*"
|
||||
metric-config.external.my-zmon-check.zmon/tag-application: "my-custom-app-*"
|
||||
metric-config.external.my-zmon-check.zmon/interval: "60s" # optional
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
@ -587,8 +587,8 @@ For instance if you define the entity filter
|
||||
then you might want to get an average over the metrics for those three
|
||||
entities. This would be possible by using the `avg` aggregator. The default
|
||||
aggregator is `last` which returns only the latest metric point from the
|
||||
query. The supported aggregation functions are `avg`, `dev`, `count`,
|
||||
`first`, `last`, `max`, `min`, `sum`, `diff`. See the [KariosDB docs](https://kairosdb.github.io/docs/build/html/restapi/Aggregators.html) for
|
||||
query. The supported aggregation functions are `avg`, `count`,
|
||||
`last`, `max`, `min`, `sum`, `diff`. See the [KariosDB docs](https://kairosdb.github.io/docs/build/html/restapi/Aggregators.html) for
|
||||
details.
|
||||
|
||||
The `duration` defines the duration used for the timeseries query. E.g. if you
|
||||
@ -629,6 +629,7 @@ metadata:
|
||||
metric-config.external.unique-metric-name.json-path/json-key: "$.some-metric.value"
|
||||
metric-config.external.unique-metric-name.json-path/endpoint: "http://metric-source.app-namespace:8080/metrics"
|
||||
metric-config.external.unique-metric-name.json-path/aggregator: "max"
|
||||
metric-config.external.unique-metric-name.json-path/interval: "60s" # optional
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
@ -649,12 +650,141 @@ spec:
|
||||
type: AverageValue
|
||||
```
|
||||
|
||||
The HTTP collector similar to the Pod Metrics collector. The metric name should always be `http`.
|
||||
This value is also used in the annotations to configure the metrics adapter to query the required
|
||||
target. The following configuration values are supported:
|
||||
The HTTP collector similar to the Pod Metrics collector. The following
|
||||
configuration values are supported:
|
||||
|
||||
- `json-key` to specify the JSON path of the metric to be queried
|
||||
- `endpoint` the fully formed path to query for the metric. In the above example a Kubernetes _Service_
|
||||
in the namespace `app-namespace` is called.
|
||||
- `aggregator` is only required if the metric is an array of values and specifies how the values
|
||||
are aggregated. Currently this option can support the values: `sum`, `max`, `min`, `avg`.
|
||||
|
||||
### Scrape Interval
|
||||
|
||||
It's possible to configure the scrape interval for each of the metric types via
|
||||
an annotation:
|
||||
|
||||
```yaml
|
||||
metric-config.<metricType>.<metricName>.<collectorType>/interval: "30s"
|
||||
```
|
||||
|
||||
The default is `60s` but can be reduced to let the adapter collect metrics more
|
||||
often.
|
||||
|
||||
## ScalingSchedule Collectors
|
||||
|
||||
The `ScalingSchedule` and `ClusterScalingSchedule` collectors allow
|
||||
collecting time-based metrics from the respective CRD objects specified
|
||||
in the HPA.
|
||||
|
||||
### Supported metrics
|
||||
|
||||
| Metric | Description | Type | K8s Versions |
|
||||
| ---------- | -------------- | ------- | -- |
|
||||
| ObjectName | The metric is calculated and stored for each `ScalingSchedule` and `ClusterScalingSchedule` referenced in the HPAs | `ScalingSchedule` and `ClusterScalingSchedule` | `>=1.16` |
|
||||
|
||||
### Example
|
||||
|
||||
This is an example of using the ScalingSchedule collectors to collect
|
||||
metrics from a deployed kind of the CRD. First, the schedule object:
|
||||
|
||||
```yaml
|
||||
apiVersion: zalando.org/v1
|
||||
kind: ClusterScalingSchedule
|
||||
metadata:
|
||||
name: "scheduling-event"
|
||||
spec:
|
||||
schedules:
|
||||
- type: OneTime
|
||||
date: "2021-10-02T08:08:08+02:00"
|
||||
durationMinutes: 30
|
||||
value: 100
|
||||
- type: Repeating
|
||||
durationMinutes: 10
|
||||
value: 120
|
||||
period:
|
||||
startTime: "15:45"
|
||||
timezone: "Europe/Berlin"
|
||||
days:
|
||||
- Mon
|
||||
- Wed
|
||||
- Fri
|
||||
```
|
||||
|
||||
This resource defines a scheduling event named `scheduling-event` with
|
||||
two schedules of the kind `ClusterScalingSchedule`.
|
||||
|
||||
`ClusterScalingSchedule` objects aren't namespaced, what means it can be
|
||||
referenced by any HPA in any namespace in the cluster. `ScalingSchedule`
|
||||
have the exact same fields and behavior, but can be referenced just by
|
||||
HPAs in the same namespace. The schedules can have the type `Repeating`
|
||||
or `OneTime`.
|
||||
|
||||
This example configuration will generate the following result: at
|
||||
`2021-10-02T08:08:08+02:00` for 30 minutes a metric with the value of
|
||||
100 will be returned. Every Monday, Wednesday and Friday, starting at 15
|
||||
hours and 45 minutes (Berlin time), a metric with the value of 120 will
|
||||
be returned for 10 minutes. It's not the case of this example, but if multiple
|
||||
schedules collide in time, the biggest value is returned.
|
||||
|
||||
Check the CRDs definitions
|
||||
([ScalingSchedule](./docs/scaling_schedules_crd.yaml),
|
||||
[ClusterScalingSchedule](./docs/cluster_scaling_schedules_crd.yaml)) for
|
||||
a better understanding of the possible fields and their behavior.
|
||||
|
||||
An HPA can reference the deployed `ClusterScalingSchedule` object as
|
||||
this example:
|
||||
|
||||
```yaml
|
||||
apiVersion: autoscaling/v2beta2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: "myapp-hpa"
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: myapp
|
||||
minReplicas: 1
|
||||
maxReplicas: 15
|
||||
metrics:
|
||||
- type: Object
|
||||
object:
|
||||
describedObject:
|
||||
apiVersion: zalando.org/v1
|
||||
kind: ClusterScalingSchedule
|
||||
name: "scheduling-event"
|
||||
metric:
|
||||
name: "scheduling-event"
|
||||
target:
|
||||
type: AverageValue
|
||||
averageValue: "10"
|
||||
```
|
||||
|
||||
The name of the metric is equal to the name of the referenced object.
|
||||
The `target.averageValue` in this example is set to 10. This value will
|
||||
be used by the HPA controller to define the desired number of pods,
|
||||
based on the metric obtained (check the [HPA algorithm
|
||||
details](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#algorithm-details)
|
||||
for more context). This HPA configuration explicitly says that each pod
|
||||
of this application supports 10 units of the `ClusterScalingSchedule`
|
||||
metric. Multiple applications can share the same
|
||||
`ClusterScalingSchedule` or `ScalingSchedule` event and have a different
|
||||
number of pods based on its `target.averageValue` configuration.
|
||||
|
||||
In our specific example at `2021-10-02T08:08:08+02:00` as the metric has
|
||||
the value 100, this application will scale to 10 pods (100/10). Every
|
||||
Monday, Wednesday and Friday, starting at 15 hours and 45 minutes
|
||||
(Berlin time) the application will scale to 12 pods (120/10). Both
|
||||
scaling up will last at least the configured duration times of the
|
||||
schedules. After that, regular HPA scale down behavior applies.
|
||||
|
||||
Note that these number of pods are just considering these custom
|
||||
metrics, the normal HPA behavior still applies, such as: in case of
|
||||
multiple metrics the biggest number of pods is the utilized one, HPA max
|
||||
and min replica configuration, autoscaling policies, etc.
|
||||
|
||||
These collectors are disabled by default, you have to start the server
|
||||
with the `--scaling-schedule` flag to enable it. Remember to deploy the CRDs
|
||||
`ScalingSchedule` and `ClusterScalingSchedule` and allow the service
|
||||
account used by the server to read, watch and list them.
|
||||
|
@ -1,4 +1,4 @@
|
||||
apiVersion: apiregistration.k8s.io/v1beta1
|
||||
apiVersion: apiregistration.k8s.io/v1
|
||||
kind: APIService
|
||||
metadata:
|
||||
name: v1beta1.custom.metrics.k8s.io
|
||||
|
@ -28,6 +28,7 @@ spec:
|
||||
- --prometheus-server=http://prometheus.kube-system.svc.cluster.local
|
||||
- --skipper-ingress-metrics
|
||||
- --aws-external-metrics
|
||||
- --scaling-schedule
|
||||
env:
|
||||
- name: AWS_REGION
|
||||
value: eu-central-1
|
||||
|
@ -1,4 +1,4 @@
|
||||
apiVersion: apiregistration.k8s.io/v1beta1
|
||||
apiVersion: apiregistration.k8s.io/v1
|
||||
kind: APIService
|
||||
metadata:
|
||||
name: v1beta1.external.metrics.k8s.io
|
||||
|
@ -1,6 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: kube-metrics-adapter
|
||||
version: 0.1.9
|
||||
version: 0.1.11
|
||||
description: kube-metrics-adapter helm chart
|
||||
home: https://github.com/zalando-incubator/kube-metrics-adapter
|
||||
maintainers:
|
||||
|
119
docs/helm/templates/cluster_scaling_schedules_crd.yaml
Normal file
119
docs/helm/templates/cluster_scaling_schedules_crd.yaml
Normal file
@ -0,0 +1,119 @@
|
||||
{{- if .Values.scalingSchedule.enabled }}
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.5.0
|
||||
creationTimestamp: null
|
||||
name: clusterscalingschedules.zalando.org
|
||||
spec:
|
||||
group: zalando.org
|
||||
names:
|
||||
kind: ClusterScalingSchedule
|
||||
listKind: ClusterScalingScheduleList
|
||||
plural: clusterscalingschedules
|
||||
singular: clusterscalingschedule
|
||||
scope: Cluster
|
||||
versions:
|
||||
- name: v1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: ClusterScalingSchedule describes a cluster scoped 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: []
|
||||
{{- end}}
|
@ -1,5 +1,5 @@
|
||||
{{- if .Values.enableCustomMetricsApi }}
|
||||
apiVersion: apiregistration.k8s.io/v1beta1
|
||||
apiVersion: apiregistration.k8s.io/v1
|
||||
kind: APIService
|
||||
metadata:
|
||||
name: v1beta1.custom.metrics.k8s.io
|
||||
@ -12,4 +12,4 @@ spec:
|
||||
insecureSkipTLSVerify: {{ .Values.tls.skipTLSVerify }}
|
||||
groupPriorityMinimum: 100
|
||||
versionPriority: 100
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
|
@ -182,6 +182,9 @@ spec:
|
||||
{{- if .Values.zmon.tokenName }}
|
||||
- --zmon-token-name={{ .Values.zmon.tokenName }}
|
||||
{{- end}}
|
||||
{{- if .Values.scalingSchedule.enabled }}
|
||||
- --scaling-schedule
|
||||
{{- end}}
|
||||
resources:
|
||||
limits:
|
||||
cpu: {{ .Values.resources.limits.cpu }}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{- if .Values.enableExternalMetricsApi }}
|
||||
apiVersion: apiregistration.k8s.io/v1beta1
|
||||
apiVersion: apiregistration.k8s.io/v1
|
||||
kind: APIService
|
||||
metadata:
|
||||
name: v1beta1.external.metrics.k8s.io
|
||||
|
@ -73,6 +73,17 @@ rules:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
{{- if .Values.scalingSchedule.enabled }}
|
||||
- apiGroups:
|
||||
- zalando.org
|
||||
resources:
|
||||
- clusterscalingschedules
|
||||
- scalingschedules
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
{{- end}}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
|
119
docs/helm/templates/scaling_schedules_crd.yaml
Normal file
119
docs/helm/templates/scaling_schedules_crd.yaml
Normal file
@ -0,0 +1,119 @@
|
||||
{{- if .Values.scalingSchedule.enabled }}
|
||||
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: []
|
||||
{{- end}}
|
@ -4,7 +4,7 @@ replicas: 1
|
||||
|
||||
registry:
|
||||
image: registry.opensource.zalan.do/teapot/kube-metrics-adapter
|
||||
imageTag: v0.1.9
|
||||
imageTag: v0.1.10
|
||||
imagePullPolicy: IfNotPresent
|
||||
|
||||
service:
|
||||
@ -92,3 +92,6 @@ resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
|
||||
scalingSchedule:
|
||||
enabled: false
|
||||
|
@ -78,6 +78,15 @@ rules:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- zalando.org
|
||||
resources:
|
||||
- clusterscalingschedules
|
||||
- scalingschedules
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
|
27
go.mod
27
go.mod
@ -2,34 +2,31 @@ module github.com/zalando-incubator/kube-metrics-adapter
|
||||
|
||||
require (
|
||||
github.com/NYTimes/gziphandler v1.0.1 // indirect
|
||||
github.com/aws/aws-sdk-go v1.37.20
|
||||
github.com/aws/aws-sdk-go v1.39.2
|
||||
github.com/go-openapi/spec v0.20.3
|
||||
github.com/influxdata/influxdb-client-go v0.2.0
|
||||
github.com/influxdata/line-protocol v0.0.0-20201012155213-5f565037cbc9 // indirect
|
||||
github.com/kubernetes-sigs/custom-metrics-apiserver v0.0.0-20201216091021-1b9fa998bbaa
|
||||
github.com/magefile/mage v1.11.0 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/prometheus/client_golang v1.9.0
|
||||
github.com/prometheus/common v0.18.0
|
||||
github.com/sirupsen/logrus v1.8.0
|
||||
github.com/spf13/cobra v1.1.1
|
||||
github.com/prometheus/client_golang v1.10.0
|
||||
github.com/prometheus/common v0.25.0
|
||||
github.com/sirupsen/logrus v1.8.1
|
||||
github.com/spf13/cobra v1.1.3
|
||||
github.com/spyzhov/ajson v0.4.2
|
||||
github.com/stretchr/testify v1.7.0
|
||||
github.com/zalando-incubator/cluster-lifecycle-manager v0.0.0-20180921141935-824b77fb1f84
|
||||
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 // indirect
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
|
||||
golang.org/x/sys v0.0.0-20210301091718-77cc2087c03b // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||
k8s.io/api v0.20.4
|
||||
k8s.io/apimachinery v0.20.4
|
||||
k8s.io/apiserver v0.20.4
|
||||
k8s.io/client-go v0.20.4
|
||||
k8s.io/code-generator v0.20.4
|
||||
k8s.io/component-base v0.20.4
|
||||
k8s.io/api v0.20.5
|
||||
k8s.io/apimachinery v0.20.5
|
||||
k8s.io/apiserver v0.20.5
|
||||
k8s.io/client-go v0.20.5
|
||||
k8s.io/code-generator v0.20.5
|
||||
k8s.io/component-base v0.20.5
|
||||
k8s.io/klog v1.0.0
|
||||
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd
|
||||
k8s.io/metrics v0.20.4
|
||||
k8s.io/metrics v0.20.5
|
||||
sigs.k8s.io/controller-tools v0.5.0
|
||||
)
|
||||
|
||||
|
76
go.sum
76
go.sum
@ -76,8 +76,8 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l
|
||||
github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
|
||||
github.com/aws/aws-sdk-go v1.15.64/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM=
|
||||
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
|
||||
github.com/aws/aws-sdk-go v1.37.20 h1:CJCXpMYmBJrRH8YwoSE0oB9S3J5ax+62F14sYlDCztg=
|
||||
github.com/aws/aws-sdk-go v1.37.20/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
|
||||
github.com/aws/aws-sdk-go v1.39.2 h1:t+n2j0QfAmGqSQVb1VIGulhSMjfaZ/RqSGlcRKGED9Y=
|
||||
github.com/aws/aws-sdk-go v1.39.2/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
|
||||
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
@ -242,8 +242,9 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
|
||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
|
||||
@ -373,9 +374,6 @@ github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
|
||||
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
|
||||
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
||||
github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
|
||||
github.com/magefile/mage v1.11.0 h1:C/55Ywp9BpgVVclD3lRnSYCwXTYxmSppIgLeDYlNuls=
|
||||
github.com/magefile/mage v1.11.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
|
||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
@ -489,8 +487,8 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf
|
||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
|
||||
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
|
||||
github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU=
|
||||
github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU=
|
||||
github.com/prometheus/client_golang v1.10.0 h1:/o0BDeWzLWXNZ+4q5gXltUvaMpJqckTa+jTNoB+z4cg=
|
||||
github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
@ -504,17 +502,18 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
|
||||
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
|
||||
github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
|
||||
github.com/prometheus/common v0.18.0 h1:WCVKW7aL6LEe1uryfI9dnEc2ZqNB1Fn0ok930v0iL1Y=
|
||||
github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
|
||||
github.com/prometheus/common v0.25.0 h1:IjJYZJCI8HZYtqA3xYwGyDzSCy1r4CA2GRh+4vdOmtE=
|
||||
github.com/prometheus/common v0.25.0/go.mod h1:H6QK/N6XVT42whUeIdI3dp36w49c+/iMDk7UAI2qm7Q=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||
github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4=
|
||||
github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||
github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=
|
||||
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
@ -530,8 +529,8 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU=
|
||||
github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
|
||||
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
|
||||
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
|
||||
@ -543,8 +542,9 @@ github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
|
||||
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4=
|
||||
github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI=
|
||||
github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M=
|
||||
github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
|
||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
@ -685,8 +685,8 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
|
||||
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@ -699,8 +699,9 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180903190138-2b024373dcd9/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@ -747,9 +748,10 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210301091718-77cc2087c03b h1:kHlr0tATeLRMEiZJu5CknOw/E8V6h69sXXQFGoPtjcc=
|
||||
golang.org/x/sys v0.0.0-20210301091718-77cc2087c03b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
@ -759,8 +761,9 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@ -933,30 +936,30 @@ honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
k8s.io/api v0.20.0/go.mod h1:HyLC5l5eoS/ygQYl1BXBgFzWNlkHiAuyNAbevIn+FKg=
|
||||
k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8=
|
||||
k8s.io/api v0.20.4 h1:xZjKidCirayzX6tHONRQyTNDVIR55TYVqgATqo6ZULY=
|
||||
k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ=
|
||||
k8s.io/api v0.20.5 h1:zsMTffV0Le2EiI0aKvlTHEnXGxk1HiqGRhJcCPiI7JI=
|
||||
k8s.io/api v0.20.5/go.mod h1:FQjAceXnVaWDeov2YUWhOb6Yt+5UjErkp6UO3nczO1Y=
|
||||
k8s.io/apiextensions-apiserver v0.20.2 h1:rfrMWQ87lhd8EzQWRnbQ4gXrniL/yTRBgYH1x1+BLlo=
|
||||
k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs=
|
||||
k8s.io/apimachinery v0.20.0/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
|
||||
k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
|
||||
k8s.io/apimachinery v0.20.4 h1:vhxQ0PPUUU2Ns1b9r4/UFp13UPs8cw2iOoTjnY9faa0=
|
||||
k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
|
||||
k8s.io/apimachinery v0.20.5 h1:wO/FxMVRn223rAKxnBbwCyuN96bS9MFTIvP0e/V7cps=
|
||||
k8s.io/apimachinery v0.20.5/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
|
||||
k8s.io/apiserver v0.20.0/go.mod h1:6gRIWiOkvGvQt12WTYmsiYoUyYW0FXSiMdNl4m+sxY8=
|
||||
k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA=
|
||||
k8s.io/apiserver v0.20.4 h1:zMMKIgIUDIFiwK3LyY7qOV4Z4wKsHVYExL6vXY9fPX4=
|
||||
k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM=
|
||||
k8s.io/apiserver v0.20.5 h1:J8l/MJ9pdYncrc1lhxzObDa7jgrUNfettKGNF8mFV+c=
|
||||
k8s.io/apiserver v0.20.5/go.mod h1:AY3lKhcJ2Tm81XvvcBzk2VnKINSoN+qczYsdo2YEvIc=
|
||||
k8s.io/client-go v0.20.0/go.mod h1:4KWh/g+Ocd8KkCwKF8vUNnmqgv+EVnQDK4MBF4oB5tY=
|
||||
k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE=
|
||||
k8s.io/client-go v0.20.4 h1:85crgh1IotNkLpKYKZHVNI1JT86nr/iDCvq2iWKsql4=
|
||||
k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k=
|
||||
k8s.io/client-go v0.20.5 h1:dJGtYUvFrFGjQ+GjXEIby0gZWdlAOc0xJBJqY3VyDxA=
|
||||
k8s.io/client-go v0.20.5/go.mod h1:Ee5OOMMYvlH8FCZhDsacjMlCBwetbGZETwo1OA+e6Zw=
|
||||
k8s.io/code-generator v0.20.0/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
|
||||
k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
|
||||
k8s.io/code-generator v0.20.4 h1:FhilVnvwMFVs65SxIQjXSOznGmzJIZEk3CCk/SULBfk=
|
||||
k8s.io/code-generator v0.20.4/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
|
||||
k8s.io/code-generator v0.20.5 h1:qQp2F2ZnosUqeV7ZqKE6bQnf7x9Ps9RFfKZxw1r5HsM=
|
||||
k8s.io/code-generator v0.20.5/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg=
|
||||
k8s.io/component-base v0.20.0/go.mod h1:wKPj+RHnAr8LW2EIBIK7AxOHPde4gme2lzXwVSoRXeA=
|
||||
k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0=
|
||||
k8s.io/component-base v0.20.4 h1:gdvPs4G11e99meQnW4zN+oYOjH8qkLz1sURrAzvKWqc=
|
||||
k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI=
|
||||
k8s.io/component-base v0.20.5 h1:8BZQKLJGhWrxtB7kIOEejKDtAKr1HOYvB0PZNeTyLS0=
|
||||
k8s.io/component-base v0.20.5/go.mod h1:l0isoBLGyQKwRoTWbPHR6jNDd3/VqQD43cNlsjddGng=
|
||||
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||
k8s.io/gengo v0.0.0-20201113003025-83324d819ded h1:JApXBKYyB7l9xx+DK7/+mFjC7A9Bt5A93FPvFD0HIFE=
|
||||
k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
|
||||
@ -969,15 +972,16 @@ k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
|
||||
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c=
|
||||
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM=
|
||||
k8s.io/metrics v0.20.0/go.mod h1:9yiRhfr8K8sjdj2EthQQE9WvpYDvsXIV3CjN4Ruq4Jw=
|
||||
k8s.io/metrics v0.20.4 h1:SxpF5zcFbUCvF3qzY6WPicp4VVFn9VCMHxnEvrwWJoQ=
|
||||
k8s.io/metrics v0.20.4/go.mod h1:DDXS+Ls+2NAxRcVhXKghRPa3csljyJRjDRjPe6EOg/g=
|
||||
k8s.io/metrics v0.20.5 h1:cQaav6lMGpYJPnS6G9jTCVmv531JVX1xEVv7WGUgNyM=
|
||||
k8s.io/metrics v0.20.5/go.mod h1:vsptOayjKWKWHvWR1vFQY++vxydzaEo/2+JC7kSDKPU=
|
||||
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw=
|
||||
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14 h1:TihvEz9MPj2u0KWds6E2OBUXfwaL4qRJ33c7HGiJpqk=
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15 h1:4uqm9Mv+w2MmBYD+F4qf/v6tDFUdPOk29C095RbU5mY=
|
||||
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
|
||||
sigs.k8s.io/controller-tools v0.5.0 h1:3u2RCwOlp0cjCALAigpOcbAf50pE+kHSdueUosrC/AE=
|
||||
sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8=
|
||||
|
@ -12,13 +12,15 @@ const (
|
||||
customMetricsPrefix = "metric-config."
|
||||
perReplicaMetricsConfKey = "per-replica"
|
||||
intervalMetricsConfKey = "interval"
|
||||
minPodReadyAgeConfKey = "min-pod-ready-age"
|
||||
)
|
||||
|
||||
type AnnotationConfigs struct {
|
||||
CollectorType string
|
||||
Configs map[string]string
|
||||
PerReplica bool
|
||||
Interval time.Duration
|
||||
CollectorType string
|
||||
Configs map[string]string
|
||||
PerReplica bool
|
||||
Interval time.Duration
|
||||
MinPodReadyAge time.Duration
|
||||
}
|
||||
|
||||
type MetricConfigKey struct {
|
||||
@ -89,6 +91,15 @@ func (m AnnotationConfigMap) Parse(annotations map[string]string) error {
|
||||
continue
|
||||
}
|
||||
|
||||
if parts[1] == minPodReadyAgeConfKey {
|
||||
minPodReadyAge, err := time.ParseDuration(val)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to parse min-pod-ready-age value %s for %s: %v", val, key, err)
|
||||
}
|
||||
config.MinPodReadyAge = minPodReadyAge
|
||||
continue
|
||||
}
|
||||
|
||||
config.Configs[parts[1]] = val
|
||||
}
|
||||
return nil
|
||||
|
@ -24,10 +24,11 @@ func TestParser(t *testing.T) {
|
||||
{
|
||||
Name: "pod metrics",
|
||||
Annotations: map[string]string{
|
||||
"metric-config.pods.requests-per-second.json-path/json-key": "$.http_server.rps",
|
||||
"metric-config.pods.requests-per-second.json-path/path": "/metrics",
|
||||
"metric-config.pods.requests-per-second.json-path/port": "9090",
|
||||
"metric-config.pods.requests-per-second.json-path/scheme": "https",
|
||||
"metric-config.pods.requests-per-second.json-path/json-key": "$.http_server.rps",
|
||||
"metric-config.pods.requests-per-second.json-path/path": "/metrics",
|
||||
"metric-config.pods.requests-per-second.json-path/port": "9090",
|
||||
"metric-config.pods.requests-per-second.json-path/scheme": "https",
|
||||
"metric-config.pods.requests-per-second.json-path/min-pod-ready-age": "30s",
|
||||
},
|
||||
MetricName: "requests-per-second",
|
||||
MetricType: autoscalingv2.PodsMetricSourceType,
|
||||
|
@ -19,6 +19,7 @@ type ScalingSchedule struct {
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +genclient:nonNamespaced
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +kubebuilder:object:root=true
|
||||
|
||||
@ -49,11 +50,11 @@ type Schedule struct {
|
||||
Type ScheduleType `json:"type"`
|
||||
// Defines the details of a Repeating schedule.
|
||||
// +optional
|
||||
Period SchedulePeriod `json:"period"`
|
||||
Period *SchedulePeriod `json:"period,omitempty"`
|
||||
// Defines the starting date of a OneTime schedule. It has to
|
||||
// be a RFC3339 formated date.
|
||||
// +optional
|
||||
Date ScheduleDate `json:"date"`
|
||||
Date *ScheduleDate `json:"date,omitempty"`
|
||||
// The duration in minutes that the configured value will be
|
||||
// returned for the defined schedule.
|
||||
DurationMinutes int `json:"durationMinutes"`
|
||||
@ -88,7 +89,6 @@ type SchedulePeriod struct {
|
||||
|
||||
// ScheduleDay represents the valid inputs for days in a SchedulePeriod.
|
||||
// +kubebuilder:validation:Enum=Sun;Mon;Tue;Wed;Thu;Fri;Sat
|
||||
// +k8s:deepcopy-gen=true
|
||||
type ScheduleDay string
|
||||
|
||||
const (
|
||||
@ -98,13 +98,12 @@ const (
|
||||
WednesdaySchedule ScheduleDay = "Wed"
|
||||
ThursdaySchedule ScheduleDay = "Thu"
|
||||
FridaySchedule ScheduleDay = "Fri"
|
||||
StaturdaySchedule ScheduleDay = "Sat"
|
||||
SaturdaySchedule ScheduleDay = "Sat"
|
||||
)
|
||||
|
||||
// ScheduleDate is a RFC3339 representation of the date for a Schedule
|
||||
// of the OneTime type.
|
||||
// +kubebuilder:validation:Format="date-time"
|
||||
// +k8s:deepcopy-gen=true
|
||||
type ScheduleDate string
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
@ -170,7 +170,16 @@ func (in *ScalingScheduleSpec) DeepCopy() *ScalingScheduleSpec {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Schedule) DeepCopyInto(out *Schedule) {
|
||||
*out = *in
|
||||
in.Period.DeepCopyInto(&out.Period)
|
||||
if in.Period != nil {
|
||||
in, out := &in.Period, &out.Period
|
||||
*out = new(SchedulePeriod)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.Date != nil {
|
||||
in, out := &in.Date, &out.Date
|
||||
*out = new(ScheduleDate)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ import (
|
||||
// ClusterScalingSchedulesGetter has a method to return a ClusterScalingScheduleInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ClusterScalingSchedulesGetter interface {
|
||||
ClusterScalingSchedules(namespace string) ClusterScalingScheduleInterface
|
||||
ClusterScalingSchedules() ClusterScalingScheduleInterface
|
||||
}
|
||||
|
||||
// ClusterScalingScheduleInterface has methods to work with ClusterScalingSchedule resources.
|
||||
@ -52,14 +52,12 @@ type ClusterScalingScheduleInterface interface {
|
||||
// clusterScalingSchedules implements ClusterScalingScheduleInterface
|
||||
type clusterScalingSchedules struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newClusterScalingSchedules returns a ClusterScalingSchedules
|
||||
func newClusterScalingSchedules(c *ZalandoV1Client, namespace string) *clusterScalingSchedules {
|
||||
func newClusterScalingSchedules(c *ZalandoV1Client) *clusterScalingSchedules {
|
||||
return &clusterScalingSchedules{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,7 +65,6 @@ func newClusterScalingSchedules(c *ZalandoV1Client, namespace string) *clusterSc
|
||||
func (c *clusterScalingSchedules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterScalingSchedule, err error) {
|
||||
result = &v1.ClusterScalingSchedule{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("clusterscalingschedules").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
@ -84,7 +81,6 @@ func (c *clusterScalingSchedules) List(ctx context.Context, opts metav1.ListOpti
|
||||
}
|
||||
result = &v1.ClusterScalingScheduleList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("clusterscalingschedules").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
@ -101,7 +97,6 @@ func (c *clusterScalingSchedules) Watch(ctx context.Context, opts metav1.ListOpt
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("clusterscalingschedules").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
@ -112,7 +107,6 @@ func (c *clusterScalingSchedules) Watch(ctx context.Context, opts metav1.ListOpt
|
||||
func (c *clusterScalingSchedules) Create(ctx context.Context, clusterScalingSchedule *v1.ClusterScalingSchedule, opts metav1.CreateOptions) (result *v1.ClusterScalingSchedule, err error) {
|
||||
result = &v1.ClusterScalingSchedule{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("clusterscalingschedules").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(clusterScalingSchedule).
|
||||
@ -125,7 +119,6 @@ func (c *clusterScalingSchedules) Create(ctx context.Context, clusterScalingSche
|
||||
func (c *clusterScalingSchedules) Update(ctx context.Context, clusterScalingSchedule *v1.ClusterScalingSchedule, opts metav1.UpdateOptions) (result *v1.ClusterScalingSchedule, err error) {
|
||||
result = &v1.ClusterScalingSchedule{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("clusterscalingschedules").
|
||||
Name(clusterScalingSchedule.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
@ -138,7 +131,6 @@ func (c *clusterScalingSchedules) Update(ctx context.Context, clusterScalingSche
|
||||
// Delete takes name of the clusterScalingSchedule and deletes it. Returns an error if one occurs.
|
||||
func (c *clusterScalingSchedules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("clusterscalingschedules").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
@ -153,7 +145,6 @@ func (c *clusterScalingSchedules) DeleteCollection(ctx context.Context, opts met
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("clusterscalingschedules").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
@ -166,7 +157,6 @@ func (c *clusterScalingSchedules) DeleteCollection(ctx context.Context, opts met
|
||||
func (c *clusterScalingSchedules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterScalingSchedule, err error) {
|
||||
result = &v1.ClusterScalingSchedule{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("clusterscalingschedules").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
|
@ -33,7 +33,6 @@ import (
|
||||
// FakeClusterScalingSchedules implements ClusterScalingScheduleInterface
|
||||
type FakeClusterScalingSchedules struct {
|
||||
Fake *FakeZalandoV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var clusterscalingschedulesResource = schema.GroupVersionResource{Group: "zalando.org", Version: "v1", Resource: "clusterscalingschedules"}
|
||||
@ -43,8 +42,7 @@ var clusterscalingschedulesKind = schema.GroupVersionKind{Group: "zalando.org",
|
||||
// Get takes name of the clusterScalingSchedule, and returns the corresponding clusterScalingSchedule object, and an error if there is any.
|
||||
func (c *FakeClusterScalingSchedules) Get(ctx context.Context, name string, options v1.GetOptions) (result *zalandoorgv1.ClusterScalingSchedule, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(clusterscalingschedulesResource, c.ns, name), &zalandoorgv1.ClusterScalingSchedule{})
|
||||
|
||||
Invokes(testing.NewRootGetAction(clusterscalingschedulesResource, name), &zalandoorgv1.ClusterScalingSchedule{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -54,8 +52,7 @@ func (c *FakeClusterScalingSchedules) Get(ctx context.Context, name string, opti
|
||||
// List takes label and field selectors, and returns the list of ClusterScalingSchedules that match those selectors.
|
||||
func (c *FakeClusterScalingSchedules) List(ctx context.Context, opts v1.ListOptions) (result *zalandoorgv1.ClusterScalingScheduleList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(clusterscalingschedulesResource, clusterscalingschedulesKind, c.ns, opts), &zalandoorgv1.ClusterScalingScheduleList{})
|
||||
|
||||
Invokes(testing.NewRootListAction(clusterscalingschedulesResource, clusterscalingschedulesKind, opts), &zalandoorgv1.ClusterScalingScheduleList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -76,15 +73,13 @@ func (c *FakeClusterScalingSchedules) List(ctx context.Context, opts v1.ListOpti
|
||||
// Watch returns a watch.Interface that watches the requested clusterScalingSchedules.
|
||||
func (c *FakeClusterScalingSchedules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(clusterscalingschedulesResource, c.ns, opts))
|
||||
|
||||
InvokesWatch(testing.NewRootWatchAction(clusterscalingschedulesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a clusterScalingSchedule and creates it. Returns the server's representation of the clusterScalingSchedule, and an error, if there is any.
|
||||
func (c *FakeClusterScalingSchedules) Create(ctx context.Context, clusterScalingSchedule *zalandoorgv1.ClusterScalingSchedule, opts v1.CreateOptions) (result *zalandoorgv1.ClusterScalingSchedule, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(clusterscalingschedulesResource, c.ns, clusterScalingSchedule), &zalandoorgv1.ClusterScalingSchedule{})
|
||||
|
||||
Invokes(testing.NewRootCreateAction(clusterscalingschedulesResource, clusterScalingSchedule), &zalandoorgv1.ClusterScalingSchedule{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -94,8 +89,7 @@ func (c *FakeClusterScalingSchedules) Create(ctx context.Context, clusterScaling
|
||||
// Update takes the representation of a clusterScalingSchedule and updates it. Returns the server's representation of the clusterScalingSchedule, and an error, if there is any.
|
||||
func (c *FakeClusterScalingSchedules) Update(ctx context.Context, clusterScalingSchedule *zalandoorgv1.ClusterScalingSchedule, opts v1.UpdateOptions) (result *zalandoorgv1.ClusterScalingSchedule, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(clusterscalingschedulesResource, c.ns, clusterScalingSchedule), &zalandoorgv1.ClusterScalingSchedule{})
|
||||
|
||||
Invokes(testing.NewRootUpdateAction(clusterscalingschedulesResource, clusterScalingSchedule), &zalandoorgv1.ClusterScalingSchedule{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -105,14 +99,13 @@ func (c *FakeClusterScalingSchedules) Update(ctx context.Context, clusterScaling
|
||||
// Delete takes name of the clusterScalingSchedule and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeClusterScalingSchedules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(clusterscalingschedulesResource, c.ns, name), &zalandoorgv1.ClusterScalingSchedule{})
|
||||
|
||||
Invokes(testing.NewRootDeleteAction(clusterscalingschedulesResource, name), &zalandoorgv1.ClusterScalingSchedule{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeClusterScalingSchedules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(clusterscalingschedulesResource, c.ns, listOpts)
|
||||
action := testing.NewRootDeleteCollectionAction(clusterscalingschedulesResource, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &zalandoorgv1.ClusterScalingScheduleList{})
|
||||
return err
|
||||
@ -121,8 +114,7 @@ func (c *FakeClusterScalingSchedules) DeleteCollection(ctx context.Context, opts
|
||||
// Patch applies the patch and returns the patched clusterScalingSchedule.
|
||||
func (c *FakeClusterScalingSchedules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *zalandoorgv1.ClusterScalingSchedule, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(clusterscalingschedulesResource, c.ns, name, pt, data, subresources...), &zalandoorgv1.ClusterScalingSchedule{})
|
||||
|
||||
Invokes(testing.NewRootPatchSubresourceAction(clusterscalingschedulesResource, name, pt, data, subresources...), &zalandoorgv1.ClusterScalingSchedule{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ type FakeZalandoV1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeZalandoV1) ClusterScalingSchedules(namespace string) v1.ClusterScalingScheduleInterface {
|
||||
return &FakeClusterScalingSchedules{c, namespace}
|
||||
func (c *FakeZalandoV1) ClusterScalingSchedules() v1.ClusterScalingScheduleInterface {
|
||||
return &FakeClusterScalingSchedules{c}
|
||||
}
|
||||
|
||||
func (c *FakeZalandoV1) ScalingSchedules(namespace string) v1.ScalingScheduleInterface {
|
||||
|
@ -35,8 +35,8 @@ type ZalandoV1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *ZalandoV1Client) ClusterScalingSchedules(namespace string) ClusterScalingScheduleInterface {
|
||||
return newClusterScalingSchedules(c, namespace)
|
||||
func (c *ZalandoV1Client) ClusterScalingSchedules() ClusterScalingScheduleInterface {
|
||||
return newClusterScalingSchedules(c)
|
||||
}
|
||||
|
||||
func (c *ZalandoV1Client) ScalingSchedules(namespace string) ScalingScheduleInterface {
|
||||
|
@ -42,33 +42,32 @@ type ClusterScalingScheduleInformer interface {
|
||||
type clusterScalingScheduleInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewClusterScalingScheduleInformer constructs a new informer for ClusterScalingSchedule type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewClusterScalingScheduleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredClusterScalingScheduleInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
func NewClusterScalingScheduleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredClusterScalingScheduleInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredClusterScalingScheduleInformer constructs a new informer for ClusterScalingSchedule type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredClusterScalingScheduleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
func NewFilteredClusterScalingScheduleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ZalandoV1().ClusterScalingSchedules(namespace).List(context.TODO(), options)
|
||||
return client.ZalandoV1().ClusterScalingSchedules().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ZalandoV1().ClusterScalingSchedules(namespace).Watch(context.TODO(), options)
|
||||
return client.ZalandoV1().ClusterScalingSchedules().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&zalandoorgv1.ClusterScalingSchedule{},
|
||||
@ -78,7 +77,7 @@ func NewFilteredClusterScalingScheduleInformer(client versioned.Interface, names
|
||||
}
|
||||
|
||||
func (f *clusterScalingScheduleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredClusterScalingScheduleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
return NewFilteredClusterScalingScheduleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *clusterScalingScheduleInformer) Informer() cache.SharedIndexInformer {
|
||||
|
@ -43,7 +43,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
|
||||
|
||||
// ClusterScalingSchedules returns a ClusterScalingScheduleInformer.
|
||||
func (v *version) ClusterScalingSchedules() ClusterScalingScheduleInformer {
|
||||
return &clusterScalingScheduleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
return &clusterScalingScheduleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ScalingSchedules returns a ScalingScheduleInformer.
|
||||
|
@ -31,8 +31,9 @@ type ClusterScalingScheduleLister interface {
|
||||
// List lists all ClusterScalingSchedules in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1.ClusterScalingSchedule, err error)
|
||||
// ClusterScalingSchedules returns an object that can list and get ClusterScalingSchedules.
|
||||
ClusterScalingSchedules(namespace string) ClusterScalingScheduleNamespaceLister
|
||||
// Get retrieves the ClusterScalingSchedule from the index for a given name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v1.ClusterScalingSchedule, error)
|
||||
ClusterScalingScheduleListerExpansion
|
||||
}
|
||||
|
||||
@ -54,41 +55,9 @@ func (s *clusterScalingScheduleLister) List(selector labels.Selector) (ret []*v1
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// ClusterScalingSchedules returns an object that can list and get ClusterScalingSchedules.
|
||||
func (s *clusterScalingScheduleLister) ClusterScalingSchedules(namespace string) ClusterScalingScheduleNamespaceLister {
|
||||
return clusterScalingScheduleNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// ClusterScalingScheduleNamespaceLister helps list and get ClusterScalingSchedules.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type ClusterScalingScheduleNamespaceLister interface {
|
||||
// List lists all ClusterScalingSchedules in the indexer for a given namespace.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1.ClusterScalingSchedule, err error)
|
||||
// Get retrieves the ClusterScalingSchedule from the indexer for a given namespace and name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v1.ClusterScalingSchedule, error)
|
||||
ClusterScalingScheduleNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// clusterScalingScheduleNamespaceLister implements the ClusterScalingScheduleNamespaceLister
|
||||
// interface.
|
||||
type clusterScalingScheduleNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all ClusterScalingSchedules in the indexer for a given namespace.
|
||||
func (s clusterScalingScheduleNamespaceLister) List(selector labels.Selector) (ret []*v1.ClusterScalingSchedule, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.ClusterScalingSchedule))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the ClusterScalingSchedule from the indexer for a given namespace and name.
|
||||
func (s clusterScalingScheduleNamespaceLister) Get(name string) (*v1.ClusterScalingSchedule, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
// Get retrieves the ClusterScalingSchedule from the index for a given name.
|
||||
func (s *clusterScalingScheduleLister) Get(name string) (*v1.ClusterScalingSchedule, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -22,10 +22,6 @@ package v1
|
||||
// ClusterScalingScheduleLister.
|
||||
type ClusterScalingScheduleListerExpansion interface{}
|
||||
|
||||
// ClusterScalingScheduleNamespaceListerExpansion allows custom methods to be added to
|
||||
// ClusterScalingScheduleNamespaceLister.
|
||||
type ClusterScalingScheduleNamespaceListerExpansion interface{}
|
||||
|
||||
// ScalingScheduleListerExpansion allows custom methods to be added to
|
||||
// ScalingScheduleLister.
|
||||
type ScalingScheduleListerExpansion interface{}
|
||||
|
@ -200,6 +200,7 @@ type MetricConfig struct {
|
||||
ObjectReference custom_metrics.ObjectReference
|
||||
PerReplica bool
|
||||
Interval time.Duration
|
||||
MinPodReadyAge time.Duration
|
||||
MetricSpec autoscalingv2.MetricSpec
|
||||
}
|
||||
|
||||
@ -234,8 +235,8 @@ func ParseHPAMetrics(hpa *autoscalingv2.HorizontalPodAutoscaler) ([]*MetricConfi
|
||||
}
|
||||
case autoscalingv2.ExternalMetricSourceType:
|
||||
typeName.Metric = metric.External.Metric
|
||||
case autoscalingv2.ResourceMetricSourceType:
|
||||
continue // kube-metrics-adapter does not collect resource metrics
|
||||
case autoscalingv2.ResourceMetricSourceType, autoscalingv2.ContainerResourceMetricSourceType:
|
||||
continue // kube-metrics-adapter does not collect resource or container resource metrics
|
||||
}
|
||||
|
||||
config := &MetricConfig{
|
||||
@ -258,6 +259,7 @@ func ParseHPAMetrics(hpa *autoscalingv2.HorizontalPodAutoscaler) ([]*MetricConfi
|
||||
config.CollectorType = annotationConfigs.CollectorType
|
||||
config.Interval = annotationConfigs.Interval
|
||||
config.PerReplica = annotationConfigs.PerReplica
|
||||
config.MinPodReadyAge = annotationConfigs.MinPodReadyAge
|
||||
// configs specified in annotations takes precedence
|
||||
// over labels
|
||||
for k, v := range annotationConfigs.Configs {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user