Introduction
As part of my platform engineering learning journey, I recently completed my second capstone project: building a cloud-native microservices observability platform.
This project was an opportunity to bring together several technologies and engineering practices that are essential in modern cloud-native environments.
Rather than focusing only on deploying an application, I wanted to build a platform that could support the application throughout its lifecycle: from containerization and orchestration to monitoring, centralized logging, distributed tracing, alerting, automation, security scanning, and operational troubleshooting.
The central question behind the project was:
How can we deploy a microservices application on Kubernetes and build the observability and operational capabilities needed to understand, monitor, troubleshoot, and maintain it?
To answer that question, I designed and implemented a three-service application and integrated it with a complete observability stack.
The project brought together:
- Docker and Docker Compose
- Kubernetes and Minikube
- Helm
- GitHub
- Jenkins
- Argo CD
- Prometheus
- Grafana
- Grafana Loki
- Grafana Alloy
- Grafana Tempo
- OpenTelemetry
- Alertmanager
- Ansible
- Trivy
- Python and FastAPI
This article documents the project from the initial design through implementation, integration, testing, and validation.
It also explains some of the challenges I encountered, the decisions I made, and what I learned along the way.
1. Understanding the Project Objectives
The first step was to establish what the platform needed to achieve.
A microservices application can be running successfully while still having operational problems that are difficult to identify.
For example:
- A service may respond slowly.
- An API may return HTTP errors.
- A Kubernetes node may become unavailable.
- Application logs may be scattered across different containers.
- A request may fail somewhere between multiple services.
- A container image may contain vulnerable operating-system packages.
- An engineer may not receive an alert when something goes wrong.
These are operational problems that cannot be addressed through application deployment alone.
I therefore divided the project into several objectives.
Application objectives
- Build a microservices application.
- Containerize each service.
- Expose health-check endpoints.
- Enable communication between services.
Kubernetes objectives
- Deploy the services to Kubernetes.
- Configure Kubernetes Services and Deployments.
- Apply resource requests and limits.
- Implement container security controls.
- Configure readiness and liveness probes.
Observability objectives
- Collect application and infrastructure metrics.
- Build Grafana dashboards.
- Centralize application logs.
- Implement distributed tracing.
- Configure operational alerts.
- Test notification delivery.
Automation and security objectives
- Create a Jenkins CI pipeline.
- Validate application images with Ansible.
- Scan container images with Trivy.
- Integrate GitOps deployment management.
- Maintain operational runbooks.
The goal was to bring these capabilities together into one working platform.
[SCREENSHOT 1: Insert a screenshot of your project directory or overall project architecture here.]
2. Designing the Application Architecture
Before implementing the platform, I designed the application around three independent microservices.
The services were:
- API Gateway
- Order Service
- Payment Service
Each service was developed using Python and FastAPI.
2.1 API Gateway
The API Gateway acts as the entry point for incoming application requests.
Instead of allowing an external client to communicate directly with every internal service, requests enter through the API Gateway.
Its responsibilities include:
- Receiving HTTP requests.
- Exposing the application API.
- Coordinating order requests.
- Communicating with the Order Service.
- Returning responses to the client.
- Exposing health and metrics endpoints.
The API Gateway listens on port 8000.
2.2 Order Service
The Order Service handles order creation.
When a client submits an order through the API Gateway, the request is forwarded to the Order Service.
It handles the order-processing operation and communicates with the Payment Service.
The Order Service listens on port 8001.
2.3 Payment Service
The Payment Service handles the payment-processing portion of the workflow.
For this project, payment approval was simulated rather than integrated with a real payment provider.
This allowed me to demonstrate service-to-service communication and end-to-end request tracing without introducing an external payment dependency.
The Payment Service listens on port 8002.
2.4 Understanding the request flow
The application workflow is:
Client | v API Gateway | v Order Service | v Payment Service | v Response returned to Client A client submits an order request to the API Gateway.
The API Gateway communicates with the Order Service, which processes the order and calls the Payment Service.
The Payment Service returns a simulated payment result, and the response travels back through the services.
This simple workflow provides a useful foundation for demonstrating distributed application behaviour.
[SCREENSHOT 2: Insert your application architecture diagram showing API Gateway, Order Service, and Payment Service.]
3. Developing the Microservices with FastAPI
I used FastAPI to implement the three application services.
FastAPI provides a lightweight framework for building HTTP APIs in Python.
Each service has its own application code, dependencies, Dockerfile, and container image.
The services also expose health-check endpoints.
For example:
GET /health A successful response indicates that the service is available.
The health endpoints are useful for:
- Docker health checks.
- Kubernetes readiness probes.
- Kubernetes liveness probes.
- CI smoke tests.
- Operational troubleshooting.
I also introduced application metrics and structured logging so that the services could produce telemetry for the observability platform.
3.1 Application metrics
The services expose Prometheus-compatible metrics.
Some of the application metrics include:
http_requests_total http_request_duration_seconds orders_created_total orders_failed_total payments_approved_total payments_declined_total These metrics provide information about application activity.
For example:
-
http_requests_totaltracks HTTP requests. -
http_request_duration_secondsrecords request duration. -
orders_created_totaltracks successful order creation. -
orders_failed_totaltracks failed orders. -
payments_approved_totaltracks approved simulated payments. -
payments_declined_totaltracks declined simulated payments.
The metrics are exposed through the /metrics endpoint.
This makes it possible for Prometheus to scrape the application services.
3.2 Structured application logging
I implemented structured JSON logging.
Instead of producing only unstructured text messages, the application logs include fields such as:
{ "timestamp": "2026-12-02T20:28:37.750873+00:00", "level": "INFO", "service": "api-gateway", "message": "HTTP request completed", "method": "GET", "route": "/health", "status_code": 200, "duration_seconds": 0.000741 } Structured logs are useful because individual fields can be extracted and queried.
For example, an engineer can filter logs by:
- Service name
- Log level
- Timestamp
- HTTP route
- Status code
- Message
This becomes especially valuable when several microservices are running inside Kubernetes.
[SCREENSHOT 3: Insert a screenshot of the application source code showing the health endpoint, metrics instrumentation, or structured JSON logging.]
4. Containerizing the Application with Docker
After developing the services, the next step was containerization.
Docker provides a consistent way to package an application together with its runtime dependencies.
I created an individual Dockerfile for each service:
app/ ├── api-gateway/ │ ├── Dockerfile │ ├── requirements.txt │ └── app/ ├── order-service/ │ ├── Dockerfile │ ├── requirements.txt │ └── app/ └── payment-service/ ├── Dockerfile ├── requirements.txt └── app/ Each service can therefore be built and managed independently.
4.1 Building the Docker images
The application images were built locally.
The image naming convention was:
observability-api-gateway:1.1 observability-order-service:1.1 observability-payment-service:1.1 Example:
docker build \ -t observability-api-gateway:1.1 \ ./app/api-gateway Repeat the process for the other two services:
docker build \ -t observability-order-service:1.1 \ ./app/order-service docker build \ -t observability-payment-service:1.1 \ ./app/payment-service To inspect the images:
docker images 4.2 Docker image security improvements
I paid attention to container security while building the images.
The application images use a pinned Python 3.12 slim base image.
The Dockerfiles were also updated to perform operating-system package updates and clean up package metadata.
The containers run using a non-root application user rather than running the application as root.
This is important because container security should be considered during image construction, not only after deployment.
4.3 Testing with Docker Compose
Before moving to Kubernetes, I used Docker Compose to validate the application in a containerized environment.
Docker Compose made it possible to start the three services together and verify their communication.
The application containers started successfully and passed their configured health checks.
I also tested the end-to-end order workflow.
A successful request returned HTTP 200, and the payment service returned a simulated approval.
This provided an early validation of the application before introducing Kubernetes.
[SCREENSHOT 4: Insert a terminal screenshot showing docker compose ps with the three application services healthy.]
Useful commands:
docker compose -f docker/docker-compose.yml up -d docker compose -f docker/docker-compose.yml ps docker compose -f docker/docker-compose.yml logs 5. Deploying the Application to Kubernetes with Minikube
Once the application was working in Docker, I moved to Kubernetes.
Kubernetes provides orchestration capabilities for containerized applications.
It manages application workloads, service discovery, networking, health checks, and resource allocation.
For this project, I used Minikube to run a local Kubernetes cluster.
Minikube provides a practical environment for learning and validating Kubernetes deployments without requiring a production cloud cluster.
5.1 Creating the namespaces
I separated the application workloads from the observability components using Kubernetes namespaces.
The two main namespaces are:
microservices observability The microservices namespace contains:
- API Gateway
- Order Service
- Payment Service
The observability namespace contains the monitoring and telemetry components.
Separating workloads into namespaces makes it easier to organize resources and apply namespace-specific configurations.
5.2 Kubernetes Deployments
I created Kubernetes Deployment manifests for the three services.
Each service was configured with one replica during the project validation.
The deployments define:
- Container image
- Container port
- Environment configuration
- Resource requests
- Resource limits
- Readiness probes
- Liveness probes
- Container security context
5.3 Kubernetes Services
I also created Kubernetes Services using the ClusterIP service type.
The services expose the application internally within the cluster.
The ports are:
| Service | Port |
|---|---|
| API Gateway | 8000 |
| Order Service | 8001 |
| Payment Service | 8002 |
The services communicate through Kubernetes internal DNS.
For example, the API Gateway can reach the Order Service through its Kubernetes Service name rather than depending on a hardcoded pod IP address.
This is important because pod IP addresses can change when workloads are recreated.
5.4 Kubernetes health checks
I configured readiness and liveness probes using the application health endpoints.
A readiness probe determines whether a container is ready to receive traffic.
A liveness probe helps Kubernetes determine whether a container should be restarted.
These checks improve workload management and help Kubernetes respond to application health problems.
5.5 Resource requests and limits
I configured CPU and memory requests and limits for the application containers.
The application container configuration included:
resources: requests: cpu: 100m memory: 64Mi limits: cpu: 500m memory: 128Mi Requests define the resources Kubernetes should account for when scheduling a pod.
Limits define the maximum resource consumption allowed by the container configuration.
I also configured ResourceQuota objects for the application and observability namespaces.
This helps prevent workloads from consuming unlimited cluster resources.
5.6 Kubernetes container security
Security was another important part of the Kubernetes deployment.
The application containers were configured with:
- Non-root UID/GID
999 - Read-only root filesystem
- Privilege escalation disabled
- All Linux capabilities dropped
- RuntimeDefault seccomp profile
An example of the container security configuration is:
securityContext: runAsNonRoot: true runAsUser: 999 runAsGroup: 999 allowPrivilegeEscalation: false readOnlyRootFilesystem: true capabilities: drop: - ALL The pod security configuration also uses:
seccompProfile: type: RuntimeDefault These settings reduce the privileges available to application containers.
They are not a replacement for a complete security assessment, but they establish important container-hardening controls.
5.7 Validating the Kubernetes deployment
After applying the manifests, I checked the deployments and pods.
kubectl get namespaces kubectl get deployments -n microservices kubectl get pods -n microservices kubectl get services -n microservices The three application deployments reached their expected ready state.
I also validated the application health endpoints and tested the order workflow through the Kubernetes services.
The complete request successfully traversed the API Gateway, Order Service, and Payment Service.
[SCREENSHOT 5: Insert kubectl get pods -n microservices showing all three application pods running and ready.]
[SCREENSHOT 6: Insert kubectl get services -n microservices showing the three ClusterIP services.]
6. Introducing Helm for Observability Deployment
The observability stack contains multiple components.
Managing all these components manually would make installation and configuration more difficult.
I therefore used Helm.
Helm is a Kubernetes package manager that helps install and manage applications through charts and configurable values files.
For this project, I used Helm to deploy and configure the kube-prometheus-stack and the logging and tracing components.
The kube-prometheus-stack chart provides an integrated monitoring stack that includes components such as:
- Prometheus
- Grafana
- Alertmanager
- Prometheus Operator
- Kubernetes monitoring resources
The project also uses Helm configuration for Loki, Alloy, and Tempo.
This allowed me to maintain configuration in version-controlled YAML files instead of relying entirely on manual changes through the Kubernetes dashboard or terminal.
[SCREENSHOT 7: Insert a screenshot of helm list -n observability showing the installed observability releases.]
Useful command:
helm list -n observability 7. Implementing Metrics Collection with Prometheus
Prometheus is the metrics collection and monitoring system used in this project.
Its main responsibility is to collect time-series metrics from the application and Kubernetes environment.
A time-series metric is a measurement associated with a timestamp.
Examples include:
- CPU usage
- Memory usage
- HTTP request counts
- Request latency
- Filesystem capacity
- Pod availability
7.1 Application metrics collection
The three microservices expose Prometheus metrics through their /metrics endpoints.
I configured a Prometheus ServiceMonitor to discover and scrape the application services.
The ServiceMonitor uses the appropriate service labels and selects the application workloads.
The scrape configuration includes:
endpoints: - port: http path: /metrics interval: 15s The ServiceMonitor selects the application services through their labels.
This allows Prometheus to discover the endpoints through Kubernetes service discovery.
7.2 Verifying metrics collection
I used Prometheus to check whether the application targets were being scraped successfully.
One useful query is:
up{namespace="microservices"} A value of 1 indicates that Prometheus successfully scraped the target.
During validation, all three application services returned healthy scrape results.
I also checked the application request metrics and histogram metrics.
For example:
http_requests_total This metric helps track the number of HTTP requests processed by the services.
[SCREENSHOT 8: Insert a Prometheus screenshot showing all three microservice targets as UP.]
[SCREENSHOT 9: Insert a Prometheus query screenshot showing up{namespace="microservices"} returning 1 for all three services.]
8. Building Grafana Dashboards
Prometheus provides metrics, but engineers need a clear way to understand those metrics.
Grafana provides visualization and dashboarding capabilities.
I used Grafana to build three dashboards containing ten panels.
The dashboards cover infrastructure monitoring, service-level performance, and application logs.
8.1 Dashboard 1 — Infrastructure
The Infrastructure dashboard provides visibility into the underlying Kubernetes environment.
It is intended to help an engineer understand the health and resource usage of the cluster.
Infrastructure monitoring is important because application performance can be affected by problems in the environment where the application runs.
For example:
- High CPU usage can affect application performance.
- Memory pressure can cause pod instability.
- Disk exhaustion can affect workloads.
- Node availability affects scheduling and application availability.
[SCREENSHOT 10: Insert the Infrastructure dashboard showing its panels.]
8.2 Dashboard 2 — Service Overview (RED metrics)
The second dashboard focuses on application service health.
I used the RED monitoring approach.
RED stands for:
- Rate
- Errors
- Duration
These three measurements provide a useful overview of application service behaviour.
Rate
Rate measures how many requests a service processes over time.
Errors
Errors measure the number or proportion of failed requests.
Duration
Duration measures how long requests take to complete.
For request latency, I used a PromQL histogram query to calculate the 99th percentile.
histogram_quantile( 0.99, sum by (le, service) ( rate(http_request_duration_seconds_bucket[5m]) ) ) This query calculates the p99 request duration grouped by service.
The p99 is useful because it helps identify slower requests that may not be obvious from average latency.
During validation, the query returned values for the application services.
[SCREENSHOT 11: Insert the Service Overview dashboard showing request rate, error rate, and p99 latency panels.]
8.3 Dashboard 3 — Application Logs
The third dashboard focuses on application logging.
It contains panels for:
- Application Log Volume
- Application Error Count
- Recent Application Errors
The Application Log Volume panel was validated and displayed logs from:
- API Gateway
- Order Service
- Payment Service
The error-related panels were configured, but no matching ERROR events were available in the final selected time range.
This is an important distinction: a configured query is not the same as a query that has been validated against matching data.
I recorded this limitation rather than presenting the error panels as fully validated.
[SCREENSHOT 12: Insert the Application Logs dashboard showing application log volume and the three services.]
9. Centralized Logging with Grafana Loki and Grafana Alloy
One of the major objectives of this project was to centralize application logs.
In a microservices environment, each service produces its own logs.
If an engineer needs to troubleshoot an issue, manually connecting to individual containers or pods becomes inconvenient.
A centralized logging platform makes it possible to search logs from multiple services in one place.
For this project, I used:
- Grafana Alloy
- Grafana Loki
- Grafana
9.1 What is Grafana Alloy?
Grafana Alloy is an observability collector.
It can collect and process telemetry before forwarding it to a backend.
In this project, Alloy collects Kubernetes pod logs and forwards them to Loki.
9.2 What is Grafana Loki?
Loki is the centralized log aggregation system.
It stores log streams and indexes their labels so that engineers can search and filter logs efficiently.
Unlike traditional full-text indexing approaches, Loki is designed around labels and log streams.
9.3 Understanding the logging pipeline
The logging flow is:
API Gateway ───────┐ | Order Service ─────┼──> Kubernetes Pod Logs | | Payment Service ───┘ v Grafana Alloy | v Grafana Loki | v Grafana Each application writes logs to its container output.
Kubernetes makes these logs available through its pod log files.
Alloy discovers and reads the pod logs, processes the entries, and forwards them to Loki.
Grafana then queries Loki to display the logs.
9.4 Processing structured logs
I configured the Alloy pipeline to process container logs and extract structured JSON fields.
The pipeline includes stages for:
- Container log processing
- JSON field extraction
- Label creation
- Timestamp processing
- Forwarding to Loki
The key processing configuration includes:
loki.process "pod_logs" { stage.docker {} stage.json { expressions = { timestamp = "timestamp", level = "level", service = "service", } } stage.labels { values = { level = "level", service = "service", } } stage.timestamp { source = "timestamp" format = "RFC3339Nano" action_on_failure = "skip" } forward_to = [loki.write.default.receiver] } This configuration extracts useful information from the JSON logs.
The service and level fields are particularly useful when filtering logs.
9.5 A logging pipeline issue I encountered
During validation, I discovered that the container log processing stage needed to match the actual log format.
The initial pipeline used:
stage.cri {} I changed the processing stage to:
stage.docker {} and added explicit JSON parsing.
This was an important troubleshooting exercise because log collection depends on understanding the format of the actual container log files.
After correcting the pipeline and validating the Alloy configuration, logs from the application services were available in Loki.
9.6 Querying logs in Grafana
I used LogQL to query Loki.
A basic query for application logs is:
{namespace="microservices"} To filter logs by service:
{namespace="microservices", service="api-gateway"} To filter by log level:
{namespace="microservices"} | json | level="ERROR" To count ERROR entries by service over a five-minute window:
sum by (service) ( count_over_time( {namespace="microservices"} | json | level="ERROR" [5m] ) ) These queries demonstrate how centralized logs can be explored and aggregated.
During the final validation, the general application log query returned entries from the API Gateway, confirming that Loki was receiving and displaying application logs.
The ERROR query returned no matching entries in the selected time range. Therefore, the error panels were recorded as configured but not fully validated against an actual error event.
[SCREENSHOT 13: Insert a Grafana Explore screenshot showing application logs returned by Loki.]
[SCREENSHOT 14: Insert an Alloy configuration screenshot showing the log-processing pipeline.]
10. Distributed Tracing with OpenTelemetry and Grafana Tempo
Metrics tell us how a system is performing.
Logs tell us what happened.
Distributed tracing helps us understand how a request moves through multiple services.
This is especially important in a microservices architecture.
Imagine a request entering the API Gateway, moving to the Order Service, and then reaching the Payment Service.
If the request becomes slow, it may be difficult to identify which service caused the delay using metrics alone.
Distributed tracing helps connect the operations performed by the different services.
10.1 What is OpenTelemetry?
OpenTelemetry is an observability framework for generating, collecting, and exporting telemetry data.
It supports:
- Traces
- Metrics
- Logs
For this project, I used OpenTelemetry instrumentation to generate distributed traces from the application services.
10.2 What is Grafana Tempo?
Grafana Tempo is the distributed tracing backend.
It receives and stores trace data and allows engineers to explore the traces through Grafana.
10.3 Understanding the tracing flow
The tracing pipeline is:
Client Request | v API Gateway | v Order Service | v Payment Service | v OpenTelemetry Instrumentation | v OTLP Export | v Grafana Tempo | v Grafana The application services were configured to export telemetry to Tempo through OTLP gRPC.
10.4 Validating a distributed trace
I generated an order request through the API Gateway and then explored the resulting trace in Grafana Tempo.
I used the following TraceQL query:
{ resource.service.name = "api-gateway" && name = "POST /orders" } The query returned a matching trace.
This confirmed that the API Gateway request was being recorded and that Tempo could retrieve it.
[SCREENSHOT 15: Insert a Grafana Tempo Explore screenshot showing the successful POST /orders trace.]
This was one of the most important validations in the project because it demonstrated distributed tracing beyond simply deploying the tracing backend.
11. Configuring Operational Alerts in Grafana
Monitoring becomes more useful when it can notify engineers about conditions that require attention.
A dashboard requires someone to open it and inspect the metrics.
An alerting system can evaluate conditions continuously and notify the responsible team when a threshold is reached.
For this project, I configured five Grafana-managed alert rules.
They cover important application and Kubernetes operational conditions.
11.1 High HTTP Error Rate
This rule monitors the proportion of failed HTTP requests.
The objective is to detect a situation where the application begins returning too many errors.
The configured threshold is greater than 5%, with a pending period of five minutes.
11.2 High p99 Latency
This rule monitors high request latency using the p99 metric.
The purpose is to detect when a significant proportion of requests are taking longer than the expected threshold.
I also tested this alert by temporarily lowering its threshold.
The rule entered a firing state, and an email notification was successfully received.
The original threshold was restored after the test.
11.3 Kubernetes Node Not Ready
This rule monitors Kubernetes node readiness.
A node that becomes unavailable can affect workload scheduling and application availability.
The rule uses a five-minute pending period.
11.4 Low Disk Space
This rule monitors available filesystem capacity.
The configured condition checks whether available space falls below 10%.
The rule was configured and the underlying Prometheus filesystem metrics were inspected.
However, the Grafana alert detail displayed an evaluation value of zero even though the direct Prometheus query showed approximately 90.17% available space.
This discrepancy remains a validation caveat and requires further investigation.
11.5 Excessive Pod Restarts
This rule monitors excessive Kubernetes pod restarts.
Frequent restarts may indicate:
- Application crashes
- Configuration problems
- Resource constraints
- Dependency failures
- Runtime instability
The rule was configured to detect excessive restarts over the selected monitoring window.
11.6 Summary of the five rules
| Alert rule | Purpose |
|---|---|
| High HTTP Error Rate | Detect elevated application errors |
| High p99 Latency | Detect slow application requests |
| Kubernetes Node Not Ready | Detect unavailable Kubernetes nodes |
| Low Disk Space | Detect low filesystem capacity |
| Excessive Pod Restarts | Detect unstable application pods |
11.7 Configuring email notifications
I configured Grafana SMTP using Brevo as the SMTP relay provider.
The SMTP credentials were stored in a Kubernetes Secret rather than being placed directly in the configuration file.
The Secret was named:
grafana-smtp-credentials Grafana loaded the credentials through its environment configuration.
The Helm values referenced the Secret:
grafana: envFromSecret: grafana-smtp-credentials The SMTP settings included:
grafana.ini: smtp: enabled: true host: smtp-relay.brevo.com:587 user: $__env{GF_SMTP_USER} password: $__env{GF_SMTP_PASSWORD} from_address: YOUR_VERIFIED_SENDER_ADDRESS from_name: Microservices Observability startTLS_policy: MandatoryStartTLS The actual credentials were kept out of the repository.
11.8 Testing notification delivery
I tested the Grafana contact point and confirmed that a test notification was successfully delivered to my email inbox.
I also tested the High p99 Latency alert.
After the alert entered the firing state, Grafana sent an email notification.
The notification included the alert name and affected service instances.
This confirmed the end-to-end notification path:
Prometheus Metrics | v Grafana Alert Rule | v Grafana Notification Policy | v SMTP Contact Point | v Email Notification An important architectural detail is that these project alerts are Grafana-managed rules. They are routed through Grafana notification policies and the Grafana SMTP contact point.
They are not dependent on an Alertmanager-to-email routing configuration.
[SCREENSHOT 16: Insert a screenshot showing all five Grafana alert rules.]
[SCREENSHOT 17: Insert a screenshot of the Grafana notification contact point.]
[SCREENSHOT 18: Insert a screenshot of the successful email notification received in your inbox. Hide private email addresses and sensitive information.]
12. GitOps with Argo CD
Another important part of the project was GitOps.
GitOps is an approach where the desired state of an application or infrastructure is maintained in version control.
Instead of relying entirely on manually applying configuration changes, a GitOps controller continuously compares the desired state with the actual cluster state.
For this project, I used Argo CD.
Argo CD monitors the configured Git repository and manages the Kubernetes application state based on the manifests stored in Git.
The general workflow is:
GitHub Repository | v Argo CD | v Kubernetes Cluster | v Application Workloads This approach makes the deployment configuration easier to review and maintain.
It also provides visibility into whether an application is synchronized with the desired Git state.
During project validation, the Argo CD application was observed in a Synced and Healthy state.
[SCREENSHOT 19: Insert your Argo CD application screenshot showing Synced and Healthy.]
13. Building the CI Pipeline with Jenkins
Continuous Integration is another important part of a platform engineering workflow.
I used Jenkins to automate application validation and container image checks.
The project includes a Jenkins pipeline defined in:
Jenkinsfile The pipeline uses a custom workspace and skips the default checkout because the project workspace is managed separately.
It includes several stages.
13.1 Python compilation
The pipeline performs Python compilation checks to identify syntax errors before proceeding.
13.2 Application health tests
The pipeline runs application health smoke tests.
The tests use FastAPI's testing capabilities and validate the health endpoints of the three services.
The tracing configuration is stubbed during these isolated health tests.
These tests are intended to validate service health endpoints, not the complete business workflow.
13.3 Docker image builds
The pipeline builds the three application Docker images.
This confirms that the Dockerfiles and their dependencies can produce the expected images.
13.4 Ansible image validation
The pipeline runs an Ansible playbook to verify that the expected local Docker images exist.
The playbook uses Docker image inspection.
This is a lightweight validation step that confirms the images are available in the local Docker environment.
It is not a full security or runtime assessment.
13.5 Trivy security scanning
The pipeline uses Trivy to scan the application images for known vulnerabilities.
The purpose is to identify vulnerabilities in the operating-system packages and application dependencies included in the images.
13.6 Image publishing control
Image publishing is controlled through a pipeline parameter.
For the final report-only validation, image publishing was disabled.
This allowed the pipeline to validate the images without publishing them to a registry.
[SCREENSHOT 20: Insert your Jenkins pipeline screenshot showing the stages and successful report-only build.]
14. Container Security Scanning with Trivy
Security scanning was an important part of the project.
A Docker image can build successfully and still contain vulnerable packages.
Trivy helps identify known vulnerabilities in container images.
I used Trivy to scan the three application images.
14.1 Strict security validation
During strict scanning, the images were found to contain:
- 53 HIGH-severity operating-system findings
- 0 CRITICAL findings
- 13 unique CVEs
The findings were associated with Debian operating-system packages in the Python base image.
The Python dependency scan did not report corresponding application dependency findings in the final scan results.
I investigated the findings and compared available base-image options.
An alternative Bookworm image produced more findings, including CRITICAL findings, so it was not selected as an improvement.
I retained the pinned Python 3.12 slim base image and documented the remaining findings.
14.2 Strict mode and report-only mode
The Jenkins pipeline supports strict and report-only scanning behaviour.
In strict mode, HIGH or CRITICAL findings can cause the pipeline to fail.
This behaviour was demonstrated during the project.
A strict scan failed because of the outstanding HIGH-severity findings.
I then ran the pipeline in report-only mode with:
FAIL_ON_TRIVY_HIGH_OR_CRITICAL=false PUBLISH_IMAGES=false The report-only pipeline completed successfully.
This distinction is important.
A successful report-only build does not mean the vulnerabilities have disappeared.
It means the pipeline completed while reporting the findings without enforcing the strict failure condition.
14.3 Documenting a narrow exception
The project also includes a Trivy ignore configuration:
.trivyignore.yaml It contains a narrowly scoped exception for a specific setuptools finding associated with a package detected through the scanner's software bill of materials.
The exception includes an expiry date and a rationale.
It does not suppress the Debian operating-system findings.
This approach is preferable to broadly ignoring vulnerability categories without understanding the underlying result.
[SCREENSHOT 21: Insert a Trivy scan report showing the HIGH and CRITICAL finding counts.]
[SCREENSHOT 22: Insert a Jenkins screenshot showing the strict scan failure and report-only success. Make the difference clear.]
15. Automating Image Validation with Ansible
I also included Ansible in the project.
Ansible is an automation tool that can execute tasks across managed systems.
For this project, I used it for a focused validation task: checking whether the three expected application Docker images existed locally.
The playbook is located at:
ansible/playbooks/validate-images.yml The playbook checks the expected images using Docker image inspection.
The validation covered:
observability-api-gateway:1.1 observability-order-service:1.1 observability-payment-service:1.1 The validation completed successfully with:
ok=3 changed=0 failed=0 This demonstrated how Ansible can be integrated into a CI pipeline to automate operational checks.
The scope of this playbook is deliberately limited to local image existence validation.
[SCREENSHOT 23: Insert the Ansible playbook execution output showing ok=3, changed=0, and failed=0.]
16. Operational Runbooks
Monitoring and alerting are useful, but engineers also need a documented process for responding to incidents.
I created five operational runbooks.
They are stored in the runbooks/ directory.
