libopenstorage / stork

Stork - Storage Orchestration Runtime for Kubernetes
Apache License 2.0
392 stars 89 forks source link

PWX-39128: Support env variable SKIP_AWS_DRIVER_INIT to skip the aws driver init in stork. #1852

Closed diptiranjanpx closed 2 months ago

diptiranjanpx commented 2 months ago

Signed-Off-By: Diptiranjan

What type of PR is this? improvement

What this PR does / why we need it: In some of the clusters we are seeing stork binary takes time to load the import modules and do their inits (like aws sdk go's Session creation). Till this gets root caused, adding an environment variable "SKIP_AWS_DRIVER_INIT" if set will skip the aws driver init.

Note: This should not be used with px-backup.

Does this PR change a user-facing CRD or CLI?: no

Is a release note needed?: yes,

We can use SKIP_AWS_DRIVER_INIT="true" as environment variable to stork pod if stork init gets hung for a long time.

Does this change need to be cherry-picked to a release branch?: yes, 24.3.1, 24.3.2 and 24.3.3

Test:

➜  stork git:(PWX-39128) ✗ ks exec -it stork-557475cf87-kg7fc -- env | grep AWS
SKIP_AWS_DRIVER_INIT=true

stork logs:

➜  stork git:(PWX-39128) ✗ ks logs -f stork-557475cf87-kg7fc
time="2024-09-19T10:47:44Z" level=info msg="Skipping aws driver init"
time="2024-09-19T10:47:47Z" level=warning msg="Export USE_GKE_GCLOUD_AUTH_PLUGIN=True"
time="2024-09-19T10:47:47Z" level=info msg="Starting stork version 99.9.9-7333f41"
time="2024-09-19T10:47:47Z" level=info msg="Setting the controller cache sync-timeout as 2 mins."
time="2024-09-19T10:47:47Z" level=info msg="shared informer cache has been intialized"
time="2024-09-19T10:47:47Z" level=info msg="Using driver pxd"

Test - https://jenkins.pwx.dev.purestorage.com/job/Stork/view/Stork%2024.3.1-dev/job/new-dr-workflow/227/

Ran the above test with the env variable set.

pp511 commented 2 months ago

Need to checkand fix CBT failures.