Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: fix: Restructure HELM charts, secrets encryption #20

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

akash2237778
Copy link
Collaborator

@akash2237778 akash2237778 commented Dec 8, 2024

Modified directory structure, encrypted secrets using sops

Summary by Sourcery

Restructure the Helm charts and encrypt secrets using SOPS. Update the directory structure for better organization and maintainability. Integrate SOPS for secrets management and update the Dockerfile to include SOPS installation. Refactor deployment configurations to align with the new Helm chart structure.

Enhancements:

  • Refactor the Helm chart structure to improve organization and maintainability.

Build:

  • Add installation of SOPS in the Dockerfile for secrets encryption.

Deployment:

  • Restructure deployment configurations by moving them to a new Helm chart directory.

Copy link

sourcery-ai bot commented Dec 8, 2024

Reviewer's Guide by Sourcery

This PR restructures the Helm charts organization and implements secrets encryption using SOPS. The changes include splitting the Helm templates into component-specific directories, updating the configuration to use encrypted secrets, and modifying the deployment structure to support secure secret management.

Class diagram for updated secret management

classDiagram
    class decrypt_secrets {
        +load_secrets() str
        +file_path : str
    }
    note for decrypt_secrets "This class handles the decryption of secrets using SOPS."
    class secrets_encrypted_yaml {
        +gh_access_token : str
        +cosign : dict
        +intermediate_registry_token : str
    }
    decrypt_secrets --> secrets_encrypted_yaml : "decrypts"
    class load_secrets {
        +gh_access_token : str
        +cosign_password : str
        +cosign_private_key : str
        +intermediate_registry_token : str
    }
    decrypt_secrets --> load_secrets : "returns"
    note for load_secrets "This class represents the decrypted secrets."
Loading

File-Level Changes

Change Details Files
Restructured Helm charts organization into component-specific directories
  • Split templates into pubgrade-webserver, pubgrade-mongodb, and pubgrade-build-complete-updater directories
  • Moved deployment configurations into separate component files
  • Updated service account and role binding configurations to use values from helm chart
  • Consolidated values.yaml with component-specific configurations
helm/templates/pubgrade-webserver/*
helm/templates/pubgrade-mongodb/*
helm/templates/pubgrade-build-complete-updater/*
helm/values.yaml
Implemented secrets encryption using SOPS
  • Added encrypted secrets configuration file
  • Created utility function to decrypt secrets at runtime
  • Updated Dockerfile to include SOPS installation
  • Modified secret references to use the new decryption mechanism
helm/templates/pubgrade-webserver/secrets-encrypted.yaml
pubgrade/utils/decrypt_secrets.py
Dockerfile
pubgrade/modules/endpoints/builds.py
Updated ingress configuration and service parameters
  • Modified ingress template to use component-specific values
  • Updated service port configurations
  • Added support for dynamic port configuration through values
helm/templates/pubgrade-webserver/ingress.yaml
helm/templates/pubgrade-webserver/services.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@akash2237778 akash2237778 changed the title fix: Restructure HELM charts, secrets encryption Draft: fix: Restructure HELM charts, secrets encryption Dec 8, 2024
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @akash2237778 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please remove the kubeconfig credentials that were accidentally committed in helm/templates/pubgrade-webserver/deployment.yaml
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

pubgrade/utils/decrypt_secrets.py Outdated Show resolved Hide resolved
pubgrade/modules/endpoints/builds.py Show resolved Hide resolved
pubgrade/utils/decrypt_secrets.py Outdated Show resolved Hide resolved
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