This commit is contained in:
Bohdan Kapliuk 2026-04-22 16:09:21 +03:00
parent 2d0d0f4e6f
commit a40f28696a
3 changed files with 20 additions and 6 deletions

View File

@ -58,17 +58,23 @@ PostgreSQL kontajner je nakonfigurovany takto:
Prikazy spustite z adresara `z2`: Prikazy spustite z adresara `z2`:
```bash ```bash
chmod +x prepare-app.sh start-app.sh stop-app.sh chmod +x prepare-app.sh start-app.sh stop-app.sh remove-app.sh
./prepare-app.sh ./prepare-app.sh
./start-app.sh ./start-app.sh
``` ```
Na zastavenie a odstranenie aplikacie pouzite: Na zastavenie aplikacie pouzite:
```bash ```bash
./stop-app.sh ./stop-app.sh
``` ```
Na uplne odstranenie aplikacie pouzite:
```bash
./remove-app.sh
```
## Ako aplikaciu pozastavit ## Ako aplikaciu pozastavit
Aplikaciu je mozne pozastavit zmenou poctu replik deploymentov a statefulsetu na nulu: Aplikaciu je mozne pozastavit zmenou poctu replik deploymentov a statefulsetu na nulu:

9
z2/remove-app.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
kubectl delete -f service.yaml --ignore-not-found
kubectl delete -f deployment.yaml --ignore-not-found
kubectl delete -f statefulset.yaml --ignore-not-found
kubectl delete -f namespace.yaml --ignore-not-found
echo "Application removed."

View File

@ -1,9 +1,8 @@
#!/bin/bash #!/bin/bash
set -e set -e
kubectl delete -f service.yaml --ignore-not-found kubectl scale deployment frontend-deployment --replicas=0 -n zkt26-z2
kubectl delete -f deployment.yaml --ignore-not-found kubectl scale deployment backend-deployment --replicas=0 -n zkt26-z2
kubectl delete -f statefulset.yaml --ignore-not-found kubectl scale statefulset postgres-statefulset --replicas=0 -n zkt26-z2
kubectl delete -f namespace.yaml --ignore-not-found
echo "Application stopped." echo "Application stopped."