-
Bug
-
Resolution: Done
-
Normal
-
None
-
1.15.0, 1.16.0
-
3
-
False
-
-
False
-
-
-
GitOps Scarlet Sprint 15, GitOps Scarlet Sprint 16
Description of Problem
Operator supports scaling the argocd-server deployment using `spec.server.replicas` field in ArgoCD CR. When set, Operator creates the required number of replica pods. However, for Argo CD to limit the concurrent login requests properly when more than 1 replicas is present for server, it needs to be made aware on number of replicas using ARGOCD_API_SERVER_REPLICAS env in the deployment which the operator doesn't set.
Note that this bug doesn't impact the server's core functionality. It just fails to enforce limits on login request since the ARGOCD_API_SERVER_REPLICAS env var is missing.
Additional Info
- https://argo-cd.readthedocs.io/en/stable/operator-manual/high_availability/#argocd-server
- https://argocd-operator.readthedocs.io/en/latest/reference/argocd/#server-autoscale-options
Problem Reproduction
- Refer Steps to reproduce section below
Reproducibility
- Always
Prerequisites/Environment
- GitOps Operator or Argo CD Operator
Steps to Reproduce
- Install GitOps Operator
- Set `spec.server.replicas: 3` in ArgoCD CR
- Ensure 3 replica server pods are created
- Check ARGOCD_API_SERVER_REPLICAS env in server deployment
Expected Results
- ARGOCD_API_SERVER_REPLICAS env in server deployment is set to number of server replicas
Actual Results
- No ARGOCD_API_SERVER_REPLICAS env is present in the server deployment
Workaround (If Possible)
- Manually add the required ARGOCD_API_SERVER_REPLICAS env var using `spec.server.env` field in ArgoCD CR when .spec.server.replicas is set
Fix Approaches
- Add logic in operator to set the ARGOCD_API_SERVER_REPLICAS env to value of replicas when spec.server.replicas is set
- https://github.com/argoproj-labs/argocd-operator/blob/a0b3b74082b7a6fcc13b37977e213a10cb85faf1/controllers/argocd/deployment.go#L1596-L1598
- Ensure that env value is ignored/not set when .spec.server.autoscale.enabled in ArgoCD CR is set
Acceptance Criteria
- Required logic is in place to add the env
- unit test is added
- e2e test is added (if required)
Definition of Done
- Code Complete:
- All code has been written, reviewed, and approved.
- Tested:
- Unit tests have been written and passed.
- Ensure code coverage is not reduced with the changes.
- Integration tests have been automated.
- System tests have been conducted, and all critical bugs have been fixed.
- Tested and merged on OpenShift either upstream or downstream on a local build.
- Documentation:
- User documentation or release notes have been written (if applicable).
- Build:
- Code has been successfully built and integrated into the main repository / project.
- Midstream changes (if applicable) are done, reviewed, approved and merged.
- Review:
- Code has been peer-reviewed and meets coding standards.
- All acceptance criteria defined in the user story have been met.
- Tested by reviewer on OpenShift.
- Deployment:
- The feature has been deployed on OpenShift cluster for testing.