30 lines
817 B
Bash
30 lines
817 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echo "Starting the app..."
|
|
|
|
kubectl apply -f namespace.yaml
|
|
|
|
kubectl apply -f statefulset.yaml
|
|
|
|
kubectl apply -f service.yaml
|
|
|
|
kubectl apply -f deployment.yaml
|
|
|
|
echo "Waiting for MongoDB..."
|
|
kubectl wait --for=condition=Ready pod -l app=mongodb -n expense-tracker --timeout=120s
|
|
|
|
echo "Waiting for Backend..."
|
|
kubectl wait --for=condition=Ready pod -l app=backend -n expense-tracker --timeout=120s
|
|
|
|
echo "Waiting for Frontend..."
|
|
kubectl wait --for=condition=Ready pod -l app=frontend -n expense-tracker --timeout=120s
|
|
|
|
echo "Waiting for connectivity...."
|
|
NODE_PORT=$(kubectl get service frontend-service -n expense-tracker -o jsonpath='{.spec.ports[0].nodePort}')
|
|
MINIKUBE_IP=$(minikube ip 2>/dev/null || echo "localhost")
|
|
|
|
echo "App started"
|
|
echo "Access it at: http://$MINIKUBE_IP:$NODE_PORT"
|