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

feat(localenv): local development tooling for PluginDefinition #579

Merged
merged 20 commits into from
Jan 31, 2025

Conversation

abhijith-darshan
Copy link
Contributor

@abhijith-darshan abhijith-darshan commented Jan 16, 2025

Pull Request Details

  • Adds kustomization.yaml at repository root for all PluginDefinition
  • Generates PluginDefinition(s) for local development using kustomize

Other Relevant Information

The root kustomization.yaml can be used by any greenhouse operator developers to easily pull PluginDefinition via kustomize remote links

Example:

resources:
  - https://github.com/cloudoperators/greenhouse-extensions?ref=<branch-name>

This will be an intermediate solution for greenhousectl dev setup .... to provision a full development environment for Operator developers and UI / Dashboard developers

The shell script to generate PluginDefinition in bin/.generated is to ease local development of Plugin developers

This already generates a PluginDefinition where name will point to a local mounted path (Plugin Development HostPathConfig)

The generated resources are ignored and so that the actual plugindefinition.yaml is not altered for local development

Example:

greenhouse-extensions % make generate-kustomization 
test -s /Users/D072950/ccloud/greenhouse/greenhouse-extensions/bin/yq || curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_darwin_arm64 -o /Users/D072950/ccloud/greenhouse/greenhouse-extensions/bin/yq && chmod +x /Users/D072950/ccloud/greenhouse/greenhouse-extensions/bin/yq
hack/generate-kustomization
✅ Successfully generated bin/.generated/kustomization.yaml!

Generated files Screenshot -

image

Note

There is currently a slight mismatch in the exposed-services. The file name is exposed-service.yaml but in kustomization.yaml it is exposed-services.yaml, you need to edit it by removing the s at the end

.spec.helmChart.name will not be accurate as many plugins have versioned chart folders. Please make the necessary path changes before applying to your local cluster

Now you can apply the generated local dev PluginDefinition

greenhouse-extensions % kubectl apply -k bin/.generated
plugindefinition.greenhouse.sap/alerts created
plugindefinition.greenhouse.sap/cert-manager created
plugindefinition.greenhouse.sap/exposed-service created
plugindefinition.greenhouse.sap/external-dns created
plugindefinition.greenhouse.sap/github-guard created
plugindefinition.greenhouse.sap/ingress-nginx created
plugindefinition.greenhouse.sap/kube-monitoring created
plugindefinition.greenhouse.sap/openbao created
plugindefinition.greenhouse.sap/opentelemetry created
plugindefinition.greenhouse.sap/perses created
plugindefinition.greenhouse.sap/plutono created
plugindefinition.greenhouse.sap/service-proxy unchanged
plugindefinition.greenhouse.sap/teams2slack created
plugindefinition.greenhouse.sap/thanos created

@abhijith-darshan abhijith-darshan requested review from a team as code owners January 16, 2025 14:14
kengou
kengou previously requested changes Jan 16, 2025
Makefile Outdated Show resolved Hide resolved
@kengou kengou self-requested a review January 16, 2025 20:06
Makefile Show resolved Hide resolved
Co-authored-by: David Gogl <[email protected]>
@richardtief richardtief requested a review from a team January 17, 2025 09:08
Makefile Outdated Show resolved Hide resolved
Copy link
Contributor

@ibakshay ibakshay 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 very much. I have tested locally and it looks great already 🚀 I have left a minor comment.

Copy link
Contributor

@viennaa viennaa left a comment

Choose a reason for hiding this comment

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

Thanks for providing this helper.

Please add some documentation on how to use it.

Makefile Outdated Show resolved Hide resolved
Co-authored-by: Akshay Iyyadurai Balasundaram <[email protected]>
@abhijith-darshan
Copy link
Contributor Author

Thanks for providing this helper.

Please add some documentation on how to use it.

@viennaa if it’s fine i can add a readme in docs folder 📂

@viennaa
Copy link
Contributor

viennaa commented Jan 24, 2025

@viennaa if it’s fine i can add a readme in docs folder 📂

I would add a little section to the existing README and point to the docs, if you want to put the main doc there.

@abhijith-darshan abhijith-darshan requested a review from a team as a code owner January 30, 2025 16:38
@abhijith-darshan
Copy link
Contributor Author

@viennaa if it’s fine i can add a readme in docs folder 📂

I would add a little section to the existing README and point to the docs, if you want to put the main doc there.

done

Copy link
Contributor

@ibakshay ibakshay left a comment

Choose a reason for hiding this comment

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

Thanks a lot! LGTM 🚀🚀

Copy link
Member

@richardtief richardtief left a comment

Choose a reason for hiding this comment

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

Very good work. Thanks

@abhijith-darshan abhijith-darshan dismissed stale reviews from viennaa and kengou January 31, 2025 12:21

implemented

@abhijith-darshan abhijith-darshan merged commit 3ac8e07 into main Jan 31, 2025
4 checks passed
@abhijith-darshan abhijith-darshan deleted the plugindefinition/tooling branch January 31, 2025 12:33
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.

6 participants