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

TASK: Investigate and document method for testing locally-modified baseline helm charts in ArgoCD #488

Closed
2 tasks done
ewilkins-csi opened this issue Dec 2, 2024 · 8 comments
Assignees
Labels
task Support ticket - typically not code related
Milestone

Comments

@ewilkins-csi
Copy link
Contributor

ewilkins-csi commented Dec 2, 2024

Description

We were testing changes to Helm charts under extensions-helm locally by changing the repository field to file:///path/to/modified/chart/, as noted in the extensions-helm README. With the move away from Tilt and to ArgoCD this technique will no longer work. We need an alternative approach.

DOD

  • Find a technique for testing modifications to baseline charts prior to publishing
    • Note: We currently do have an approach that involves manually moving the chart tarball from the baseline project to the test project and committing/pushing to test project repo, but this is a bit cumbersome and can hard to tell/remember what version of the chart you're actually using
  • Update the extensions-helm README with this approach

Test Strategy/Script

  1. Make a change to extensions/extensions-helm/aissemble-kafka-chart/values.yaml that will be easy to verify (e.g. fullnameOverride)
  2. Commit the change to a test branch and push to GitHub
  3. Create a repo in your GitHub account called final-488
    • make the project public to avoid auth complications
  4. Create a new project from the archetype
mvn archetype:generate '-DarchetypeGroupId=com.boozallen.aissemble' \
                       '-DarchetypeArtifactId=foundation-archetype' \
                       '-DarchetypeVersion=1.11.0-SNAPSHOT' \
                       '-DgroupId=org.test' \
                       '-Dpackage=org.test' \
                       '-DprojectGitUrl=<YOUR PROJECT URL>' \
                       '-DprojectName=Test Project' \
                       '-DartifactId=final-488'
  1. Run the build ignoring any manual actions: mvn clean install
  2. Follow the instructions in the extensions-helm README to point the kafka-cluster chart to your test branch
    • This should involve modifications to final-488-infrastructure/values.yaml and final-488-deploy/src/main/resources/apps/kafka-cluster/Chart.yaml
  3. Add Chart.lock to .gitignore
  4. Commit and push your changes
    git init
    git add .
    git commit -m'initial commit'
    git remote add origin <YOUR PROJECT URL>
    git branch -M main
    git push -u origin main
  5. Deploy the project
    ./deploy.sh up
  6. Navigate to ArgoCD at localhost:30080
  7. Select the kafka deployment and verify the changed default value is present
@ewilkins-csi ewilkins-csi added the task Support ticket - typically not code related label Dec 2, 2024
@ewilkins-csi ewilkins-csi self-assigned this Dec 2, 2024
@ewilkins-csi ewilkins-csi added this to the 1.11.0 milestone Dec 2, 2024
@ewilkins-csi
Copy link
Contributor Author

Definition of Done with @csun-cpointe and @carter-cundiff

@ewilkins-csi
Copy link
Contributor Author

The most straight-forward answer to this issue would be to simply refer to the chart in the GitHub repo at the specific dev branch. Unfortunately, this is not supported by Helm out of the box. It has a storied history and is generally considered a good improvement to Helm, however the work has not landed. (It was "one of the longest standing" PRs in 2021.)

There has been some recent-ish work to revive the proposal. The linked PR and associated HIP do a good job of documenting the history, and also pointed out several Helm plugins that achieve this functionality. While I think it makes sense for us to keep an eye on the progress and perhaps provide help where we can, in the short term we can use one of the plugins mentioned.

Currently in the process of testing the most popular/frequently updated plugin now and updating docs accordingly.

@ewilkins-csi
Copy link
Contributor Author

ewilkins-csi commented Dec 4, 2024

I got this working with the aslafy-z/helm-git plugin but there were a few "gotchas".

  • The version of the ArgoCD chart we are on sets the cache and data directories for helm to the same location, which causes plugin install issues as the cached github download and the plugin are duplications
    • Work-around is to explicitly set the plugins directory to a different volume mount
  • There is an existing issue with committing Chart.lock files when you're using an explicit repository vs a repository alias
    • Just don't check in Chart.lock 🙃

@ewilkins-csi
Copy link
Contributor Author

ewilkins-csi commented Dec 5, 2024

As an outflow of this ticket, we probably want to add Chart.lock to the .gitignore file for all of the downstream charts. Because downstream projects are leveraging GitOps and not packaging/publishing their charts, it doesn't make sense to commit Chart.lock.

ewilkins-csi added a commit that referenced this issue Dec 5, 2024
Also makes the deploy.sh script executable by default, and improves the
deploy script by adding a startup option that will deploy/upgrade the
infrastructure without deploying the app. (Useful for developing the
infrastructure chart.)
@ewilkins-csi
Copy link
Contributor Author

@jaebchoi had luck with just pushing the helm chart tarball to his personal GH OCI repo with helm push. It's unclear why authentication wasn't an issue, however this approach doesn't satisfy concern noted in the DoD: can be hard to tell/remember what version of the chart you're actually using. So it's probably still better to use the plugin approach when iterating during development.

ewilkins-csi added a commit that referenced this issue Dec 5, 2024
Also makes the deploy.sh script executable by default, and improves the
deploy script by adding a startup option that will deploy/upgrade the
infrastructure without deploying the app. (Useful for developing the
infrastructure chart.)
ewilkins-csi added a commit that referenced this issue Dec 5, 2024
[#488] update extensions-helm README to work with ArgoCD
@ewilkins-csi
Copy link
Contributor Author

OTS with @csun-cpointe and @carter-cundiff

@csun-cpointe
Copy link
Contributor

Final test passed!!
Screenshot 2024-12-05 at 3 35 24 PM

ewilkins-csi added a commit that referenced this issue Dec 19, 2024
To allow for the dev branch to be released, the changes in this commit
were reverted and moved to this feature branch.  The original work was
done in the following tickets:
 - #483 (9b4c2b6) merged in #487
 - #483 (33b597a) merged in #489
 - #488 (5bf5151) merged in #493
ewilkins-csi added a commit that referenced this issue Dec 19, 2024
To allow for the dev branch to be released, the changes in this commit
were reverted and moved to this feature branch.  The original work was
done in the following tickets:
 - #483 (9b4c2b6) merged in #487
 - #483 (33b597a) merged in #489
 - #488 (5bf5151) merged in #493
@ewilkins-csi
Copy link
Contributor Author

These changes were at least partially reverted in #513

ewilkins-csi added a commit that referenced this issue Dec 20, 2024
To allow for the dev branch to be released, the changes in this commit
were reverted and moved to this feature branch.  The original work was
done in the following tickets:
 - #483 (9b4c2b6) merged in #487
 - #483 (33b597a) merged in #489
 - #488 (5bf5151) merged in #493
ewilkins-csi added a commit that referenced this issue Dec 20, 2024
To allow for the dev branch to be released, the changes in this commit
were reverted and moved to this feature branch.  The original work was
done in the following tickets:
 - #483 (9b4c2b6) merged in #487
 - #483 (33b597a) merged in #489
 - #488 (5bf5151) merged in #493
ewilkins-csi added a commit that referenced this issue Jan 15, 2025
To allow for the dev branch to be released, the changes in this commit
were reverted and moved to this feature branch.  The original work was
done in the following tickets:
 - #483 (9b4c2b6) merged in #487
 - #483 (33b597a) merged in #489
 - #488 (5bf5151) merged in #493
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Support ticket - typically not code related
Projects
None yet
Development

No branches or pull requests

2 participants