Closed sarge closed 6 years ago
The lifecycle change in main.tf
makes certainly sense.
I'm not completely sure about the events change. What have you done to trigger this error? I have never seen it. Anyway, my main confusion is right now that we have creation of events in the ClusterRole and patching of events in the Role. I think it would make sense to have them together - either in the ClusterRole if that is needed or in the Role.
Good point on adding the events to the cluster role.
Digging into the logging of events, the chain of dependencies goes
https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/core/scale_up.go#L356
Which uses a LogRecorder
Which in turn is made from an EventRecorder
https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/utils/kubernetes/factory.go#L31
The EventRecorder
does some aggregation and correlation which under some situations can create or update an existing event. Which is why I don't tend to see it every time.
https://github.com/kubernetes/client-go/blob/master/tools/record/event.go#L130
I mis-read the error message, on the last PR. I have just done another scaling operation and got this error message. I don't think this get raised everytime.
I think this is the correct fix.
I have also included a small fix to correct overwriting the current autoscaling group capacity.