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

Feature: Add a Helm Chart for Vigilo #21

Merged
merged 9 commits into from
Jan 19, 2024
Merged

Feature: Add a Helm Chart for Vigilo #21

merged 9 commits into from
Jan 19, 2024

Conversation

ardelato
Copy link
Contributor

@ardelato ardelato commented Jan 16, 2024

Description

This mainly follows examples I've seen from other Helm Charts. The entire premise to be able to routinely kick off a lighthouse audit as part of our Kubernetes cluster. This will detach the dependency of having Lighthouse running on our Ubreakit machine and instead will be ran through a Pod.

As such, it will be a lot easier if we have a Helm Chart for all this instead of manually creating the manifests ourselves in our FluxCD repo.

QA

Note

This will be difficult to QA as is, we will need to manually test by integrating the Helm Chart into our current Test cluster.

  1. Declare a new GitRepository FluxCD resource
  2. Define a Helm Release
    • Use the AWS ECR repo in the values section
  3. Check if the CronJob worked successfully.

Closes: #16
Connects: https://github.com/iFixit/ifixit/issues/49455

We will be using a Kubernetes CronJob to run Vigilo periodically. This
add the initial template for the CronJob.
This will template out the name CronJob name and the container image configuration.
Vigilo is not currently publishing images to Docker Hub, so there is no default
image to use.
To run Vigilo, we need to have a `url.json` file and a `lh-config.js` file
within the container. This can be seen in `dev-scripts/run-docker.sh` file
when running the docker container directly. Therefore, in order to add
these files to the cronjob container we will volume mount them. To do that,
we need to create a configmap for each of these files to be mounted.

As such, this adds a configmap template for the `lh-config.js` file and
`urls.json` file which can then be modified in the `values.yaml` file.
The last bit to getting the helm chart working is to add a secret for the
DataDog credentials (i.e. the .env file). This adds a secret template and
updates the cronjob to include the secret.

The creation of the secret can be turned off and we can point to a different
secret if needed.
@ardelato ardelato added the external_block iFixit SQA will hold off on testing this for now (pulldasher marks PRs for this label) label Jan 16, 2024
@ghost
Copy link

ghost commented Jan 16, 2024

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

Copy link
Member

@mlahargou mlahargou left a comment

Choose a reason for hiding this comment

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

Are there any helm linters that we can enable in this repo?

maybe https://github.com/marketplace/actions/helm-chart-testing?

Copy link
Member

@mlahargou mlahargou left a comment

Choose a reason for hiding this comment

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

CR ❓ It's a bit hard to CR this as I'm not very familiar with helm chart generation. Kinda one of those things we just need to QA I think.

@ardelato
Copy link
Contributor Author

Are there any helm linters that we can enable in this repo?

maybe github.com/marketplace/actions/helm-chart-testing?

There are a couple things I want to add to help automate some of the Helm stuff. For instance, the usage of helm-docs to automatically create a corresponding README.md https://github.com/norwoodj/helm-docs

That said, I think we should create follow-up issues to address the testing aspect.

@ardelato
Copy link
Contributor Author

CR ❓ It's a bit hard to CR this as I'm not very familiar with helm chart generation. Kinda one of those things we just need to QA I think.

This is still in the early phases for us, so manual testing will be the initial validation to the charts. That said, one thing I should point out is that unlike some of the other Helm Charts we've interacted with, this uses a CronJob instead of a Deployment to kick off a Pod.

@ardelato
Copy link
Contributor Author

QA 👍

I was able to get Vigilo integrated and working in the test cluster without any modifications to the current Helm Chart.

image

image

@ardelato ardelato merged commit e6036a7 into main Jan 19, 2024
1 check passed
@ardelato ardelato deleted the add-helm-chart branch January 19, 2024 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external_block iFixit SQA will hold off on testing this for now (pulldasher marks PRs for this label)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a Helm Chart
2 participants