feat: add Kubernetes manifest for Azurite deployment
This commit is contained in:
29
README.md
29
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`):
|
||||
|
||||
```
|
||||
<service_ip> <accountname>.blob.core.windows.net <accountname>.queue.core.windows.net <accountname>.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:
|
||||
|
||||
69
azurite-deployment.yaml
Normal file
69
azurite-deployment.yaml
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user