KAHIBARO Bookshelves
Discord Login Register

20.4. Monitoring and troubleshooting report

Learning goals for this exercise

By the end of this project component, you should be able to:

  • Design a focused monitoring and troubleshooting scenario around an application you deployed earlier in the course.
  • Use OpenShift’s monitoring and logging tools to collect relevant evidence.
  • Perform a structured troubleshooting workflow on a real issue (or a simulated one).
  • Document your findings in a clear, reproducible report suitable for sharing with a team.

This is not just “fix the problem”; it is “show how you detected it, investigated it, and confirmed the fix”, using OpenShift-native tools.

Requirements for the report

Your monitoring and troubleshooting report should cover:

  1. Context
    • Brief description of the application and how it is deployed:
      • Type of app (e.g., web API, frontend, batch worker).
      • Main OpenShift objects involved (e.g., Deployment, Route, Service, ConfigMap, Secret, PersistentVolumeClaim).
    • Environment details:
      • Project/namespace name.
      • Any relevant scaling or resource settings (e.g., requests/limits, HPA).
  2. Scenario definition
    • One or more concrete issues you will investigate. Examples:
      • Application is slow or intermittently unavailable.
      • Pods are restarting frequently (CrashLoopBackOff).
      • CPU or memory is saturating under load.
      • Errors in logs related to configuration, database, or external services.
    • Clearly state:
      • Symptoms (what the user or operator observes).
      • Suspected area (application, configuration, resource limits, networking, storage, etc.).
  3. Monitoring and observability setup
    • Which monitoring/observability tools you used and how:
      • Built-in OpenShift web console views (metrics, pod details, events).
      • CLI with oc for status and logs.
      • Any additional dashboards or queries (e.g., custom graphs, alerts).
    • Any minimal configuration you added to improve observability for this exercise, for example:
      • Enabling or adjusting application logging verbosity.
      • Adding simple application-level health endpoints and checking them via Route or Service.
    • You do not need to build an entire monitoring stack from scratch; rely on what the cluster provides and what you configured in earlier project steps.
  4. Data collection steps

Describe exactly how you collected evidence for your investigation, including representative commands and console views.

At minimum, include:

  • Resource and status inspection
    • How you checked pod and deployment status:
       oc get pods -n <project>
       oc describe pod <pod-name> -n <project>
       oc get deployment -n <project>
  • Node or cluster status if relevant:
       oc get nodes
       oc get events -n <project>
  • Logs
    • Commands or console actions to inspect logs:
       oc logs <pod-name> -c <container-name> -n <project>
       oc logs <pod-name> --previous -n <project>
  • If multiple replicas exist, how you ensured you saw logs from the relevant pod(s).
  • Metrics and performance
    • Which metrics you looked at, such as:
      • CPU and memory usage for pods or containers.
      • Request rate or error rate if visible.
      • Restart counts over time.
    • Whether you inspected metrics:
      • Via the web console’s Monitoring or Workloads views.
      • Or via CLI if applicable (e.g., oc adm top pods).

For each step, capture:

  • The command or console path.
  • A summary of what you observed (you may include short excerpts; no need to paste huge logs).
  1. Troubleshooting workflow

Structure this as a sequence of hypotheses and tests:

  1. Initial observation
    • What first indicated that there was a problem?
    • Example: health checks failing, requests returning 500 status, pods in CrashLoopBackOff.
  2. First hypothesis and test
    • Hypothesis example: “The pod is OOMKilled due to low memory limit.”
    • Evidence you collected:
      • Pod describe showing OOMKilled in last state.
      • Metrics showing memory usage hitting the limit.
    • Conclusion: confirm or reject the hypothesis.
  3. Next hypotheses and tests
    • Continue until you converge on a likely root cause; examples:
      • Misconfigured environment variable (e.g., wrong database URL).
      • Missing permission (e.g., failure to access a persistent volume or external service).
      • Insufficient resource requests/limits causing throttling.
      • Application-level bug that surfaces under certain inputs.
  4. Decision points
    • Note moments where you changed direction because evidence did not match your expectations.
    • Example: “We suspected CPU saturation, but CPU metrics were low, so we shifted focus to network errors visible in logs.”

Keep focus on how you used OpenShift information (objects, events, logs, metrics) to drive your decisions.

  1. Resolution and validation

Describe the fix you applied, focusing on how it is expressed in OpenShift resources.

Common resolution actions for this project may include:

  • Configuration changes
    • Updating a ConfigMap or Secret.
    • Changing environment variables in a Deployment manifest.
    • Rolling out a new image with a bug fix.
  • Resource tuning
    • Modifying resources.requests and resources.limits for CPU/memory.
    • Adjusting replica counts if under- or over-provisioned.
  • Networking or routing adjustments
    • Updating Route settings (e.g., TLS termination, path, target port).
    • Fixing Service labels or selectors so pods are correctly matched.

For each change:

  • Show the command or steps:
     oc set env deployment/<name> VAR=value -n <project>
     oc apply -f deployment.yaml
     oc rollout status deployment/<name> -n <project>
  • Explain how you validated the fix:
    • Which metrics improved (e.g., reduced 5xx errors, lower restart counts).
    • Which logs you checked and what changed.
    • Which user-facing symptoms disappeared (e.g., application reachable again, latency reduced).
  1. Summary and lessons learned

Conclude with:

  • Root cause statement
    A concise sentence: “The incident was caused by …”
  • Key evidence
    List the top 3–5 data points that were most decisive:
    • A particular log line.
    • A metric spike.
    • A pod event or condition.
  • What worked well in your troubleshooting approach
    • Steps that quickly narrowed down the issue.
    • Tools or views that were especially useful.
  • What you would improve in the future
    • Monitoring gaps you discovered (e.g., missing alerts, insufficient logs).
    • Additional metrics or health checks you would implement for production readiness.
    • Any automation ideas (e.g., alert rules, runbooks).

Suggested structure and template

You can organize your report using the following template. Replace placeholders with your own content.

  1. Application and environment overview
    • Application name and purpose:
    • Namespace/project:
    • Key OpenShift resources involved:
  2. Problem statement
    • Observed symptoms:
    • Impact (who/what was affected, severity):
    • Time window of the incident (if applicable):
  3. Monitoring and data collection
    • Tools and views used (console pages, oc commands):
    • Snapshot of relevant status (oc get / oc describe):
    • Key metrics examined:
    • Key log snippets and events:
  4. Analysis and troubleshooting steps
    • Hypothesis 1, test method, outcome:
    • Hypothesis 2, test method, outcome:
    • Additional hypotheses as needed:
    • How you narrowed down to the root cause:
  5. Resolution
    • Changes made to OpenShift resources (configs, images, routes, resource limits, etc.):
    • Commands or manifests used:
    • Rollout/verification steps:
  6. Validation
    • Metrics before vs after fix (at a high level):
    • Log patterns before vs after:
    • Final system state (pods status, application behavior):
  7. Retrospective
    • Root cause summary:
    • Monitoring/observability improvements you would implement:
    • Troubleshooting techniques you found most valuable in OpenShift:

Evaluation criteria

When this part of the final project is assessed, the focus is on process and documentation, not just “having a working app”. Your report should demonstrate:

  • Use of OpenShift-native information
    • You relied on logs, events, metrics, and object status from OpenShift, not only on local tools.
  • Clear troubleshooting reasoning
    • Your hypotheses follow logically from observed data.
    • You updated your approach when evidence contradicted your assumptions.
  • Reproducibility
    • Commands, console paths, and steps are specific enough that someone else could follow them.
  • Clarity and conciseness
    • You avoid unnecessary detail while preserving key evidence and conclusions.
  • Reflection
    • You identify improvements to monitoring and troubleshooting practices for future deployments.

Use this exercise to practice operating your OpenShift-deployed application like a real service: monitor it, investigate issues systematically, and communicate your findings in a way that others can understand and build upon.

Views: 0

Comments

Please login to add a comment.

Don't have an account? Register now!

Where to Move

Move chapter:

  • ☰ 1. Course Overview
    • ☰ 1.1. What is OpenShift
      • ☰ 1.2. Why OpenShift is used in modern IT and cloud environments
        • ☰ 1.3. OpenShift vs Kubernetes
          • ☰ 1.4. Typical OpenShift use cases
            • ☰ 1.5. Structure and goals of the course
            • ☰ 2. Containers and Cloud-Native Fundamentals
              • ☰ 2.1. What is a container
                • ☰ 2.2. Containers vs virtual machines
                  • ☰ 2.3. Introduction to Docker and container images
                    • ☰ 2.4. Container registries
                      • ☰ 2.5. Basics of cloud-native applications
                      • ☰ 3. Kubernetes Fundamentals
                        • ☰ 3.1. What is Kubernetes
                          • ☰ 3.2. Kubernetes architecture
                            • ☰ 3.3. Control plane components
                              • ☰ 3.4. Worker node components
                                • ☰ 3.5. Kubernetes objects and resources
                                  • ☰ 3.6. Declarative configuration model
                                  • ☰ 4. OpenShift Architecture
                                    • ☰ 4.1. Overview of OpenShift architecture
                                      • ☰ 4.2. Control plane in OpenShift
                                        • ☰ 4.3. Nodes and machine roles
                                          • ☰ 4.4. OpenShift Operators
                                            • ☰ 4.5. OpenShift networking model
                                              • ☰ 4.6. OpenShift storage model
                                              • ☰ 5. OpenShift Installation and Deployment Models
                                                • ☰ 5.1. OpenShift deployment options
                                                  • ☰ 5.2. Installer-Provisioned Infrastructure
                                                    • ☰ 5.3. User-Provisioned Infrastructure
                                                      • ☰ 5.4. Managed OpenShift services
                                                        • ☰ 5.5. Single-node OpenShift
                                                          • ☰ 5.6. Cluster lifecycle management
                                                          • ☰ 6. Accessing and Using OpenShift
                                                            • ☰ 6.1. OpenShift web console
                                                              • ☰ 6.2. OpenShift CLI (oc)
                                                                • ☰ 6.3. Authentication and authorization
                                                                  • ☰ 6.4. Projects and namespaces
                                                                    • ☰ 6.5. Resource quotas and limits
                                                                    • ☰ 7. Building and Deploying Applications
                                                                      • ☰ 7.1. Application deployment concepts
                                                                        • ☰ 7.2. Source-to-Image (S2I)
                                                                          • ☰ 7.3. Container-based deployments
                                                                            • ☰ 7.4. DeploymentConfigs and Deployments
                                                                              • ☰ 7.5. Rolling updates and rollbacks
                                                                              • ☰ 8. Networking in OpenShift
                                                                                • ☰ 8.1. Services and service discovery
                                                                                  • ☰ 8.2. Routes and ingress
                                                                                    • ☰ 8.3. Network policies
                                                                                      • ☰ 8.4. Load balancing
                                                                                        • ☰ 8.5. External access to applications
                                                                                        • ☰ 9. Storage in OpenShift
                                                                                          • ☰ 9.1. Persistent storage concepts
                                                                                            • ☰ 9.2. Persistent Volumes
                                                                                              • ☰ 9.3. Persistent Volume Claims
                                                                                                • ☰ 9.4. StorageClasses
                                                                                                  • ☰ 9.5. Dynamic provisioning
                                                                                                    • ☰ 9.6. Stateful applications
                                                                                                    • ☰ 10. Configuration and Secrets Management
                                                                                                      • ☰ 10.1. ConfigMaps
                                                                                                        • ☰ 10.2. Secrets
                                                                                                          • ☰ 10.3. Environment variables
                                                                                                            • ☰ 10.4. Managing sensitive data
                                                                                                              • ☰ 10.5. Best practices for configuration
                                                                                                              • ☰ 11. Scaling and High Availability
                                                                                                                • ☰ 11.1. Horizontal pod autoscaling
                                                                                                                  • ☰ 11.2. Vertical scaling
                                                                                                                    • ☰ 11.3. Self-healing and pod restarts
                                                                                                                      • ☰ 11.4. High availability concepts
                                                                                                                        • ☰ 11.5. Multi-zone and multi-region clusters
                                                                                                                        • ☰ 12. Monitoring, Logging, and Observability
                                                                                                                          • ☰ 12.1. Built-in monitoring stack
                                                                                                                            • ☰ 12.2. Metrics and alerts
                                                                                                                              • ☰ 12.3. Logging architecture
                                                                                                                                • ☰ 12.4. Distributed tracing
                                                                                                                                  • ☰ 12.5. Troubleshooting applications
                                                                                                                                  • ☰ 13. Security in OpenShift
                                                                                                                                    • ☰ 13.1. Security model overview
                                                                                                                                      • ☰ 13.2. Role-Based Access Control
                                                                                                                                        • ☰ 13.3. Security Context Constraints
                                                                                                                                          • ☰ 13.4. Image security and scanning
                                                                                                                                            • ☰ 13.5. Network security
                                                                                                                                              • ☰ 13.6. Compliance and auditing
                                                                                                                                              • ☰ 14. CI/CD and DevOps with OpenShift
                                                                                                                                                • ☰ 14.1. DevOps concepts
                                                                                                                                                  • ☰ 14.2. CI/CD pipelines overview
                                                                                                                                                    • ☰ 14.3. OpenShift Pipelines (Tekton)
                                                                                                                                                      • ☰ 14.4. GitOps with Argo CD
                                                                                                                                                        • ☰ 14.5. Integrating OpenShift with external CI tools
                                                                                                                                                        • ☰ 15. Operators and Platform Services
                                                                                                                                                          • ☰ 15.1. What are Operators
                                                                                                                                                            • ☰ 15.2. Operator Lifecycle Manager
                                                                                                                                                              • ☰ 15.3. Installing and managing Operators
                                                                                                                                                                • ☰ 15.4. Common platform Operators
                                                                                                                                                                  • ☰ 15.5. Custom Operators
                                                                                                                                                                  • ☰ 16. Upgrades, Maintenance, and Operations
                                                                                                                                                                    • ☰ 16.1. OpenShift upgrade process
                                                                                                                                                                      • ☰ 16.2. Backup and restore
                                                                                                                                                                        • ☰ 16.3. Node maintenance
                                                                                                                                                                          • ☰ 16.4. Cluster troubleshooting
                                                                                                                                                                            • ☰ 16.5. Capacity planning
                                                                                                                                                                            • ☰ 17. OpenShift on HPC and Specialized Workloads
                                                                                                                                                                              • ☰ 17.1. Running batch workloads on OpenShift
                                                                                                                                                                                • ☰ 17.2. OpenShift and GPUs
                                                                                                                                                                                  • ☰ 17.3. MPI and parallel workloads in containers
                                                                                                                                                                                    • ☰ 17.4. Hybrid HPC and cloud workflows
                                                                                                                                                                                    • ☰ 18. OpenShift in Practice
                                                                                                                                                                                      • ☰ 18.1. Typical OpenShift workflows
                                                                                                                                                                                        • ☰ 18.2. Development to production lifecycle
                                                                                                                                                                                          • ☰ 18.3. Case studies from industry
                                                                                                                                                                                            • ☰ 18.4. Common pitfalls and best practices
                                                                                                                                                                                            • ☰ 19. Future Directions and Ecosystem
                                                                                                                                                                                              • ☰ 19.1. Kubernetes ecosystem overview
                                                                                                                                                                                                • ☰ 19.2. OpenShift roadmap
                                                                                                                                                                                                  • ☰ 19.3. Serverless and event-driven workloads
                                                                                                                                                                                                    • ☰ 19.4. AI and data platforms on OpenShift
                                                                                                                                                                                                    • ☰ 20. Final Project and Hands-On Exercises
                                                                                                                                                                                                      • ☰ 20.1. Deploying a containerized application
                                                                                                                                                                                                        • ☰ 20.2. Implementing CI/CD with OpenShift
                                                                                                                                                                                                          • ☰ 20.3. Securing and scaling an application
                                                                                                                                                                                                            • ☰ 20.4. Monitoring and troubleshooting report