-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HorizontalPodAutoscaler causes repeated "configured" logs in kustomize log #494
Comments
Can you please post here the output of |
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
annotations:
autoscaling.alpha.kubernetes.io/behavior: '{"ScaleUp":{"StabilizationWindowSeconds":0,"SelectPolicy":"Max","Policies":[{"Type":"Percent","Value":100,"PeriodSeconds":3},{"Type":"Pods","Value":4,"PeriodSeconds":3}]},"ScaleDown":{"StabilizationWindowSeconds":60,"SelectPolicy":"Max","Policies":[{"Type":"Percent","Value":100,"PeriodSeconds":15}]}}'
autoscaling.alpha.kubernetes.io/conditions: '[{"type":"AbleToScale","status":"True","lastTransitionTime":"2021-11-22T09:44:08Z","reason":"ReadyForNewScale","message":"recommended
size matches current size"},{"type":"ScalingActive","status":"True","lastTransitionTime":"2021-11-22T09:45:38Z","reason":"ValidMetricFound","message":"the
HPA was able to successfully calculate a replica count from external metric
httpproxy_requests_active(\u0026LabelSelector{MatchLabels:map[string]string{my-label:
metric-1,},MatchExpressions:[]LabelSelectorRequirement{},})"},{"type":"ScalingLimited","status":"True","lastTransitionTime":"2021-11-22T09:45:38Z","reason":"TooFewReplicas","message":"the
desired replica count is less than the minimum replica count"}]'
autoscaling.alpha.kubernetes.io/current-metrics: '[{"type":"External","external":{"metricName":"httpproxy_requests_active","metricSelector":{"matchLabels":{"my-label":"metric-1"}},"currentValue":"0"}}]'
autoscaling.alpha.kubernetes.io/metrics: '[{"type":"External","external":{"metricName":"httpproxy_requests_active","metricSelector":{"matchLabels":{"my-label":"metric-1"}},"targetValue":"5"}}]'
creationTimestamp: "2021-11-22T09:43:53Z"
labels:
kustomize.toolkit.fluxcd.io/name: apps
kustomize.toolkit.fluxcd.io/namespace: flux-system
managedFields:
- apiVersion: autoscaling/v2beta2
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:labels:
f:kustomize.toolkit.fluxcd.io/name: {}
f:kustomize.toolkit.fluxcd.io/namespace: {}
f:spec:
f:behavior:
f:scaleDown:
f:policies: {}
f:stabilizationWindowSeconds: {}
f:scaleUp:
f:policies: {}
f:selectPolicy: {}
f:stabilizationWindowSeconds: {}
f:maxReplicas: {}
f:metrics: {}
f:minReplicas: {}
f:scaleTargetRef:
f:apiVersion: {}
f:kind: {}
f:name: {}
f:status:
f:conditions: {}
f:currentMetrics: {}
f:currentReplicas: {}
f:desiredReplicas: {}
manager: kustomize-controller
operation: Apply
time: "2021-11-23T13:30:11Z"
- apiVersion: autoscaling/v1
fieldsType: FieldsV1
fieldsV1:
f:status:
f:lastScaleTime: {}
manager: kube-controller-manager
operation: Update
time: "2021-11-22T17:46:06Z"
name: hpa
namespace: foo
resourceVersion: "324570024"
uid: 8813043b-bc8d-400a-ba2a-fe90da576bbc
spec:
maxReplicas: 10
minReplicas: 2
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: api
status:
currentReplicas: 2
desiredReplicas: 2
lastScaleTime: "2021-11-22T09:44:08Z"
|
Please do |
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
creationTimestamp: "2021-11-22T09:43:53Z"
labels:
kustomize.toolkit.fluxcd.io/name: apps
kustomize.toolkit.fluxcd.io/namespace: flux-system
managedFields:
- apiVersion: autoscaling/v2beta2
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:labels:
f:kustomize.toolkit.fluxcd.io/name: {}
f:kustomize.toolkit.fluxcd.io/namespace: {}
f:spec:
f:behavior:
f:scaleDown:
f:policies: {}
f:stabilizationWindowSeconds: {}
f:scaleUp:
f:policies: {}
f:selectPolicy: {}
f:stabilizationWindowSeconds: {}
f:maxReplicas: {}
f:metrics: {}
f:minReplicas: {}
f:scaleTargetRef:
f:apiVersion: {}
f:kind: {}
f:name: {}
f:status:
f:conditions: {}
f:currentMetrics: {}
f:currentReplicas: {}
f:desiredReplicas: {}
manager: kustomize-controller
operation: Apply
time: "2021-11-23T13:50:37Z"
- apiVersion: autoscaling/v1
fieldsType: FieldsV1
fieldsV1:
f:status:
f:lastScaleTime: {}
manager: kube-controller-manager
operation: Update
time: "2021-11-22T17:46:06Z"
name: hpa
namespace: foo
resourceVersion: "324594649"
uid: 8813043b-bc8d-400a-ba2a-fe90da576bbc
spec:
behavior:
scaleDown:
policies:
- periodSeconds: 15
type: Percent
value: 100
selectPolicy: Max
stabilizationWindowSeconds: 60
scaleUp:
policies:
- periodSeconds: 3
type: Percent
value: 100
- periodSeconds: 3
type: Pods
value: 4
selectPolicy: Max
stabilizationWindowSeconds: 0
maxReplicas: 10
metrics:
- external:
metric:
name: httpproxy_requests_active
selector:
matchLabels:
my-label: metric-1
target:
type: Value
value: "5"
type: External
minReplicas: 2
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: api
status:
conditions:
- lastTransitionTime: "2021-11-22T09:44:08Z"
message: recommended size matches current size
reason: ReadyForNewScale
status: "True"
type: AbleToScale
- lastTransitionTime: "2021-11-22T09:45:38Z"
message: 'the HPA was able to successfully calculate a replica count from external
metric httpproxy_requests_active(&LabelSelector{MatchLabels:map[string]string{my-label:
metric-1,},MatchExpressions:[]LabelSelectorRequirement{},})'
reason: ValidMetricFound
status: "True"
type: ScalingActive
- lastTransitionTime: "2021-11-22T09:45:38Z"
message: the desired replica count is less than the minimum replica count
reason: TooFewReplicas
status: "True"
type: ScalingLimited
currentMetrics:
- external:
current:
value: "0"
metric:
name: httpproxy_requests_active
selector:
matchLabels:
my-label: metric-1
type: External
currentReplicas: 2
desiredReplicas: 2
lastScaleTime: "2021-11-22T09:44:08Z" |
Hmm I can't reproduce this on Kubernetes v1.21. Can you please copy the |
The difference between the source and the server spec is |
I think there is a error in my HPA, if the type is |
The problem is not fixed by using the spec from the server. |
@stefanprodan This problem is not resolved with flux 0.24.0. Can you please reopen the issue. |
Maybe this is related to kubernetes/kubernetes#74099 |
I have two HorizontalPodAutoscaler reconciled by a Kustomization. They both are created as expected by the Kustomization, however the follwoing is shown in the events of the Kustomization:
This is the resource yaml:
The text was updated successfully, but these errors were encountered: