You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing an operator to manage RabbitMQ queues and would like to know if there's a way for k8s to enforce immutability of particular spec fields. I have the following struct which represents a rabbitMQ queue and some parameters to have it bind to a rabbitMQ exchange:
The reason why I want immutability, specifically for VHost, is because it's a parameter that's used to namespace a queue in rabbitMQ. If it were changed for an existing deployed queue, the reconciler will fail to query rabbitMQ for the intended queue since it will be querying with a different vhost (effectively a different namespace), which could cause the creation of a new queue or an update of the wrong queue.
There are a few alternatives that I'm considering such as using the ObjectMeta.Name field to contain both the concatenated vhost and the queuename to ensure that they are immutable for a deployed queue. Or caching older spec parameters (haven't figured out exactly how to do this yet) and do a comparison in the reconciler in order to return an error. However neither of these approaches seem ideal.
Please bear with me as I'm also new to Kubernetes and appreciate any advice/feedback. Thanks!
The text was updated successfully, but these errors were encountered:
In the meanwhile you'll have to use a ValidatingAdmissionWebhook to validate your CR and check that certain fields are not changed by looking at the AdmissionRequest and comparing the old and new objects.
We're still sorting out our proposal to scaffold Validating and Mutating AdmissionWebhooks in the SDK. #1455
Parent issue: #1217
If you have questions on the approach we can discuss them here.
But for tracking the feature request for validating admission webhooks, we should probably consolidate that to #1217
I'm writing an operator to manage RabbitMQ queues and would like to know if there's a way for k8s to enforce immutability of particular spec fields. I have the following struct which represents a rabbitMQ queue and some parameters to have it bind to a rabbitMQ exchange:
The reason why I want immutability, specifically for
VHost
, is because it's a parameter that's used to namespace a queue in rabbitMQ. If it were changed for an existing deployed queue, the reconciler will fail to query rabbitMQ for the intended queue since it will be querying with a different vhost (effectively a different namespace), which could cause the creation of a new queue or an update of the wrong queue.There are a few alternatives that I'm considering such as using the
ObjectMeta.Name
field to contain both the concatenated vhost and the queuename to ensure that they are immutable for a deployed queue. Or caching older spec parameters (haven't figured out exactly how to do this yet) and do a comparison in the reconciler in order to return an error. However neither of these approaches seem ideal.Please bear with me as I'm also new to Kubernetes and appreciate any advice/feedback. Thanks!
The text was updated successfully, but these errors were encountered: