Naar hoofdinhoud
🔒 Voorbeeldmodus. De eerste vijftien Foundations-lessen zijn gratis; deze is Pro. Start een 7-daagse trial om de editor, AI-hints en de rest van het curriculum te ontgrendelen. Kaart vereist, op elk moment opzegbaar in Dashboard.Start 7-daagse trial →
← CursussenDevOps for Python servicesModule 5 · Cloud, IaC, Secrets, Cost · RecapBlauw/groen versus kanarie versus rollendpredict93 / 104
+100 XP
Opdracht
📝 **Taak:** Druk de tupel `(max_total, min_available)` af voor `replicas=10, maxSurge=25%, maxUnavailable=25%` volgens de K8s rolling-update-limieten hierboven. 📋 Implementeer bovenstaande functie. Tests worden automatisch uitgevoerd. 💡 **Hint:** Herlees de theorie als je vastloopt.
Voorspel uitvoer

Lees de code zorgvuldig

import math

replicas = 10
max_surge_pct = 25
max_unavailable_pct = 25

# maxSurge rounds UP -> ceil; maxUnavailable rounds DOWN -> floor
max_total = replicas + math.ceil(replicas * max_surge_pct / 100)
min_available = replicas - math.floor(replicas * max_unavailable_pct / 100)
print((max_total, min_available))

Wat zal het programma uitprinten? Schrijf hier:

💬 Discussie

Wees de eerste — stel een vraag of deel een tip.
Log in om mee te doen aan de discussie. Lezen is gratis.
Discussie laden…