Skip to content

Commit

Permalink
fix(controller): fix application controller deployment crashing (argo…
Browse files Browse the repository at this point in the history
…proj#16984)

* fix application controller deployment crashing and update manifests

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* remove environment variable ARGOCD_ENABLE_DYNAMIC_CLUSTER_DISTRIBUTION

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

* fix auto-generated docs

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>

---------

Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: Adrian Aneci <aneci@adobe.com>
  • Loading branch information
ishitasequeira authored and adriananeci committed Feb 25, 2024
1 parent b7b5414 commit 5f563b3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func getClusterSharding(kubeClient *kubernetes.Clientset, settingsMgr *settings.
// If we still see conflicts after the retries, wait for next iteration of heartbeat process.
for i := 0; i <= common.AppControllerHeartbeatUpdateRetryCount; i++ {
shardNumber, err = sharding.GetOrUpdateShardFromConfigMap(kubeClient, settingsMgr, replicasCount, shardNumber)
if !kubeerrors.IsConflict(err) {
if err != nil && !kubeerrors.IsConflict(err) {
err = fmt.Errorf("unable to get shard due to error updating the sharding config map: %s", err)
break
}
Expand Down
10 changes: 2 additions & 8 deletions docs/operator-manual/dynamic-cluster-distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@ which does not require a restart of the application controller pods.

## Enabling Dynamic Distribution of Clusters

This feature is disabled by default while it is in alpha. To enable it, you must set the environment `ARGOCD_ENABLE_DYNAMIC_CLUSTER_DISTRIBUTION` to true when running the Application Controller.

In order to utilize the feature, the manifests `manifests/ha/base/controller-deployment/` can be applied as a Kustomize
overlay. This overlay sets the StatefulSet replicas to `0` and deploys the application controller as a Deployment. The
dynamic distribution code automatically kicks in when the controller is deployed as a Deployment.
This feature is disabled by default while it is in alpha. In order to utilize the feature, the manifests `manifests/ha/base/controller-deployment/` can be applied as a Kustomize overlay. This overlay sets the StatefulSet replicas to `0` and deploys the application controller as a Deployment. Also, you must set the environment `ARGOCD_ENABLE_DYNAMIC_CLUSTER_DISTRIBUTION` to true when running the Application Controller as a deployment.

!!! important
The use of a Deployment instead of a StatefulSet is an implementation detail which may change in future versions of
this feature. Therefore, the directory name of the Kustomize overlay may change as well. Monitor the release notes
to avoid issues.
The use of a Deployment instead of a StatefulSet is an implementation detail which may change in future versions of this feature. Therefore, the directory name of the Kustomize overlay may change as well. Monitor the release notes to avoid issues.

Note the introduction of new environment variable `ARGOCD_CONTROLLER_HEARTBEAT_TIME`. The environment variable is explained in [working of Dynamic Distribution Heartbeat Process](#working-of-dynamic-distribution)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ spec:
- args:
- /usr/local/bin/argocd-application-controller
env:
- name: ARGOCD_CONTROLLER_REPLICAS
value: "1"
- name: ARGOCD_RECONCILIATION_TIMEOUT
valueFrom:
configMapKeyRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
targetPort: 8082
- name: metrics
protocol: TCP
port: 8082
targetPort: 8082
port: 8084
targetPort: 8084
selector:
app.kubernetes.io/name: argocd-application-controller

0 comments on commit 5f563b3

Please sign in to comment.