-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathk8s-deploy.sh
More file actions
31 lines (24 loc) · 734 Bytes
/
k8s-deploy.sh
File metadata and controls
31 lines (24 loc) · 734 Bytes
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 -e
NAMESPACE="default"
MANIFEST_DIR="k8s"
echo "Applying Kubernetes manifests..."
kubectl apply -f $MANIFEST_DIR/
echo "Waiting for all pods to be Running..."
while true; do
PENDING=$(kubectl get pods --namespace $NAMESPACE --no-headers | grep -v "Running\|Completed" || true)
if [ -z "$PENDING" ]; then
echo "All pods are running."
break
else
echo "Still waiting for pods:"
echo "$PENDING"
sleep 15
fi
done
echo "Starting port-forwarding (Grafana, Kafka UI, Prometheus)..."
echo "(Please, press Ctrl+C to stop port-forward.)"
kubectl port-forward service/grafana 3000:3000 &
kubectl port-forward service/kafka-ui 8080:8080 &
kubectl port-forward service/prometheus 9090:9090 &
wait