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

(WIP - TODO Address change agreed on review)✨ (helm/v1alpha): add samples manifests #4314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Nov 10, 2024

Add samples to the helm chart so that consumers and developers can decide if should provide good samples configurations and enable them for the chart be installed within

motivation

The inclusion of sample CRs in Helm charts is motivated by the need to improve user experience and ease of use. By providing default configurations and ready-to-use examples, we reduce the setup time for users, guide them in customizing their CRs, and ensure the Operator is functional right after installation. This approach not only simplifies onboarding but also allows users to quickly verify the Operator’s deployment, making the setup process more intuitive and productive.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 10, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 10, 2024
@camilamacedo86
Copy link
Member Author

Hi, @[monteiro-renato. @mhkarimi1383, @algo7

Could you please help on this review?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 10, 2024
@mhkarimi1383
Copy link

Hi
I think this is not needed specially in production charts

Using helm chart tests is better than this one I think
a simple test than brings up the Operator, then apply manifest and check for events/status

Using that you can test both helm chart and the operator

Add samples to the helm chart so that consumers and developers can decide if should provide good samples configurations and enable them for the chart be installed within
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 10, 2024
@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Nov 10, 2024

Hi @mhkarimi1383

I think this is not needed specially in production charts

Thank you for your input! However, I believe providing samples is beneficial, especially with this feature that encapsulates an Operator into a Helm chart.

Adding sample CRs is considered good practice since it allows authors to include default configurations and helpful examples for customization. Many projects include CR samples during installation so users don’t have to create configurations from scratch. These samples not only simplify onboarding but also serve as a guide for users who may want to customize their CRs.

Without the CRD samples, the Operator won’t perform any actions, so including them ensures that the installation is immediately functional and users have a reference for testing and customization.

So, I am totally in favor of we move forward here.
Anyway, users can always change and customize their own thing
They can create a make target that removes the samples when for example they release or sync the chart again.
However, IMO we should encourage authors to provide the samples.

@mhkarimi1383
Copy link

@camilamacedo86

Nice but I think the better location for examples are in chart NOTES.txt

@damsien
Copy link
Contributor

damsien commented Nov 14, 2024

I think that we must not force the developerd to have the samples section in the values.yaml. Even if we can disable it, if the developer does not provide any samples in the chart (because it is well documented or for any reasons), it is a little bit confusing to have a section that do not make any action.

BUT, I think that it is a very good idea to implement this feature for the reasons you said.

Many projects include CR samples during installation so users don’t have to create configurations from scratch.
However, IMO we should encourage authors to provide the samples.

So, my proposal is to keep this feature and add a section in the documentation (that does not exists yet from what I know but maybe in the future) that explains how to remove this section from the scaffold so it will not be added each time we execute kubebuilder edit --plugins=helm/v1-alpha.

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Nov 14, 2024

Hi @damsien,

I think you might have brought a good idea.
We might have flags for not adding staff on the chart.
In this case, users could see flags for generating a chart without the following, for example.

  • ignore-samples
  • ignore-prometheus
  • ignore-networkPolicy
  • ignore-certmanager
  • ignore-webhook

We can raise an issue after this one gets merged and work on it as a follow-up. WDYT?

Regards:

it will not be added each time we execute kubebuilder edit --plugins=helm/v1-alpha.

It must be added each time that we run the command because the samples are like the CRDs
We must ensure that the chart is synced with the latest changes.

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Nov 14, 2024

Hi @mhkarimi1383

Nice but I think the better location for examples are in chart NOTES.txt

Samples are CR.
I do see it fitting in the Notes.
They can have a default config.
For example, I want a MyDatabase Operator.
Install the Operator will not do anything if I do not create an instance (apply the CR)
The default configuration for MyDatabse Operator would be set in the samples.
That was the idea. I hope that clarifies.

@damsien
Copy link
Contributor

damsien commented Nov 14, 2024

Yes we can raise an issue to implement the ignore- flags!

And concerning this sentence:

it will not be added each time we execute kubebuilder edit --plugins=helm/v1-alpha.

It is in the case where the developer wants to remove the samples section from the values but it is added each time the command is executed since the ignore-samples flag does not exist yet

Can I raise the issue?

@camilamacedo86
Copy link
Member Author

Hi @damsien

It is in the case where the developer wants to remove the samples section from the values but it is added each time the command is executed since the ignore-samples flag does not exist yet

I see. But it is an alpha version and add the flags is not a lot of work
So, we can do that as a follow-up and probably before the next release when it will be shipped.

@damsien
Copy link
Contributor

damsien commented Nov 14, 2024

Yes sure

@mhkarimi1383
Copy link

Hi @mhkarimi1383

Nice but I think the better location for examples are in chart NOTES.txt

Samples are CR.
I do see it fitting in the Notes.
They can have a default config.
For example, I want a MyDatabase Operator.
Install the Operator will not do anything if I do not create an instance (apply the CR)
The default configuration for MyDatabse Operator would be set in the samples.
That was the idea. I hope that clarifies.

I think as a user who installs the operator chart, NOTES will show me after installing the operator, So I will notice samples and any recommendations and so on
Also we could have another chart for CRs (like CloudNativePG), especially useful when we are able to have some CRs related together (also like CloudNativePG:))

@camilamacedo86
Copy link
Member Author

camilamacedo86 commented Nov 14, 2024

Hi @mhkarimi1383,

I think as a user who installs the operator chart, NOTES will show me after installing the operator, So I will notice samples and any recommendations and so on
Also we could have another chart for CRs (like CloudNativePG), especially useful when we are able to have some CRs related together (also like CloudNativePG:))

For it be possible you need move with this PR
Because if we do not users will NOT have the CRs to add the info in the NOTES :-)

An option here is NOT add the samples on the values.yaml.
Is that what are you suggesting?
We move the samples for the samples dir but not add an option in the values?

@mhkarimi1383
Copy link

As users I mean the person who installs the operator to use, not the creator of operator

If I got you correct

@camilamacedo86
Copy link
Member Author

Ji @mhkarimi1383

I see your point.
It might be a good idea.
Just remove the option for the values but sync the samples in the chart !!!
I will change it in this direction :-)

@camilamacedo86 camilamacedo86 changed the title ✨ (helm/v1alpha): add samples manifests (WIP - TODO Address change agreed on review)✨ (helm/v1alpha): add samples manifests Nov 14, 2024
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-blocker size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants