|
| 1 | +# Lab 7 Submission |
| 2 | + |
| 3 | +## Task 1 — Git State Reconciliation |
| 4 | + |
| 5 | + |
| 6 | +### 1. Filling desired-state.txt and current-state.txt |
| 7 | +```bash |
| 8 | +echo 'version: 1.0' > labs/desired-state.txt |
| 9 | +echo 'app: myapp' >> labs/desired-state.txt |
| 10 | +echo 'replicas: 3' >> labs/desired-state.txt |
| 11 | +cp labs/desired-state.txt labs/current-state.txt |
| 12 | +``` |
| 13 | + |
| 14 | +### 2. Example of drift and reconcile |
| 15 | +```bash |
| 16 | +echo 'version: 2.0' > labs/current-state.txt |
| 17 | +echo 'app: myapp' >> labs/current-state.txt |
| 18 | +echo 'replicas: 5' >> labs/current-state.txt |
| 19 | +cd labs; bash reconcile.sh; cat current-state.txt |
| 20 | +# Output: |
| 21 | +version: 1.0 |
| 22 | +app: myapp |
| 23 | +replicas: 3 |
| 24 | +``` |
| 25 | + |
| 26 | +### 3. Reconcile-loop |
| 27 | +```bash |
| 28 | +cd labs; bash monitor.sh |
| 29 | +# (stop manually with Ctrl+C) |
| 30 | +``` |
| 31 | + |
| 32 | +## Task 2 — GitOps Health Monitoring |
| 33 | + |
| 34 | +### 1. Healthcheck verification |
| 35 | +```bash |
| 36 | +cd labs; bash healthcheck.sh; cat health.log |
| 37 | +# Output: |
| 38 | +[Sat Oct 18 00:46:28 MSK 2025] HEALTHY: States match |
| 39 | +``` |
| 40 | + |
| 41 | +### 2. Introducing drift and re-check |
| 42 | +```bash |
| 43 | +cd labs; echo 'unapproved-change: true' >> current-state.txt; bash healthcheck.sh; cat health.log |
| 44 | +# Output: |
| 45 | +[Sat Oct 18 00:46:33 MSK 2025] DRIFT: States differ |
| 46 | +``` |
| 47 | + |
| 48 | +### 3. State recovery |
| 49 | +```bash |
| 50 | +cd labs; bash reconcile.sh; bash healthcheck.sh; cat health.log |
| 51 | +# Output: |
| 52 | +[Sat Oct 18 00:46:35 MSK 2025] HEALTHY: States match |
| 53 | +``` |
| 54 | + |
| 55 | +### 4. Example of monitor.sh in action |
| 56 | +```bash |
| 57 | +cd labs; bash monitor.sh |
| 58 | +# (stop manually with Ctrl+C) |
| 59 | +cat health.log |
| 60 | +# Output: |
| 61 | +[Sat Oct 18 00:46:43 MSK 2025] HEALTHY: States match |
| 62 | +[Sat Oct 18 00:46:48 MSK 2025] HEALTHY: States match |
| 63 | +``` |
| 64 | + |
| 65 | +## Conclusion: |
| 66 | +Thank you for the lab! That was interesting! |
0 commit comments