apiext: restrict which crds are watched and patched. #5540
Merged
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
The apiext server watches for CRD's and will ensure they are patched properly (unless disabled). Previously,
we were restricting our resources by the default provided label selectors of
app.kubernetes.io/part-of: emissary-apiext
when setting up our watch of the CRD resources in a cluster. Unfortunately, K8s doesn't support sets in the field selectors so we couldn't watch for specifically named CRD's per this:https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/#supported-operators
So, removing this restriction had a few downside affects:
the apiext server to never become ready.
from about 20mb to 80mb.
getambassador.io
groupwhich means other resources not related to the APIGateway are then patched when they should not be.
The fix does the following:
--crd-label-selectors="app.kubernetes.io/part-of=emissary-apiext"
what is cached.
These three changes will ensure:
Related Issues
n/a
Testing
Manually tested in a cluster and added two new e2e tests for running apiext in a different namespace and modifying CRD labels.
Checklist
CHANGELOG.md
.DEVELOPING.md
with any any special dev tricks I had to use to work on this code efficiently.