* Adds consistent hashing with bound loads sharding algorithm
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Make the assignement consistent accross all clusters
- The assignment or running of the algorithm has to be consistent across all the clusters. Changed the function to return a map where the consistent hash will be used to build the map
- Modifications to the createConsistentHashsingWithBoundLoads function. This will create the map for cluster to shard. Note that the list must be consistent across all shards so that is why the cluster list must be sorted before going through the consistent hash algorithm
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Extracting constant and simplifying boolean expression
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Update docs: consistent-hashing sharding algorithm
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
---------
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* fix: infer correct shard in statefulset setup
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix the case if only a single replica
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: resolving pointer on shard compare
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: add readlock for cluster accessor
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: use defer to protect access of 'shard'
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: revert locking in getclusteraccessor
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: handle nil shard case
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: handle any nil shard value as false
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: handle nil case and fix another missing pointer dereference
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* revert
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: added tests and fixed some behaviour bugs
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* test: add test to validate that Shard value is not overriden
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: added tests and fixe the case when server is changed inside a secret
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* tests: add test cases for infering the shard logic
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
---------
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* feat(sharding): use a cache
Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>
* cluster cmd
Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>
* - Assign shard 0 to in-cluster cluster and nil check updates
- Caching clusters while sharding: Fixing unit tests
- Update generated docs
- Debug e2e tests
- Default the shardNumber to the number of replicas if it is calculated to a higher value
- defered Unlock only when a lock is set
- Disabling temporarly other versions of k3s to check if e2e passes
- Do not fail if hostname format is not abc-n
- Fix unit test and skip some e2e
- Skip TestGitSubmoduleHTTPSSupport test
- Remove breaking defer c.lock.Unlock()
- Reverting testing all k3s version
- Default sharding fix
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* fixes related to code review: renaming structure param, moving db initialisation
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Code review
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Set default shard to 0
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Set different default value for Sts and Deployment mode
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Expose ClusterShardingCache
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Removing use of argoDB.db for DistributionFunction
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Update generated documentation
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Fix comment about NoShardingDistributionFunction and NoShardingAlgorithm
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
---------
Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
Co-authored-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>
* Added error checking to determine if application controller deployment is found or not
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
* Fixed the informer to list deployments in namespace scope
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
* Fixed readiness check probe for application controller when running as deployment
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
---------
Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
* fix: Extraction of DistributionFunction to allow passing different type of functions to filter clusters by shard
- Adding unit tests for sharding
- Refresh clusters list on DistributionFunction call
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
* fix: Incorrect conversion of an integer with architecture-dependent bit size from [strconv.Atoi](1) to a lower bit size type uint32 without an upper bound check.
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Added config to switch to round-robin sharding
Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Documenting sharding more, adding shuffling tests (skipped), re-enable sharding algo env var
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Allow configuration through argocd-cmd-params-cm configMap and key: controller.sharding.algorithm
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* De-duplicate code, remove reflection for default case, shorten distribution methods name, ran codegen on manifests
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
---------
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Co-authored-by: Raghavi Shirur <raghaviss11@gmail.com>
* Allow using env var to set kubectl parallelism limit
Closes https://github.com/argoproj/argo-cd/issues/8442.
Signed-off-by: Tom Elliff-O'Shea <tomelliff@gmail.com>
* add config key
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
---------
Signed-off-by: Tom Elliff-O'Shea <tomelliff@gmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* chore: infer managed resources health from redis instead of storing it in CRD
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
* apply reviewer notes
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
* feat: implement consistent startup messages for all components
Signed-off-by: Kent <kent.rancourt@gmail.com>
* DRY up previous commit
Signed-off-by: Kent <kent.rancourt@gmail.com>
* Generate server command reference docs
Signed-off-by: William Tam <email.wtam@gmail.com>
* Insert newline
Signed-off-by: William Tam <email.wtam@gmail.com>
* undo iinsert newline
Signed-off-by: William Tam <email.wtam@gmail.com>
Signed-off-by: William Tam <email.wtam@gmail.com>
* * Renane tab to `Server Configuration Parameters`
* Generate argocd-util command docs
Signed-off-by: William Tam <email.wtam@gmail.com>
* Tweak erver command descriptions
Signed-off-by: William Tam <email.wtam@gmail.com>
* Minor tweaks to argocd-util command descriptions
Signed-off-by: William Tam <email.wtam@gmail.com>
* Move main_test.go to secrets_redactor_test.go into commands package
Signed-off-by: William Tam <email.wtam@gmail.com>
* Disable auto generation tag.
Signed-off-by: William Tam <email.wtam@gmail.com>