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
  • Work only in {user}-gitops and in your own Gitea main branch. Leave both National Parks stacks working in {user}-demo and {user}-gitops.

  • Do not create Namespaces, grant RBAC, read Secrets, change ApprovalPolicy, or install an Agentic Operator.

  • No AgenticRun execution or verification stage is used in this workshop. Do not approve automatic remediation; the student repairs Git.

  • AgenticRun creation is opt-in. An installed CLI and CRD are not enough. Student RBAC must be enabled by the instructor only after the operator’s analysis sandbox is verified incapable of reading other tenants. If your oc auth can-i check says no, follow the Lightspeed path and instructor demo; that is a valid outcome.

Mission 1: Deploy or verify WeatherNow (6 minutes)

  1. 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"
    S01: pre-existing student gitops namespace
  2. 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.sh

    If 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.

    S02: student Gitea WeatherNow source and new Application
  3. 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.

    S03: healthy WeatherNow GitOps Application and Route

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.

  1. Open Gitea → your student account → openshift-5-container → main. Open:

    content/modules/ROOT/examples/module04-weathernow/weathernow.yaml

    Find the Deployment/weathernow container; its healthy probe is:

    readinessProbe:
      tcpSocket:
        port: http
    S04: Gitea WeatherNow Deployment source
  2. Change only the readiness port to 18080:

    readinessProbe:
      tcpSocket:
        port: 18080

    Do not change containerPort: 8080, the Service, liveness probe, image or limits.

    S05: WeatherNow incorrect probe port in Gitea editor
  3. Commit to your own Gitea main:

    lab(module04): break WeatherNow readiness for agentic diagnosis
    S06: student Gitea fault commit
  4. 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.

    S07: GitOps sees new source but WeatherNow rollout is stalled
    S08: old and new WeatherNow Pods and readiness failure

Checkpoint 2: The live readinessProbe uses 18080, and the new revision is not ready.

Mission 3: Ask Lightspeed to investigate (10 minutes)

  1. 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.
    S09: Lightspeed WeatherNow investigation prompt
  2. 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).

    S10: live probe

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.

  1. 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"
    S11: student’s AgenticRun permissions in own namespace
  2. 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
    S12: permitted student creates an analysis-only WeatherNow AgenticRun
  3. 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"
    fi

    The 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.

    S13: student-scoped run and analysis results or documented fallback

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)

  1. In student Gitea main, restore the original named readiness port:

    readinessProbe:
      tcpSocket:
        port: http

    Commit:

    fix(module04): restore WeatherNow readiness probe
    S14: WeatherNow repaired source and Git commit
  2. 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"
    S15: WeatherNow and GitOps healthy after repair

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

Completion

You have a healthy WeatherNow app; a bad and good Gitea commit; evidence of a stalled rollout; Lightspeed findings; an analysis-only AgenticRun or documented RBAC fallback; and a ready baseline for Module 5.