Description
Problem
The MQTT Schema Agent is currently created as a Kubernetes Pod (via createNamespacedPod) rather than a Deployment. This makes standard Kubernetes cluster maintenance significantly harder:
- Rolling restarts (e.g.,
kubectl rollout restart) do not work - bare pods are not rescheduled automatically
- Node drain operations will terminate the pod and it will not be rescheduled, causing downtime
- No self-healing - if the pod crashes or is evicted, it stays down until manually restarted through the FlowFuse
- Inconsistency - Instance Pods are managed differently; agents should follow the same lifecycle patterns
Proposed Solution
Replace the bare Pod creation in createMQTTTopicAgent with a Kubernetes Deployment (with replicas: 1). The corresponding pod template should be updated to a Deployment spec wrapping the same container definition.
The stopBrokerAgent method would then delete the Deployment resource (and its managed ReplicaSet/Pod) rather than a bare pod.
The getBrokerAgentState and sendBrokerAgentCommand methods communicate with the agent over its in-cluster Service and should be unaffected by this change.
Benefits
- Pods are automatically rescheduled after node drain/failure
- Standard
kubectl maintenance workflows apply (drain, cordon, rolling restart)
- Consistent with how other workloads are managed in the cluster
Requested By
Internal initiative
Description
Problem
The MQTT Schema Agent is currently created as a Kubernetes
Pod(viacreateNamespacedPod) rather than aDeployment. This makes standard Kubernetes cluster maintenance significantly harder:kubectl rollout restart) do not work - bare pods are not rescheduled automaticallyProposed Solution
Replace the bare Pod creation in
createMQTTTopicAgentwith a KubernetesDeployment(withreplicas: 1). The corresponding pod template should be updated to aDeploymentspec wrapping the same container definition.The
stopBrokerAgentmethod would then delete theDeploymentresource (and its managed ReplicaSet/Pod) rather than a bare pod.The
getBrokerAgentStateandsendBrokerAgentCommandmethods communicate with the agent over its in-cluster Service and should be unaffected by this change.Benefits
kubectlmaintenance workflows apply (drain, cordon, rolling restart)Requested By
Internal initiative