Closed
Description
If you change a worker setting for the opentofu_worker it is supposed to be restarted in order to pick up the new value
On appliances a MiqServer.reload_settings message is queued and the settings are detected correctly as changed and the worker is restarted.
On podified there is no OpentofuWorker record created in the MiqWorker table so the orchestrator doesn't know to restart it.
Looking at the orchestrator logs it tries to start the worker every 10 seconds:
MIQ(OpentofuWorker.sync_workers) Workers are being synchronized: Current #: [0], Desired #: [1]
MIQ(ContainerOrchestrator#patch_deployment) deployment_name: 1-opentofu-runner, data: {:spec=>{:replicas=>1}}
MIQ(MiqQueue.put) Message id: [1194934], Zone: [default], Role: [], Server: [], MiqTask id: [], Handler id: [], Ident: [generic], Target id: [], Instance id: [], Task id: [], Command: [MiqEvent.raise_evm_event], Timeout: [600], Priority: [100], State: [ready], Deliver On: [], Data: [], Args: [[\"MiqServer\", 1], \"evm_worker_start\", {:event_details=>\"Worker started: ID [], PID [], GUID [9f79b116-8273-45fc-9efa-3288751fe873]\", :type=>\"OpentofuWorker\"}]
MIQ(OpentofuWorker#start) Worker started: ID [], PID [], GUID [9f79b116-8273-45fc-9efa-3288751fe873]
MIQ(MiqServer#heartbeat) Heartbeat [2024-07-19 12:56:02 UTC]...
MIQ(MiqServer#heartbeat) Heartbeat [2024-07-19 12:56:02 UTC]...Complete
MIQ(OpentofuWorker.sync_workers) Workers are being synchronized: Current #: [0], Desired #: [1]
irb(main):003:0> OpentofuWorker.count
=> 0
$ oc get pods | grep opentofu
1-opentofu-runner-5c976747bf-njq2s 1/1 Running 0 28h
On podified MiqWorker
records are created by the run_single_worker
script due to how replicas work on kubernetes. The OpentofuWorker
is a non-ruby worker and doesn't use this entrypoint which means no MiqWorker
ever gets created.