Skip to content

Configure kubernetes deployment#1

Merged
nbenmoody merged 50 commits intomainfrom
configure-kubernetes-deployment
Apr 15, 2025
Merged

Configure kubernetes deployment#1
nbenmoody merged 50 commits intomainfrom
configure-kubernetes-deployment

Conversation

@nbenmoody
Copy link
Copy Markdown
Collaborator

@nbenmoody nbenmoody commented Mar 29, 2025

Description

In order to deploy the route96 Blossom media server to our shiny new kubernetes cluster, we need to add the Helm chart manifests to this repo.

Related Issues

Changes Made

  • Add a basic Helm chart, along with all required templates and values
  • Add a readme
  • Update the Helm chart and readme to reflect details that are still needed:
    • env vars on the deployment.yaml for the Postgres creds/host, once those are configured in an independent sealed-secret.
    • The updated persistence details, and volume mount configuration, once those details are ready to be set here.

Additional Notes

Summary by CodeRabbit

  • New Features
    • Introduced comprehensive Kubernetes deployment templates using Helm, including Deployment, Service, Ingress, HorizontalPodAutoscaler, PodDisruptionBudget, PersistentVolumeClaim, and SealedSecret resources for the Blossom application.
    • Added a detailed deployment guide for users.
  • Chores
    • Replaced the Docker image publishing workflow with an improved release and deployment workflow integrating versioning, image publishing, and release branch management.
    • Updated .gitignore to exclude the local/ directory.
  • Documentation
    • Added deployment documentation to guide users through the Helm and ArgoCD-based deployment process.
  • Style
    • Added newlines to configuration files for consistency.
  • Refactor
    • Removed obsolete Docker image publishing workflow.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update replaces the previous Docker image build and publish workflow with a new comprehensive GitHub Actions workflow that integrates semantic versioning, Docker image publishing, and automated release branch merging with Helm chart version updates and tagging. It adds detailed deployment documentation and a full Helm chart for the route96 application, including Kubernetes manifests for deployment, service, ingress, autoscaling, persistent storage, configuration, secrets management, and pod disruption budget. Minor changes include adding local/ to .gitignore, appending a newline to the Dockerfile, and removing a commented test key line from docker-compose.yml.

Changes

File(s) Change Summary
.github/workflows/docker-publish.yml Deleted the previous GitHub Actions workflow for building and pushing Docker images on main branch updates.
.github/workflows/publish-and-release.yml Added a new multi-job GitHub Actions workflow for semantic versioning, Docker image build and push, and automated release branch merge with Helm chart version bumping and git tagging.
.gitignore Added local/ directory to the ignore list; appended newline at file end.
Dockerfile Added a newline at the end of the file; no functional changes.
docker-compose.yml Removed a commented-out test public key annotation line from the app service environment variables.
deployment/README.md Added documentation describing the deployment process using Helm charts and ArgoCD, including steps for version updates and syncing.
deployment/route96/.helmignore Added Helm ignore file specifying common system, VCS, backup, and IDE files/directories to exclude from Helm packages.
deployment/route96/Chart.yaml Added Helm chart metadata for the route96 application, specifying API version, chart name, description, type, chart version, and app version.
deployment/route96/values.yaml Added Helm values file defining default deployment parameters such as replicas, image repository/tag/pull policy, pod disruption budget, autoscaling settings, persistent storage size, service type and port, ingress settings (disabled by default).
deployment/route96/templates/config.yaml Added Kubernetes ConfigMap manifest with application configuration placeholders for environment-specific values.
deployment/route96/templates/deployment.yaml Added Kubernetes Deployment manifest for the blossom app with configurable replicas, container image, environment variables (including secrets), resource requests/limits, probes, ports, and volume mounts for config, data, and secrets.
deployment/route96/templates/hpa.yaml Added Kubernetes HorizontalPodAutoscaler manifest targeting the blossom-deployment, scaling pods based on CPU utilization with configurable min/max replicas and target CPU percentage.
deployment/route96/templates/ingress.yaml Added conditional Kubernetes Ingress manifest for HTTP routing to the blossom-service, enabled based on Helm values.
deployment/route96/templates/pdb.yaml Added Kubernetes PodDisruptionBudget manifest ensuring minimum pod availability during voluntary disruptions, configurable via Helm values.
deployment/route96/templates/pvc.yaml Added Kubernetes PersistentVolumeClaim manifest for application data storage with configurable size.
deployment/route96/templates/sealed-secret.yaml Added Kubernetes SealedSecret manifest with encrypted data entries for sensitive configuration values, to be decrypted at runtime by the Sealed Secrets controller.
deployment/route96/templates/service.yaml Added Kubernetes Service manifest exposing the blossom application internally via ClusterIP on port 80 mapped to container port 8000.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub Actions
    participant GHCR as GitHub Container Registry
    participant Repo as Git Repository
    participant K8s as Kubernetes Cluster (via ArgoCD)

    Dev->>GH: Push or PR to main branch
    GH->>GH: Run get_version job (GitVersion)
    GH->>GH: Run push_to_registry job (build & push Docker image)
    GH->>GHCR: Push Docker image with SemVer and latest tags
    GH->>GH: Run merge_to_release job (merge main into release branch)
    GH->>Repo: Commit Helm chart version bump, tag with SemVer, push changes
    Repo->>K8s: (via ArgoCD) Deploy updated Helm chart and Docker image
Loading

Possibly related PRs

  • Configure kubernetes deployment #1: Shares deletion of .github/workflows/docker-publish.yml and addition of .github/workflows/publish-and-release.yml workflow with similar job definitions and steps.

Suggested reviewers

  • dcadenas

Poem

🐇
A hop, a skip, a versioned leap,
Helm charts blossom, secrets deep.
Workflows now with magic spun,
Build and release, all-in-one!
With Argo’s sync and Docker’s cheer,
The garden grows—deployments clear.
In YAML fields, our future’s bright—
Ship it, rabbit, through the night!

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4353f9c and d0474d1.

📒 Files selected for processing (8)
  • deployment/route96/templates/config.yaml (1 hunks)
  • deployment/route96/templates/deployment.yaml (1 hunks)
  • deployment/route96/templates/hpa.yaml (1 hunks)
  • deployment/route96/templates/pdb.yaml (1 hunks)
  • deployment/route96/templates/pvc.yaml (1 hunks)
  • deployment/route96/templates/sealed-secret.yaml (1 hunks)
  • deployment/route96/templates/service.yaml (1 hunks)
  • deployment/route96/values.yaml (1 hunks)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nbenmoody nbenmoody marked this pull request as ready for review April 14, 2025 23:41
@nbenmoody nbenmoody requested a review from dcadenas April 14, 2025 23:42
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (7)
deployment/route96/templates/config.yaml (1)

5-5: Remove trailing whitespace for YAML lint compliance.

There is a trailing space at the end of line 5. Remove it to avoid YAML linting errors.

-  namespace: blossom 
+  namespace: blossom
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 5-5: trailing spaces

(trailing-spaces)

deployment/route96/templates/service.yaml (1)

1-16: Add a newline at end of file for YAML compliance.

The manifest is correct and well-structured. Please add a newline at the end of the file to resolve YAML linting warnings and maintain consistency.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 16-16: no new line character at the end of file

(new-line-at-end-of-file)

deployment/route96/templates/pvc.yaml (1)

1-15: PVC manifest is correct; consider removing extra blank line.

The manifest is valid and uses Helm templating appropriately. Optionally, remove the extra blank line at the end for tidiness.

deployment/route96/templates/hpa.yaml (1)

1-22: Add a newline at end of file for YAML compliance.

The HPA manifest is correct and uses Helm templating well. Please add a newline at the end of the file to resolve YAML linting warnings.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 22-22: no new line character at the end of file

(new-line-at-end-of-file)

deployment/route96/templates/pdb.yaml (1)

1-13: Add a newline at end of file for YAML compliance.

The PDB manifest is correct and uses Helm templating appropriately. Please add a newline at the end of the file to resolve YAML linting warnings.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 13-13: no new line character at the end of file

(new-line-at-end-of-file)

deployment/route96/values.yaml (1)

1-26: Add a newline at end of file.

YAML best practices and some tools expect a newline at the end of the file. Please add one to avoid linter warnings.

-  host: "blossom.plur.app"
+  host: "blossom.plur.app"
+
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 26-26: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/publish-and-release.yml (1)

44-46: Remove trailing spaces from workflow steps.

Lines 44 and 46 have trailing spaces. Clean these up for consistency and to avoid linter warnings.

-        id: get-version 
-        uses: gittools/actions/gitversion/execute@v3.2.0
-      
+        id: get-version
+        uses: gittools/actions/gitversion/execute@v3.2.0
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 44-44: trailing spaces

(trailing-spaces)


[error] 46-46: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62417cb and 4353f9c.

⛔ Files ignored due to path filters (1)
  • deployment/route96/Chart.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • .github/workflows/docker-publish.yml (0 hunks)
  • .github/workflows/publish-and-release.yml (1 hunks)
  • .gitignore (1 hunks)
  • Dockerfile (1 hunks)
  • deployment/README.md (1 hunks)
  • deployment/route96/.helmignore (1 hunks)
  • deployment/route96/Chart.yaml (1 hunks)
  • deployment/route96/templates/config.yaml (1 hunks)
  • deployment/route96/templates/deployment.yaml (1 hunks)
  • deployment/route96/templates/hpa.yaml (1 hunks)
  • deployment/route96/templates/ingress.yaml (1 hunks)
  • deployment/route96/templates/pdb.yaml (1 hunks)
  • deployment/route96/templates/pvc.yaml (1 hunks)
  • deployment/route96/templates/sealed-secret.yaml (1 hunks)
  • deployment/route96/templates/service.yaml (1 hunks)
  • deployment/route96/values.yaml (1 hunks)
  • docker-compose.yml (0 hunks)
💤 Files with no reviewable changes (2)
  • docker-compose.yml
  • .github/workflows/docker-publish.yml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
deployment/route96/templates/hpa.yaml

[error] 22-22: no new line character at the end of file

(new-line-at-end-of-file)

deployment/route96/templates/ingress.yaml

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

deployment/route96/templates/service.yaml

[error] 16-16: no new line character at the end of file

(new-line-at-end-of-file)

deployment/route96/templates/config.yaml

[error] 5-5: trailing spaces

(trailing-spaces)

deployment/route96/templates/pdb.yaml

[error] 13-13: no new line character at the end of file

(new-line-at-end-of-file)

deployment/route96/templates/deployment.yaml

[warning] 27-27: wrong indentation: expected 8 but found 10

(indentation)


[error] 43-43: trailing spaces

(trailing-spaces)


[error] 44-44: trailing spaces

(trailing-spaces)


[warning] 90-90: wrong indentation: expected 10 but found 12

(indentation)

deployment/route96/values.yaml

[error] 26-26: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/publish-and-release.yml

[error] 44-44: trailing spaces

(trailing-spaces)


[error] 46-46: trailing spaces

(trailing-spaces)

🪛 actionlint (1.7.4)
.github/workflows/publish-and-release.yml

120-120: property "get_version" is not defined in object type {push_to_registry: {outputs: {}; result: string}}

(expression)


127-127: property "get_version" is not defined in object type {push_to_registry: {outputs: {}; result: string}}

(expression)

🔇 Additional comments (7)
.gitignore (1)

5-5: Addition of local/ to .gitignore is appropriate.

This prevents local deployment artifacts from being tracked by git.

Dockerfile (1)

79-80: Addition of newline at end of Dockerfile is good practice.

No functional changes; this improves POSIX compliance.

deployment/route96/.helmignore (1)

1-24: Standard .helmignore patterns are well-chosen.

This will help keep Helm charts free of unnecessary files.

deployment/route96/templates/ingress.yaml (1)

1-24: Helm templating for Ingress is correct.

YAMLlint syntax error is a false positive; Helm templates are expected to use these delimiters.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 1-1: syntax error: expected the node content, but found '-'

(syntax)

deployment/README.md (1)

1-10: Deployment documentation is clear and accurate.

No issues found. The instructions are concise and provide a good overview of the deployment process.

deployment/route96/templates/sealed-secret.yaml (1)

1-19: SealedSecret manifest is well-structured and secure.

All sensitive data is encrypted, and the manifest follows best practices for SealedSecrets.

deployment/route96/Chart.yaml (1)

1-17: Helm chart metadata is complete and follows best practices.

No issues found; the chart is ready for use.

Comment thread deployment/route96/templates/deployment.yaml Outdated
Comment thread deployment/route96/templates/deployment.yaml Outdated
@nbenmoody nbenmoody merged commit deb515e into main Apr 15, 2025
3 checks passed
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.

1 participant