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
Im currently using kopf to create a custom k8s controller.
I have these resources in my cluster:
my config-map foo contains some json config
my deployment bar references foo as config-map-ref
My watches when a custom resource is deployed/updated/deleted:
get the current deployment bar
create a copy of the config-map foo and adjust values
update the deployment bar to point to the copy of the config
This works great.
The problem arises when the deployment bar is deployed again (via kubectl apply e.g.). All changes that wore done by the controller are gone.
I attempted to fix this by creating a listener for the deployment. In that a would iterate other all my custom resources and proceed like before (When a custom resource is deployed/updated/deleted).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone!
Im currently using kopf to create a custom k8s controller.
I have these resources in my cluster:
foo
contains some json configbar
referencesfoo
as config-map-refMy watches when a custom resource is deployed/updated/deleted:
bar
foo
and adjust valuesbar
to point to the copy of the configThis works great.
The problem arises when the deployment
bar
is deployed again (viakubectl apply
e.g.). All changes that wore done by the controller are gone.I attempted to fix this by creating a listener for the deployment. In that a would iterate other all my custom resources and proceed like before (When a custom resource is deployed/updated/deleted).
The code breaks down to something like this:
This will, of cause, cause an infinite loop in my controller.
My questions are:
I appreciate any hints!
Beta Was this translation helpful? Give feedback.
All reactions