Skip to content

Manage Azure Blob Storage Emulator

This document is a step-by-step guide on how to configure, deploy and cleanup Azurite, the Azure Blob Storage emulator, within a kind cluster. This setup is ideal for local development and testing.

00-Prerequisites

Ensure that you have setup the development environment as per the documentation.

Note: It is assumed that you have already created kind cluster and the KUBECONFIG is pointing to this Kubernetes cluster.

Installing Azure CLI

To interact with Azurite you must also install the Azure CLI (version >=2.55.0) On macOS run:

Bash
brew install azure-cli

For other OS, please check the Azure CLI installation documentation.

01-Deploy Azurite

Bash
make deploy-azurite

The above make target will deploy Azure emulator in the target Kubernetes cluster.

02-Setup ABS Container

We will be using the azure-cli to create an ABS container. Export the connection string to enable azure-cli to connect to Azurite emulator.

Bash
export AZURE_STORAGE_CONNECTION_STRING="DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;"

To create an Azure Blob Storage Container in Azurite, run the following command:

Bash
az storage container create -n <container-name>

03-Configure Secret

Connection details for an Azure Object Store Container are put into a Kubernetes Secret. Apply the Kubernetes Secret manifest through:

Bash
kubectl apply -f config/samples/etcd-secret-azurite.yaml

Note: The secret created should be referred to in the Etcd CR in spec.backup.store.secretRef.

04-Cleanup

In addition to the kind cluster cleanup you should also unset the environment variable set in step-03 above.

Bash
unset AZURE_STORAGE_CONNECTION_STRING