From ea7905d7c733eafbe5c65010526c36f3eb3b6a39 Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Mon, 2 Mar 2026 07:34:00 +0100 Subject: [PATCH] feat: add Kubernetes manifest for Azurite deployment --- README.md | 29 +++++++++++++++++ azurite-deployment.yaml | 69 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 azurite-deployment.yaml diff --git a/README.md b/README.md index cb9cb2d..551f4df 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,35 @@ To run the Azure Storage Emulator in a container, follow these steps: You can also use the included example `compose.yaml` file for running it using `docker compose` (or any other compose compatible CLI). +### Using Kubernetes + +Use the example manifest `azurite-deployment.yaml`. + +1. Create the required Secret from your local env file: + + ```bash + kubectl create secret generic azurite-accounts \ + --from-env-file="$HOME/.azurite/accounts.env" + ``` + +2. Deploy the manifest: + + ```bash + kubectl apply -f azurite-deployment.yaml + ``` + +3. Get the Kubernetes Service external IP: + + ```bash + kubectl get svc azurite -o jsonpath='{.status.loadBalancer.ingress[0].ip}' + ``` + +4. Add `/etc/hosts` entries on your workstation and point all Azurite account FQDNs to that Service IP (not `127.0.0.1`): + + ``` + .blob.core.windows.net .queue.core.windows.net .table.core.windows.net + ``` + ### Using Node.js To install the Azure Storage Emulator natively on your machine, ensure you have Node.js (with npm) and Caddy HTTP Server installed, and follow these steps: diff --git a/azurite-deployment.yaml b/azurite-deployment.yaml new file mode 100644 index 0000000..71a2d69 --- /dev/null +++ b/azurite-deployment.yaml @@ -0,0 +1,69 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: azurite-storage + labels: + app.kubernetes.io/name: azurite + app.kubernetes.io/component: storage-emulator +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Mi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: azurite + labels: + app.kubernetes.io/name: azurite + app.kubernetes.io/component: storage-emulator +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: azurite + template: + metadata: + labels: + app.kubernetes.io/name: azurite + app.kubernetes.io/component: storage-emulator + spec: + containers: + - name: azurite + image: azurite:latest + imagePullPolicy: IfNotPresent + args: + - --oauth + ports: + - name: https + containerPort: 443 + protocol: TCP + envFrom: + - secretRef: + name: azurite-accounts + volumeMounts: + - name: storage + mountPath: /storage + volumes: + - name: storage + persistentVolumeClaim: + claimName: azurite-storage +--- +apiVersion: v1 +kind: Service +metadata: + name: azurite + labels: + app.kubernetes.io/name: azurite + app.kubernetes.io/component: storage-emulator +spec: + type: LoadBalancer + selector: + app.kubernetes.io/name: azurite + ports: + - name: https + port: 443 + targetPort: 443 + protocol: TCP