Skip to content
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

Prevent updating persistentStorage on Habitat CRD #308

Open
indradhanush opened this issue Jul 6, 2018 · 6 comments
Open

Prevent updating persistentStorage on Habitat CRD #308

indradhanush opened this issue Jul 6, 2018 · 6 comments

Comments

@indradhanush
Copy link
Contributor

Attempting to change the size of a persistentStorage leads to the following error from the Kubernetes API:

ts=2018-07-06T12:39:03.935057362Z level=error component=controller/v1beta2 msg="Habitat could not be synced, requeueing" err="StatefulSet.apps \"example-persistent-habitat\" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden." obj=default/example-persistent-habitat

The HabitatCRD should have a check for this and not allow the update to be processed. This will prevent an infinite loop where the controller requeues the item when the update operation fails on the Kubernetes API.

@asymmetric
Copy link
Contributor

The loop will not be infinite, there's a limit to how many times an object is requeued.

@indradhanush
Copy link
Contributor Author

The link looks broken at the moment. 🤔

@asymmetric
Copy link
Contributor

Oops, here's the correct link.

@iaguis
Copy link
Contributor

iaguis commented Jul 9, 2018

Permalink:

queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "Habitats"),

@krnowak
Copy link
Contributor

krnowak commented Jul 10, 2018

My impression was that rate limiting is not about limiting the number of retries, but it is rather about limiting a frequency of retries (through backoff times). A documentation of NewRateLimitingQueue says:

NewRateLimitingQueue constructs a new workqueue with rateLimited queuing ability
Remember to call Forget! If you don't, you may end up tracking failures forever.

But I might be wrong. Maybe DefaultControllerRateLimiter that we use does limit retries, but I haven't read the code to check it and the docs are sh^Wless than stellar.

Also, we call Forget only when an item was processed successfully or when the item is not a Habitat object.

@asymmetric
Copy link
Contributor

@krnowak You might be right. Worth looking into :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants