Does the K8s operator SDK support multi-threading?

117 views
Skip to first unread message

Victor Hugo Del Carpio Gomez

unread,
Jul 8, 2024, 4:37:45 PM7/8/24
to Operator Framework
Hi Operator SDK Community,

I'm currently developing an operator to manage multiple custom resources using the Operator SDK. The operator handles various tasks that can be quite time-consuming, especially when dealing with multiple clusters. The issue I'm encountering is that the operator processes each cluster sequentially during its reconciliation cycle. This sequential approach becomes a significant bottleneck, particularly during high activity periods like upgrades or resizing operations. Consequently, the operator takes a considerable amount of time to complete these tasks, impacting overall system performance and responsiveness.
I'm wondering if there's a way to parallelize the reconciliation process within an operator. If so, what are the recommended best practices or patterns to achieve this while working within the constraints of the Operator SDK?

Any insights or advice would be greatly appreciated. Thanks in advance!

Cheers,
Vic

John Mazzitelli

unread,
Jul 8, 2024, 5:21:38 PM7/8/24
to Operator Framework
I didn't even know this google group existed... Questions like this are normally asked and answered in the Kubernetes Slack channel, in the #kubernetes-operators room :

https://kubernetes.slack.com/archives/CAW0GV7A5

I, myself, don't have an answer for you (I only am familiar with Ansible operators, and I never had to do anything which you are asking about). I assume you are writing your operator in Go so it sounds like you'll want to use Go async methods. But, again, ask in the Kubernetes Slack and perhaps someone there would know some pointers.

Anup Chandak

unread,
Jul 9, 2024, 9:24:39 AM7/9/24
to Operator Framework
Operator does give option to control maximum concurrent reconciliation of CRs. Argument is --max-concurrent-reconciles

Thanks!

Reply all
Reply to author
Forward
0 new messages