HA/DR Strategy for Self-Hosted Agents
How to setup your self-hosted agent in an Active/Passive configuration
For a high-availability configuration of the env0 self-hosted agent, you can install the agent in two different K8s clusters in two different availability zones. You can configure the self-hosted agent in the following mode:
Active-Passive
- Setup the failover agent in a separate region or availability zone
- Once you confirmed that the agent is live and running, scale the deployment to 0.
kubectl scale deploy <agentname>.agent-trigger-deployment --replicas=0
if using the proxy pod, also scale the proxy deployment to 0.
kubectl scale deploy <agentname>.agent-proxy-deployment --replicas=0
- When an outage has occurred in the primary cluster, scale the failover deployments back to 1
kubectl scale deploy <agentname>.agent-trigger-deployment --replicas=1
if using the proxy pod, also scale the proxy deployment to 1.
kubectl scale deploy <agentname>.agent-proxy-deployment --replicas=1
Considerations
- Working Directory: when failing over to a new cluster, the working directory may not be in sync or backed up. This will result in the high possibility that you cannot resume or approve a deployment that was waiting for approval. A simple redeployment will allow you to resume your deployments in the new cluster.
- Alternatively you can use env0-Hosted Encrypted State to resume deployments across multiple clusters.
Updated 11 months ago
Whatâs Next