-
Notifications
You must be signed in to change notification settings - Fork 33
/
deployK8sServices.cmd
36 lines (27 loc) · 1.06 KB
/
deployK8sServices.cmd
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
@echo off
REM deploys all Kubernetes services to their staging environment
set namespace=akka-cqrs
set location=%~dp0/k8s/environment
echo "Deploying K8s resources from [%location%] into namespace [%namespace%]"
echo "Creating Namespaces..."
kubectl create namespace %namespace%
echo "Using namespace [%namespace%] going forward..."
echo "Creating configurations from YAML files in [%location%/configs]"
for %%f in (%location%/configs/*.yaml) do (
echo "Deploying %%~nxf"
kubectl apply -f "%location%/configs/%%~nxf" -n "%namespace%"
)
echo "Creating environment-specific services from YAML files in [%location%]"
for %%f in (%location%/*.yaml) do (
echo "Deploying %%~nxf"
kubectl apply -f "%location%/%%~nxf" -n "%namespace%"
)
echo "Waiting 10 seconds for infrastructure to be ready..."
TIMEOUT /T 10
echo "Creating all services..."
for %%f in (%~dp0/k8s/services/*.yaml) do (
echo "Deploying %%~nxf"
kubectl apply -f "%~dp0/k8s/services/%%~nxf" -n "%namespace%"
)
echo "All services started... Printing K8s output.."
kubectl get all -n "%namespace%"