moonbeam-nyc / snorlax

wake and sleep Kubernetes deployments on a schedule
https://moonbeam.nyc
Apache License 2.0
147 stars 10 forks source link

Bug: Snorlax Manager cannot clean up role after wake-up #2

Closed kehralexander closed 3 months ago

kehralexander commented 3 months ago

Info

Version: Helm release 0.4.0

What happened?

Looks like it lacks some permissions to clean up the snorlax proxy after it wakes up the deployment(s):

2024-06-03T09:31:05Z    ERROR    Failed to delete Snorlax proxy    {"controller": "sleepschedule", "controllerGroup": "snorlax.moonbeam.nyc", "controllerKind": "SleepSchedule", "SleepSchedule": {"name":"snorlax-sleep-schedule","namespace":"<NAMESPACE>"}, "namespace": "<NAMESPACE>", "name": "snorlax-sleep-schedule", "reconcileID": "7ba1cc3a-66d2-4a9d-8791-996223dbb6b9", "error": "roles.rbac.authorization.k8s.io \"snorlax-snorlax-sleep-schedule\" is forbidden: User \"system:serviceaccount:snorlax:snorlax-controller-manager\" cannot delete resource \"roles\" in API group \"rbac.authorization.k8s.io\" in the namespace \"<NAMESPACE>\""}

How to reproduce/What did I do?

  1. Deploy an snorlax sleep schedule with it's sleep time being now, and wait for it to reconcile and go to sleep
  2. Wake it up with an request
  3. Wait for deployments to become ready
  4. -> Error message

Consequences

Snorlax doesn't work anymore (fails reconcile due to the error), sleepschedule has to be force deleted and ingress is dirty (still points to snorlax proxy).

azlyth commented 3 months ago

Hey @kehralexander đź‘‹ I've responded in your PR. Thanks again!

azlyth commented 3 months ago

The fix is fixed in the latest release, thanks again @kehralexander!