Skip to content

Add Kubernetes deployment option mirroring compose stack (#9)#11

Merged
hyzhak merged 7 commits intomainfrom
feature/k8s-deployment
Sep 23, 2025
Merged

Add Kubernetes deployment option mirroring compose stack (#9)#11
hyzhak merged 7 commits intomainfrom
feature/k8s-deployment

Conversation

@hyzhak
Copy link
Owner

@hyzhak hyzhak commented Sep 22, 2025

Summary

  • add a full Kubernetes deployment stack under k8s/ (namespace, PVCs, Deployments, Services, ConfigMaps, Secrets) plus local and production kustomize overlays
  • copy the compose service configs into version-controlled ConfigMaps, add Make targets for apply/delete, and document every manifest in docs/k8s-manifests.md
  • expand the README with reorganized compose instructions, a macOS kind quickstart, and references to the detailed K8s docs; clarify kind runtime auto-detection behaviour
  • extend CI with a kind-based smoke test job so the Kubernetes overlay is validated alongside the existing docker-compose integration run

Testing

  • kubectl kustomize k8s/base
  • kubectl kustomize k8s/overlays/local
  • kubectl kustomize k8s/overlays/production
  • make k8s-apply-local && make k8s-delete-local

@hyzhak hyzhak requested a review from Copilot September 22, 2025 23:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces Kubernetes deployment manifests that mirror the existing Docker Compose observability stack, providing a complete path for deploying the LGTM (Loki, Grafana, Tempo, Mimir/Prometheus) stack in Kubernetes environments.

  • Adds comprehensive Kubernetes manifests with base configurations and environment-specific overlays
  • Provides local development support via kind/k3d/minikube with appropriate image policies
  • Includes production-ready templates with resource limits, storage classes, and ingress configurations

Reviewed Changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
k8s/base/*.yaml Core Kubernetes manifests for all stack components (Grafana, Loki, Tempo, Prometheus, OTel Collector, FastAPI app, loadgen)
k8s/base/files/* Configuration files mirroring the compose setup for each component
k8s/overlays/local/* Local development overlay with Never pull policy and local image tags
k8s/overlays/production/* Production overlay with resource limits, storage classes, and ingress definitions
.github/workflows/integration-tests.yml CI integration to test Kubernetes deployment using kind
Makefile Make targets for applying/deleting Kubernetes manifests
README.md Comprehensive documentation for Kubernetes deployment workflows

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

registry:
external_labels: # Labels attached to generated metrics (use meaningful cluster/service labels in prod)
source: tempo
cluster: docker-compose
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cluster label value 'docker-compose' is misleading in a Kubernetes context. Consider using a more generic value like 'demo' or 'local' that applies to both deployment methods.

Suggested change
cluster: docker-compose
cluster: demo

Copilot uses AI. Check for mistakes.
ingressClassName: nginx
tls:
- hosts:
- grafana.example.com
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example.com hostnames in production ingress should be documented as placeholders that need to be replaced with actual hostnames before deployment.

Copilot uses AI. Check for mistakes.
ingressClassName: nginx
tls:
- hosts:
- app.example.com
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example.com hostnames in production ingress should be documented as placeholders that need to be replaced with actual hostnames before deployment.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

@hyzhak hyzhak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed the review feedback in the latest commit—details inline.

registry:
external_labels: # Labels attached to generated metrics (use meaningful cluster/service labels in prod)
source: tempo
cluster: demo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this! I've updated the metrics generator label to use cluster: demo so the value makes sense in both compose and Kubernetes environments.

spec:
ingressClassName: nginx
tls:
- hosts:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I added a YAML comment above the spec and inline on the host entries to make it clear that the example.com domains must be replaced before deploying.

spec:
ingressClassName: nginx
tls:
- hosts:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added inline placeholder notes for the app.example.com entry as well so both ingress hosts now explicitly call out the need for customization.

@hyzhak hyzhak requested a review from Copilot September 22, 2025 23:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

ingressClassName: nginx
tls:
- hosts:
- grafana.example.com # placeholder hostname
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder hostname comment is inline but should be properly documented. Consider adding a block comment above the TLS section explaining that all example.com hostnames must be replaced with actual domains before deployment.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could it be even better to add details into Readme md?

ingressClassName: nginx
tls:
- hosts:
- app.example.com # placeholder hostname
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This placeholder hostname comment is inline but should be properly documented. Consider adding a block comment above this TLS section explaining that all example.com hostnames must be replaced with actual domains before deployment.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could it be even better to add details into Readme md?

@hyzhak hyzhak requested a review from Copilot September 23, 2025 02:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

replication_factor: 1
chunk_idle_period: 1h
chunk_target_size: 1536000
# NOTE: removed: max_transfer_retries (deprecated/invalid)
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This comment references a removed configuration option but doesn't provide context about when it was deprecated or what replaced it, which could be helpful for users migrating from older Loki versions.

Suggested change
# NOTE: removed: max_transfer_retries (deprecated/invalid)
# NOTE: removed: max_transfer_retries (deprecated/invalid as of Loki 2.8.0; no direct replacement—retries are now managed internally)

Copilot uses AI. Check for mistakes.
tsdb_shipper:
active_index_directory: /loki/tsdb-shipper-active
cache_location: /loki/tsdb-shipper-cache
# NOTE: do not set shared_store here; not needed for filesystem
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] These comments about shared_store appear twice with slightly different explanations. Consider consolidating them or making the distinction clearer.

Copilot uses AI. Check for mistakes.

compactor:
working_directory: /loki/compactor
# NOTE: removed: shared_store (deprecated/invalid)
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] These comments about shared_store appear twice with slightly different explanations. Consider consolidating them or making the distinction clearer.

Copilot uses AI. Check for mistakes.
@hyzhak hyzhak merged commit 359e39e into main Sep 23, 2025
2 checks passed
@hyzhak hyzhak deleted the feature/k8s-deployment branch September 23, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants