Module 4: WeatherNow — Agentic Readiness Investigation
Start here: Log in to OpenShift
Open the Showroom Terminal tab and authenticate using your assigned workshop credentials before running any other oc commands:
oc login --server=https://api.cluster-%GUID%.example.com:6443 --username=user-guid --password='password' --insecure-skip-tls-verify
Verify that oc whoami returns user-guid. This is a disposable lab environment: the + -p + option can expose your password in shell history and process listings. Do not reuse this password on a personal or production cluster.
Module 3 taught you to investigate the National Parks frontend and restore its readiness through Gitea. In Modules 4 and 5 we use a much smaller, independent workload: quay.io/openshift-workshop-applications/weathernow:latest.
WeatherNow is a simple HTTP web application listening on port 8080. It has no MongoDB, PVC, image build, credentials or background seed Job. Your existing National Parks applications remain untouched.
This module uses your student Gitea repository and a separate Argo CD Application named weathernow-lab in {user}-gitops. You will introduce a controlled readiness mistake, investigate it using Lightspeed, optionally launch and inspect a student-owned analysis-only AgenticRun when the platform has enabled secure sandbox isolation, then repair the source in Gitea.
Duration: 40 minutes.
| Time | Mission |
|---|---|
6 min |
1 — Deploy or verify the independent WeatherNow GitOps app |
8 min |
2 — Break the readiness probe via student Gitea |
10 min |
3 — Diagnose the stalled rollout with Lightspeed and live evidence |
10 min |
4 — Create and inspect an analysis-only AgenticRun if authorized |
6 min |
5 — Restore Git, verify the rollout and compare application health |
|
The student and security boundaries
|
Mission 1: Deploy or verify WeatherNow (6 minutes)
-
Log in with your assigned identity and select the existing GitOps namespace:
export STUDENT="$(oc whoami)" export NS="$STUDENT-gitops" test "$STUDENT" != "system:admin" || { echo "Use your student identity"; exit 1; } oc get project "$NS" oc get application national-parks-settings -n "$NS" -
Set up the WeatherNow source and Application once, using the student Gitea fast-forward helper. This operates only on the new module04-weathernow path and never overwrites an existing WeatherNow manifest:
curl -fsSLo setup-weathernow-gitops.sh \ https://raw.githubusercontent.com/rhpds/openshift-5-container/main/automation/scripts/setup-weathernow-gitops.sh bash setup-weathernow-gitops.shIf the script says the WeatherNow files are unavailable upstream, ask your instructor to merge/update the workshop source and your Gitea copy before continuing. This exercise must not edit the Module 2 National Parks Kustomization.
-
Verify the second Application and its tiny workload:
oc get application weathernow-lab -n "$NS" -o json | \ jq '{sync:.status.sync.status, health:.status.health.status, revision:.status.sync.revision}' oc get deployment,service,route weathernow -n "$NS" oc rollout status deployment/weathernow -n "$NS" --timeout=120s export WEATHER_HOST="$(oc get route weathernow -n "$NS" -o jsonpath='{.spec.host}')" curl -sS -o /dev/null -w 'WeatherNow HTTP %{http_code}\n' "https://$WEATHER_HOST/"Baseline: weathernow is 1/1 Ready, its Route returns HTTP 200, and Application/weathernow-lab is Synced/Healthy. Container limits are only 200m CPU / 128Mi memory, leaving shared tenant headroom.
Checkpoint 1: WeatherNow works independently of National Parks.
Mission 2: Commit a deliberate readiness-probe fault (8 minutes)
A new deployment revision is released with a readiness probe aimed at the wrong port. The old version may continue serving HTTP 200 because Kubernetes keeps the previous ready Pod during RollingUpdate.
-
Open Gitea → your student account → openshift-5-container → main. Open:
content/modules/ROOT/examples/module04-weathernow/weathernow.yamlFind the Deployment/weathernow container; its healthy probe is:
readinessProbe: tcpSocket: port: http -
Change only the readiness port to 18080:
readinessProbe: tcpSocket: port: 18080Do not change containerPort: 8080, the Service, liveness probe, image or limits.
-
Commit to your own Gitea main:
lab(module04): break WeatherNow readiness for agentic diagnosis -
Watch Auto-Sync without manually patching the Deployment:
oc get application weathernow-lab -n "$NS" -o json | \ jq '{sync:.status.sync.status, health:.status.health.status, revision:.status.sync.revision}' oc get deployment weathernow -n "$NS" -o json | \ jq '{probe:.spec.template.spec.containers[0].readinessProbe, replicas:.status.replicas, ready:.status.readyReplicas, updated:.status.updatedReplicas}' oc rollout status deployment/weathernow -n "$NS" --timeout=30s \ || echo "Expected: the new WeatherNow rollout is blocked"Expected: new Pod Running but 0/1 Ready; the previous healthy Pod may remain in service. Argo CD can be Synced even though a new revision has not finished rolling out.
Checkpoint 2: The live readinessProbe uses 18080, and the new revision is not ready.
Mission 3: Ask Lightspeed to investigate (10 minutes)
-
In Lightspeed → Troubleshooting, enter the following read-only request:
Investigate the stalled Deployment/weathernow rollout in namespace user-guid-gitops. The new Pod is Running but fails readiness after a student GitOps commit. The older ready Pod may still serve traffic. Inspect live Deployment, ReplicaSet, Pod and event evidence. Compare the configured readinessProbe.tcpSocket.port with the container's actual HTTP port and the Service targetPort. Explain why GitOps can be Synced while rollout is blocked. Propose the smallest Git source edit. Do NOT read Secrets or create, patch, scale, delete or execute changes. Do not inspect other student namespaces. -
Verify its findings independently:
oc get deployment weathernow -n "$NS" -o json | \ jq '.spec.template.spec.containers[0] | {ports,readinessProbe,livenessProbe}' oc get replicaset,pods -n "$NS" -l app=weathernow oc get events -n "$NS" --sort-by=.lastTimestamp | tail -20 oc get endpoints weathernow -n "$NS"If the Route still returns HTTP 200, it is probably the previous healthy Pod serving traffic. The key evidence is that the new readiness probe targets 18080 instead of http (8080).
Checkpoint 3: You can explain a blocked rolling update without claiming the whole application is down.
Mission 4: Launch and inspect a student AgenticRun (10 minutes)
AgenticRun is a namespaced Kubernetes resource. However, the operator’s analysis sandbox may inherit cluster-wide reader permissions. For this reason, your workshop has student AgenticRun creation disabled by default until the instructor verifies genuine cross-tenant isolation.
-
Check permission in your project, not openshift-lightspeed:
oc api-resources --api-group=agentic.openshift.io oc auth can-i create agenticruns.agentic.openshift.io -n "$NS" oc auth can-i get agenticruns.agentic.openshift.io -n "$NS" -
Only if both checks say yes, create a unique, analysis-only run. Otherwise skip this command and watch the authorized instructor demonstration; do not grant yourself permissions:
if [ "$(oc auth can-i create agenticruns.agentic.openshift.io -n "$NS")" = yes ]; then cat <<YAML | oc create -n "$NS" -f - apiVersion: agentic.openshift.io/v1alpha1 kind: AgenticRun metadata: generateName: weather-readiness- namespace: $NS spec: request: >- Analyze why the new weathernow Pod in namespace $NS fails its TCP readiness check. Inspect only $NS. Compare port 18080 with container port 8080, explain old ReplicaSet availability, and recommend correcting the student Gitea manifest. No changes, no Secrets and no other namespaces. analysis: agent: default YAML else echo "Student self-service not authorized: use instructor demo and Lightspeed evidence." fi -
If permitted, inspect only runs in your namespace:
if [ "$(oc auth can-i list agenticruns.agentic.openshift.io -n "$NS")" = yes ]; then oc get agenticruns.agentic.openshift.io -n "$NS" oc get analysisresults.agentic.openshift.io -n "$NS" oc agentic run list -n "$NS" fiThe result can be Proposed, Completed (no action necessary), Failed, or pending. Record the actual stage and what evidence was gathered. Do not approve an execution stage or create an AgenticRunApproval.
Checkpoint 4: An authorized run provides evidence and a proposal, or the student’s restricted privileges are recorded as the expected fallback.
Mission 5: Repair source and verify (6 minutes)
-
In student Gitea main, restore the original named readiness port:
readinessProbe: tcpSocket: port: httpCommit:
fix(module04): restore WeatherNow readiness probe -
Confirm Auto-Sync, new Pod readiness, and user response:
oc rollout status deployment/weathernow -n "$NS" --timeout=120s oc get deployment weathernow -n "$NS" oc get application weathernow-lab -n "$NS" -o json | \ jq -r '[.status.sync.status,.status.health.status] | join(" / ")' curl -sS -o /dev/null -w 'WeatherNow HTTP %{http_code}\n' "https://$WEATHER_HOST/" oc get deployments -n "$STUDENT-demo"
Checkpoint 5: The WeatherNow deployment is rolled out, Application is Synced/Healthy, browser loads HTTP 200, and National Parks is unchanged.
Troubleshooting
| Symptom | Action |
|---|---|
WeatherNow source missing from Gitea |
Run the WeatherNow setup helper once after the instructor has published the files; imported student Gitea repositories do not auto-update from upstream |
GitOps Application cannot be created |
Check module02-application-editor in {user}-gitops; do not request cluster-admin rights |
No new Pod after bad commit |
Verify live Argo revision, Git path, quota and Deployment events |
Route remains HTTP 200 |
Normal RollingUpdate may retain the previous ready Pod; inspect the new Pod |
AgenticRun API present, student create denied |
Student self-service is deliberately disabled until sandbox data isolation is verified; continue with Lightspeed/instructor |
AgenticRun failed |
Inspect analysis evidence and operator preflight; do not invent tool outputs |
Repair commit not applied |
Review Argo CD revision and failed operation; do not patch the live Deployment |