-
Notifications
You must be signed in to change notification settings - Fork 404
feat: refresh secret on delete when polling is disabled #413
feat: refresh secret on delete when polling is disabled #413
Conversation
c833f0f
to
b1190b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this feature makes sense to add. And would kind of align with other behaviours, like pods being recreated when deleted or so.
I'll have to dig thru the code abit more.
@@ -11,7 +11,7 @@ metadata: | |||
rules: | |||
- apiGroups: [""] | |||
resources: ["secrets"] | |||
verbs: ["create", "update"] | |||
verbs: ["create", "update"{{ with (index .Values.env "POLL_INTERNAL_SECRETS") }}, "list"{{ end}}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be if
instead of with
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, changed
b1190b6
to
f56933e
Compare
This pr is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This pr is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
I had just updated my patch with recent master code, and it seems to be working fine for my use-case, and all auto-tests do pass. If we can get this reviewed and merged into 8x series, it would be very appreciated ! |
This pr is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Right now the only way to use
kubernetes-external-secrets
with some providers in certain circumstances, is to set environment variableDISABLE_POLLING: true
, which will lead to no-op on every_poll()
.For example, using AWS SSM Parameter Store backend provider with several hundred of
ExternalSecret
instances provisioned via that provider leads to rate limit errors within AWS API.See #211 and #156 for more background on this scenario.
In the case if
DISABLE_POLLING
set to true, there is no way to refresh internalSecret
instance after it is created byExternalSecret
for the first time, other than completely removing and then re-creatingExternalSecret
.This is not convenient in the case if
ExternalSecret
instance is controlled by Helm/FluxCD, and might lead to deployment inconsistencies.This patch allows for refreshing
ExternalSecret
instance in case ifSecret
instance was removed. It is achieved by tracking names of presentSecret
instances across all namespaces, and making the poll in case if for someExternalSecret
the correspondingSecret
instance is missing.This patch is non-intrusive, and the new behavior is executed only in case if environment variable
POLL_INTERNAL_SECRETS
is set.