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

exclude apps, with only 1 replica #79

Open
robert-stevenson opened this issue Apr 11, 2018 · 2 comments
Open

exclude apps, with only 1 replica #79

robert-stevenson opened this issue Apr 11, 2018 · 2 comments

Comments

@robert-stevenson
Copy link

robert-stevenson commented Apr 11, 2018

I'd like the ability to exclude apps with only 1 replica; any ideas? Would require a change I presume...

@linki
Copy link
Owner

linki commented Apr 18, 2018

That would be a bit more work as chaoskube currently works solely on the Pod list.

One would have to use the ownerReferences to find its ReplicaSet and from there the current number of siblings.

Another but more hackier way would be to take the labels of the potential target Pod and make sure there's at least one other Pod matching the same labels before killing it. (Other Pods with the same labels are likely members of the same Deployment I would assume.)

An alternative would be to continue work on respecting PodDisruptionBudgets (PDBs)(#13) in which case you could "protect" your single Pod. However, that would also effect all other components working on PDBs such as controlled cluster updates which might not like that. (PDBs for single replica Deployments aren't really good practice.)

@linki
Copy link
Owner

linki commented Jun 2, 2018

I think this makes a lot of sense in order to start using chaoskube without unnecessary interruptions.

There are applications that aren't high-available and if their single replica dies they are just gone for a moment. If you're fine with that and still want to use chaoskube on all of your other stuff, there should be an option to do just that.

Let's go with:

One would have to use the ownerReferences to find its ReplicaSet and from there the current number of siblings.

Furthermore, anything that isn't reconciled by a controller (e.g. kubectl run -i -t busybox --image=busybox --restart=Never) should also be excluded in this mode.

/cc @robert-stevenson

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

No branches or pull requests

2 participants