This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Prevent updating Tyk regardless of changes in each reconciliation #571
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
…kTechnologies/tyk-operator into fix/TT-6389/recreate-nonexistent-apis
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
…timization Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
buraksekili
requested review from
komalsukhani and
andrei-tyk
and removed request for
a team
February 23, 2023 08:50
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
…TykTechnologies/tyk-operator into fix/TT-7610/reconciliation-optimization
… cases since the hashing logic is moved to controllers Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
andrei-tyk
approved these changes
Feb 28, 2023
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
…break links between ApiDefinition CRs and other resources such as SecurityPolicy CRs Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
…gh no changes happen based on hashing result Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Kudos, SonarCloud Quality Gate passed! |
buger
pushed a commit
that referenced
this pull request
May 22, 2024
* Recreate nonexistent ApiDefinitions during update calls Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Update CHANGELOG.md * Replace curl requests with k8s port-forwards Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Open connection in init function Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Update changelog Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Check hashes of ApiDefinitions before updating them Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Update test cases based on new update call Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Remove redundant log messages Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Update CHANGELOG based on new changes Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Move hashing logic to reconciler Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Add test cases for hashing helper function. Bring back to client test cases since the hashing logic is moved to controllers Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Fix linter in test cases Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Add simple test case to check Update functionality Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Add ignore hashes to k8s specific fields Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Revert client test cases to initial version Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Ignore operatorContext Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Add hashing mechanism to Policy controller as well Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Remove extra line to fix linter Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Send reload request before manipulating k8s status Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Remove predicate function to disable subresource updates - this will break links between ApiDefinition CRs and other resources such as SecurityPolicy CRs Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Revert latest commit Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Update securitypolicy controller. so that, it updates links even though no changes happen based on hashing result Signed-off-by: Burak Sekili <buraksekili@gmail.com> * Stop running tests in unsupported versions Signed-off-by: Burak Sekili <buraksekili@gmail.com> * change parameter type to pointer Signed-off-by: Burak Sekili <buraksekili@gmail.com> --------- Signed-off-by: Burak Sekili <buraksekili@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Users raised possible performance issues in the reconciliation cycle of Tyk Operator. While reconciling a large amount of resources, Operator makes redundant external API calls to Tyk Gateway / Dashboard. This PR compares hashes of an existing resource and an updated resource and prevents calling Update API of GW/Dashboard if no changes are made.
Related Issue
https://tyktech.atlassian.net/browse/TT-7610
Motivation and Context
By default, Operator triggers reconciliation in 10hrs approximately. So, if you have a large number of resources in your cluster, Operator tries to reconcile each of your resources in the cluster even though you haven't changed anything. With the current flow, Operator sends Update requests to Tyk Gateway / Dashboard regardless of changes in resources. This causes issues if your GW is running under certain resource limitations.
Test Coverage For This Change
Screenshots (if appropriate)
Types of changes
Checklist
master
!master
branch (left side). Also, it would be best if you started your change off our latestmaster
.make manifests
make helm
gofmt -s -w .
go vet ./...
golangci-lint run