This commit is contained in:
Michal Utľák 2026-04-08 22:04:55 +02:00
parent ecde59d1cf
commit d233a0baf1
9 changed files with 235 additions and 212 deletions

View File

@ -1,9 +1,11 @@
#!/bin/bash
kubectl delete -f service.yml
kubectl delete -f statefulset.yml
kubectl delete -f deployment.yml
kubectl delete secret backend-env -n todo-app
kubectl delete namespace todo-app
docker rmi z2-backend:latest
docker rmi z2-frontend:latest
kubectl delete deployment backend frontend -n todo-app --ignore-not-found=true
kubectl delete service backend frontend db -n todo-app --ignore-not-found=true
kubectl delete statefulset db -n todo-app --ignore-not-found=true
kubectl delete configmap mysql-init-script -n todo-app --ignore-not-found=true
kubectl delete pvc mysql-pvc -n todo-app --ignore-not-found=true
kubectl delete pv mysql-pv --ignore-not-found=true
kubectl delete secret backend-env -n todo-app --ignore-not-found=true
kubectl delete namespace todo-app --ignore-not-found=true
docker rmi z2-backend:latest z2-frontend:latest

View File

@ -1,5 +1,6 @@
#!/bin/bash
kubectl apply -f deployment.yml
kubectl apply -f service.yml
kubectl apply -f statefulset.yml
kubectl wait --for=condition=ready pod/db-0 -n todo-app --timeout=180s
kubectl apply -f deployment.yml

View File

@ -82,6 +82,26 @@ spec:
- name: mysql-init-volume
mountPath: /docker-entrypoint-initdb.d/init.sql
subPath: init.sql
startupProbe:
exec:
command:
- sh
- -c
- mysqladmin ping -h 127.0.0.1 -uroot -pNajsilnejsieHeslo123. --silent
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 30
readinessProbe:
exec:
command:
- sh
- -c
- mysqladmin ping -h 127.0.0.1 -uroot -pNajsilnejsieHeslo123. --silent
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 10
volumes:
- name: mysql-storage
persistentVolumeClaim:

View File

@ -1,5 +1,5 @@
#!/bin/bash
kubectl delete -f service.yml
kubectl delete -f statefulset.yml
kubectl delete -f deployment.yml
kubectl delete deployment backend frontend -n todo-app --ignore-not-found=true
kubectl delete service backend frontend -n todo-app --ignore-not-found=true
kubectl delete statefulset db -n todo-app --ignore-not-found=true