-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-example.sh
More file actions
38 lines (31 loc) · 1.17 KB
/
deploy-example.sh
File metadata and controls
38 lines (31 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Example deployment script for KV Discovery Service
# Usage: ./deploy-example.sh <tenant> [namespace] [image_tag]
TENANT=${1:-"default"}
NAMESPACE=${2:-"default"}
IMAGE_TAG=${3:-"latest"}
if [ "$TENANT" = "default" ]; then
echo "Please specify a tenant for deployment"
echo "Usage: $0 <tenant> [namespace] [image_tag]"
echo "Example: $0 blessme production latest"
exit 1
fi
echo "Deploying independent KV Responder instance with tenant: $TENANT"
# Build Docker image (only if not exists)
if ! docker images | grep -q "kv-responder-oci.*$IMAGE_TAG"; then
echo "Building Docker image..."
docker build -t kv-responder-oci:$IMAGE_TAG .
fi
# Deploy with Helm - each tenant gets its own release
echo "Deploying with Helm..."
helm upgrade --install kv-responder-$TENANT ./helm \
--namespace $NAMESPACE \
--create-namespace \
--set tenant=$TENANT \
--set image.tag=$IMAGE_TAG \
--set replicaCount=3 \
--wait
echo "Deployment complete!"
echo "Service will be available at: /$TENANT/"
echo "Check status with: kubectl get pods -l ingress-group=$TENANT -n $NAMESPACE"
echo "Check HPA with: kubectl get hpa -l app.kubernetes.io/tenant=$TENANT -n $NAMESPACE"