Closed leynebe closed 5 months ago
@leynebe any luck in fixing this?
@cdenneen No. I have not had the time to properly imvestigate. I was hoping you guys had an easy solution or some tips. It's getting more urgent though, non of the shiny pods are killed upon upgrade, so it's beginning to get obscene how many pods that are just running and wasting money. I'll have a look when I find the time or priorities change.
@leynebe I don't work on this project. Just user like yourself. If you find solution let me know. Otherwise only thing I can think of is a CronJob to determine and kill lingering pods. I'm actually having more of an issue with the proxied apps staying around. I have stop-proxies-on-shutdown: false
so I do expect to see them staying around for a bit but I tested and when I clicked same app again it spun up new pod for it rather than the one running for 4hrs
Hi @leynebe
I looked into this and found that this is being caused by the following part of your configuration:
management:
endpoints:
web:
exposure:
include: info,health,beans,prometheus,metrics
This property tells Spring which actuator (management) endpoints to expose. The default ShinyProxy config includes an endpoint called recyclable
(https://github.com/openanalytics/containerproxy/blob/2c71c88a0f8a8f71e2551343e09b659c6f11c1fe/src/main/java/eu/openanalytics/containerproxy/ContainerProxyApplication.java#L342) which is used by the operator to check whether a ShinyProxy instance still has active websocket connections.
Usually there is no need to configure this option, so I would advice to just remove it. If you do need this option, it would be useful to know the reason, such that we can either better cover this use-case or document it on the website.
Once you remove this option, the old instances will not be removed automatically. You can either re-deploy ShinyProxy (by removing the custom resource and re-creating it), or you can manually remove the old instances from the ShinyProxy resource, using:
kubectl edit shinyproxy <crd_name> -n <namespace> --subresource='status'
Next you need to remove the old replicasets and configmaps created by shinyproxy.
@LEDfan
Usually there is no need to configure this option, so I would advice to just remove it. If you do need this option, it would be useful to know the reason, such that we can either better cover this use-case or document it on the website.
I will try adding this default option back. Thanks for the research and explanation!!
@LEDfan This worked. Thanks a bunch!
I scoured the shinyproxy operator config docs and after not finding an option to terminate old shinyproxy pods I discovered the shinyproxy operator itself was throwing errors. 2 errors stand out to me from the following shinyproxy operator logs:
Caught an exception while processing event ShinyProxyEvent(eventType=CHECK_OBSOLETE_INSTANCES...
: This explains why we have a huge list of old shinyproxy pods which are not being terminated.Unrecognized field "timestamp": Some health checks that aren't properly configured?
If there's anything I can try, let me know.