-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeploy.sh
31 lines (24 loc) · 893 Bytes
/
deploy.sh
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
#!/bin/bash
# Set variables
NAMESPACE="gpu-share"
REGISTRY="dantegpu.com"
IMAGE_NAME="gpu-share-manager"
TAG="latest"
# Build Docker image
echo "Building Docker image..."
docker build -t ${REGISTRY}/${IMAGE_NAME}:${TAG} .
# Push Docker image
echo "Pushing Docker image to registry..."
docker push ${REGISTRY}/${IMAGE_NAME}:${TAG}
# Create namespace if it doesn't exist
kubectl create namespace ${NAMESPACE} --dry-run=client -o yaml | kubectl apply -f -
# Apply Kubernetes configurations
echo "Applying Kubernetes configurations..."
kubectl apply -f kubernetes/config.yaml
kubectl apply -f kubernetes/storage.yaml
kubectl apply -f kubernetes/deployment.yaml
kubectl apply -f kubernetes/service.yaml
# Wait for deployment to be ready
echo "Waiting for deployment to be ready..."
kubectl rollout status deployment/gpu-share-manager -n ${NAMESPACE}
echo "Deployment completed successfully!"