Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Add helm chart #10

Merged
merged 7 commits into from
Mar 15, 2022
Merged

Add helm chart #10

merged 7 commits into from
Mar 15, 2022

Conversation

mehyedes
Copy link
Contributor

@mehyedes mehyedes commented Feb 2, 2022

This adds a helm chart for cluster-api-state-metrics

  • Create Helm chart
  • Add make targets for helm
  • Set default image repo (related to Find a proper destination registry #3)
  • Add additional CI steps for the helm chart Will be done in a separate PR
  • Set helm repo for publishing the chart Will be done in a separate PR

It would be great if you provide some feedback on how to proceed with the points above 😁

In the chart, there are also serviceMonitor and GrafanaDashboard templates. We thought they might be useful for anyone out there using the prometheus and grafana operators additionally.

Solves: #9

@chrischdi
Copy link
Contributor

Looks good so far 😀 thanks for your Pull Request 🎉

Regarding your points:

Add additional CI steps for the helm chart

The rbac role is getting generated and updated via kubebuilder.

Should we integrate something to the makefile to also update the rbac role in the helm chart? (sed or something like that to generate the helm variant from the kubebuilder generated one?)

Set default image repo (related to #3)

I hope that I'll be able to finish the process by next week so we can publish images to quay.io.

Set helm repo for publishing the chart

What do we have for options here?
Is a github release a valid source or could this also be done at quay.io then?

Copy link
Contributor

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

I think we should split out the grafana dashboard to either a separate location or another PR.

Not everyone is using the integreatly.org/v1alpha1 CRs and the dashboard would be way more reusable then I think.

Added first version 0.1.0 of the cluster-api-state-metrics helm chart.

Signed-off-by: Mehdi Yedes <[email protected]>
@mehyedes
Copy link
Contributor Author

mehyedes commented Feb 3, 2022

I think we should split out the grafana dashboard to either a separate location or another PR.

Not everyone is using the integreatly.org/v1alpha1 CRs and the dashboard would be way more reusable then I think.

Agree, would be better to leave it out of this PR for now and then do it in another iteration.

@mehyedes
Copy link
Contributor Author

mehyedes commented Feb 3, 2022

Add additional CI steps for the helm chart

The rbac role is getting generated and updated via kubebuilder.

Should we integrate something to the makefile to also update the rbac role in the helm chart? (sed or something like that to generate the helm variant from the kubebuilder generated one?)

Yes, that would make sense. However, we should keep in mind that we need to publish a new helm chart release whenever the role(s) are changed. Of course, that would be ideally automated but we just need to keep that in mind.

Set default image repo (related to #3)

I hope that I'll be able to finish the process by next week so we can publish images to quay.io.

Awesome!

Set helm repo for publishing the chart

What do we have for options here? Is a github release a valid source or could this also be done at quay.io then?

I think Quay already supports helm chart repos(never worked with it though). But simply using github releases might also be an option for now. We could use chart-releaser, but I am not sure if it's possible to use it for this repo, since it's not dedicated to only storing helm charts.

@chrischdi
Copy link
Contributor

Add additional CI steps for the helm chart

The rbac role is getting generated and updated via kubebuilder.
Should we integrate something to the makefile to also update the rbac role in the helm chart? (sed or something like that to generate the helm variant from the kubebuilder generated one?)

Yes, that would make sense. However, we should keep in mind that we need to publish a new helm chart release whenever the role(s) are changed. Of course, that would be ideally automated but we just need to keep that in mind.

I think publishing a chart release should be fine using chart releaser's github action: https://github.com/helm/chart-releaser-action :-) but let's do this in a follow-up PR then to limit scope here.

Set default image repo (related to #3)

I hope that I'll be able to finish the process by next week so we can publish images to quay.io.

Awesome!

Set helm repo for publishing the chart

What do we have for options here? Is a github release a valid source or could this also be done at quay.io then?

I think Quay already supports helm chart repos(never worked with it though). But simply using github releases might also be an option for now. We could use chart-releaser, but I am not sure if it's possible to use it for this repo, since it's not dedicated to only storing helm charts.

What would you prefer as chart repo: github release or quay.io? I think github release would be better?!

@mehyedes
Copy link
Contributor Author

mehyedes commented Feb 8, 2022

What would you prefer as chart repo: github release or quay.io? I think github release would be better?!

I agree.

I'll try to update my PR in the upcoming few days.

@mehyedes
Copy link
Contributor Author

I have updated the PR now.

The failing checks should be resolved and the role templates for the helm chart are now generated from the ones under config/rbac

@chrischdi
Copy link
Contributor

chrischdi commented Mar 10, 2022

Hi @mehyedes sorry for the late reply.

We are currently working on a proposal to contribute CASM to github.com/kubernetes-sigs/cluster-api .
I don't know if the contribution would include a helm chart if we have it in here.

So I see some options here:

  • Add the helm chart here and also further maintain it after the CASM code got contributed to cluster-api
  • Create a seperate repository for the helm chart (which could be also published directly by you if you would prefer that), this way the chart would be independent.
  • Later on maybe contribute a helm chart to github.com/kubernetes-sigs/cluster-api if they want/accept helm-charts there (e.g. somewhere in hack/observability)

What do you think?

@mehyedes
Copy link
Contributor Author

mehyedes commented Mar 11, 2022

Hey @chrischdi, thanks for your feedback.

I think it depends on how the contribution of CASM into cluster-api would be. If CASM will be integrated into the cluster-api codebase, I believe there would be no need for a separate helm chart at all in that case. AFAIK, there is no "official" helm chart for cluster-api for now, but if there was one, then that's where I would add the CASM config.
And since CAPI project is using clusterctl to install its components, I don't see that there will be a helm chart, at least not any time soon.
Maybe we could add the helm chart into this repo, until the project gets contributed to CAPI. Then, there will be no need for it anymore I think so it wouldn't need to be further maintained.

Copy link
Contributor

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

one nit

/lgtm

@tobiasgiese maybe you have some time to take a look at it too?

Makefile Show resolved Hide resolved
@chrischdi
Copy link
Contributor

Maybe we could add the helm chart into this repo, until the project gets contributed to CAPI. Then, there will be no need for it anymore I think so it wouldn't need to be further maintained.

Sounds fair to me 👍 Just didn't want to raise the expectation that it will be integrated to the core repo automatically :-) So we have the same opinion here 😄

Copy link
Contributor

@tobiasgiese tobiasgiese left a comment

Choose a reason for hiding this comment

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

One tiny nit, rest looks really fine to me. Thanks for your contribution! 🙂🎉

deploy/chart/templates/tests/test-connection.yaml Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
Copy link
Member

@seanschneeweiss seanschneeweiss left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Member

@seanschneeweiss seanschneeweiss left a comment

Choose a reason for hiding this comment

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

Thank you a lot for the contribution.

Mehdi Yedes added 4 commits March 15, 2022 13:41
Signed-off-by: Mehdi Yedes <[email protected]>
fixed indentation in deployment template
removed grafanaDashboard template
updated chart README

Signed-off-by: Mehdi Yedes <[email protected]>
- Added script to generate role templates for the helm chart. The script is executed with `make
  manifests`
- Added missing SPDX headers

Signed-off-by: Mehdi Yedes <[email protected]>
Added helm-lint to the lint target

Signed-off-by: Mehdi Yedes <[email protected]>
Use YAML instead JSON

Co-authored-by: Tobias Giese <[email protected]>
Copy link
Contributor

@johannesfrey johannesfrey left a comment

Choose a reason for hiding this comment

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

Awesome. Thank you very much.

@chrischdi
Copy link
Contributor

One last nit, the Readme seems not to be happy 🤔

Updated make targets docs
@chrischdi
Copy link
Contributor

Thank you very much for your contribution 👍 If I remember correctly: the first external contribution for a Mercedes Benz repo on GitHub 🎉

@chrischdi chrischdi merged commit 412d937 into mercedes-benz:main Mar 15, 2022
@mehyedes mehyedes deleted the add-helm-chart branch March 15, 2022 18:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants