Skip to content

option to predeploy any resource #906

@bcha

Description

@bcha

Feature request

  • If the maintainers agree with the feature as described here, I intend to submit a Pull Request myself.1

Proposal: Could it be possible to predeploy any resouce, controlled by some annotation? Like krane.shopify.io/predeployed, which currently only supports CRDs.

My personal use-case is deploying kind: ExternalSecret resources from https://github.com/external-secrets/external-secrets. Essentially it's an operator, which syncs secrets from external places like secret management solutions offered by AWS, Azure, GCP, whatever & creates corresponding kind: Secret resources.

The problem is that the kind: ExternalSecret doesn't always have enough time for initial sync as they're deployed at the same time as kind: Deployment for example, which can cause krane to result in failure like so:

[INFO][2022-10-04 06:47:53 +0000]	----------------------------------Phase 4: Deploying all resources----------------------------------
[INFO][2022-10-04 06:47:53 +0000]	Deploying resources:
[INFO][2022-10-04 06:47:53 +0000]	- Deployment/account-deployment (timeout: 420s)
[INFO][2022-10-04 06:47:53 +0000]	- ExternalSecret/foo (timeout: 300s)
...blablabla
[WARN][2022-10-04 06:48:23 +0000]	Don't know how to monitor resources of type ExternalSecret. Assuming ExternalSecret/foo deployed successfully.
...blablabla
[INFO][2022-10-04 06:48:29 +0000]	------------------------------------------Result: FAILURE-------------------------------------------
[FATAL][2022-10-04 06:48:29 +0000]	Successfully deployed 13 resources and failed to deploy 1 resource
[FATAL][2022-10-04 06:48:29 +0000]	
[FATAL][2022-10-04 06:48:29 +0000]	Successful resources
[FATAL][2022-10-04 06:48:29 +0000]	Deployment/account-scheduler-deployment           0 replicas
[FATAL][2022-10-04 06:48:29 +0000]	ExternalSecret/foo                       Not Found
... blablabla
[FATAL][2022-10-04 06:48:29 +0000]	Deployment/account-deployment: FAILED
[FATAL][2022-10-04 06:48:29 +0000]	Latest ReplicaSet: account-deployment-67f9b49988
[FATAL][2022-10-04 06:48:29 +0000]	
[FATAL][2022-10-04 06:48:29 +0000]	The following containers are in a state that is unlikely to be recoverable:
[FATAL][2022-10-04 06:48:29 +0000]	> account: Failed to generate container configuration: secret "foo" not found
[FATAL][2022-10-04 06:48:29 +0000]	
[FATAL][2022-10-04 06:48:29 +0000]	  - Final status: 1 replica, 1 updatedReplica, 1 unavailableReplica
[FATAL][2022-10-04 06:48:29 +0000]	  - Events (common success events excluded):
[FATAL][2022-10-04 06:48:29 +0000]	      [Deployment/account-deployment]	ScalingReplicaSet: Scaled up replica set account-deployment-67f9b49988 to 1 (1 events)
[FATAL][2022-10-04 06:48:29 +0000]	      [Pod/account-deployment-67f9b49988-4hzc5]	Failed: Error: secret "foo" not found (2 events)

Of course as the secret is synced often just seconds after the deployment will recover automatically, but as we're running krane in CICD it'll still report the deployment as failed.

https://github.com/Shopify/krane#deploying-custom-resources would be another option, but unfortunately external-secrets-operator doesn't currently implement observedGeneration & thus I can't use this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions