-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable etcd-druid
to make use of Azurite
- the Azure Blob Storage Emulator
#753
base: master
Are you sure you want to change the base?
Conversation
Thanks to @seshachalam-yv for his work on localstack in #713 for end-to-end testing which was the inspiration and baseline for this PR. |
/retest-required |
…ob Storage Emulator * New documentation `docs/development/getting-started-locally-azurite.md`, to document the setup process for running `etcd-druid` with `Azurite`. * New make target `deploy-azurite` to setup the `Azurite` emulator in the `kind` cluster. * New make target `ci-e2e-kind-azurite` to run the e2e tests with `Azurite`. * New script `hack/deploy-azurite.sh`, to setup the `Azurite` emulator in the `kind` cluster. * New script `ci-e2e-kind-azurite`, to run the e2e tests with `Azurite`. * New manifest `config/samples/druid_v1alpha1_etcd_azurite.yaml`, to run with `Azurite`. * New manifest `config/samples/etcd-secret-azurite.yaml`, to run with with `Azurite`. * New manifest `hack/e2e-test/infrastructure/azurite/azurite.yaml`, to setup `Azurite`. * Port `10000` forward `hack/e2e-test/infrastructure/kind/cluster.yaml`, to setup `Azurite`. * New environment variable `AZURE_STORAGE_API_ENDPOINT` to override ABS endpoint to `Azurite`. * Environment variable `AZURE_STORAGE_CONNECTION_STRING` added to `hack/e2e-test/infrastructure/overlays/azure/common/azure.env` to enable the script which creates the ABS Container in `Azurite` to access `Azurite` using the relevant Storage Account, Storage Key, and the BlobEndpoint at which `Azurite`'s Blob Storage is hosted. * Modified `hack/e2e-test/infrastructure/overlays/azure/common/files/common.sh` to create the ABS Container in `Azurite` when the relevant environment variable is present. * Modified `pkg/utils/envvar.go` to read the Azure infrastructure `Secret` for the fields `enableAzurite` and `storageAPIEndpoint`, which are passed to the `etcd-backup-restore` container as environment variables, which are used to make use of the `Azurite` emulator. * Modified `pkg/common/constants.go` to add `AZURE_ENABLE_STORAGE_EMULATOR` and `AZURE_STORAGE_API_ENDPOINT`, which are the enviroment variables passed to `etcd-backup-restore` to make use of the `Azurite` emulator. * Modified `test/e2e/utils.go` to check for the `AZURITE_HOST` environment variable which creates the Azure `Secret`, to include additional fields `enableAzurite` and `storageAPIEndpoint` to enable usage of `Azurite`.
* `make` target `ci-e2e-azurite` renamed to `ci-e2e-azure` since this target runs the end-to-end tests for Azure, using Azurite. * The environment variable which is checked for the presence of the emulator `AZURE_ENABLE_STORAGE_EMULATOR` changed to `EMULATOR_ENABLED`. * The field in the Secret for Azure which signifies that the Azurite emulator is being used is changed from `enableAzurite` to `emulatorEnabled`. All references to this are changed accordingly.
* Fixed the comment which explains `EnvEmulatorEnabled`. * Better markdown formatting and practices in `getting-started-locally-azurite.md`. * Removed an unnecessary comment in `etcd-secret-azurite.yaml`.
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.
Thank you, @renormalize, for the excellent PR ❤️.
Please address my minor comments. Apart from that, the overall PR looks good to me.
* Simplify `hack/ci-e2e-kind-azure.sh` by defining variables which can be used to avoid repetition in `hack/ci-e2e-kind-azure.sh` * Correct the License year in `hack/deploy-azurite.sh`
Output that can be viewable online at this gist The e2e tests run fine with the changes requested. |
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.
/hold until this PR gardener/etcd-backup-restore#699 merge
The dependency on If #748 is not merged before this PR, then the |
/hold util #777 is merged |
How to categorize this PR?
/area cost
/area dev-productivity
/area testing
/area usability
/kind enhancement
What this PR does / why we need it:
This PR adds support to
etcd-druid
to make use ofAzurite
the Azure Blob Storage emulator, which can be used to run end-to-end tests with Azure as the storage provider locally.As a consequence of the above, developers can now spin up a kind cluster and run
Azurite
in this cluster - which enables developers to rapidly test changes made toetcd-druid
or any of its dependencies which target Azure Blob Storage, either directly or indirectly, without the headache of managing Azure infrastructure.Finally, cost to develop for Azure will reduce.
To make use of
Azurite
to run end-to-end tests with Azure Blob Storage, simply run:To deploy
Azurite
in akind
cluster, run:Azure CLI
az
can be made use of to communicate withAzurite
running inkind
by exporting the relevant environment variableAZURE_STORAGE_CONNECTION_STRING
emulating actual Azure infrastructure in all capabilities.More information on how to develop for
etcd-druid
making use ofAzurite
can be found indocs/development/getting-started-locally-azurite.md
!Which issue(s) this PR fixes:
Fixes #740
Special notes for your reviewer:
This pull request is dependent on changes proposed in etcd-backup-restore #699.
Release note: