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

[DOC] adding prometheus-operator-cli design proposal #6435

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

nicolastakashi
Copy link
Contributor

@nicolastakashi nicolastakashi commented Mar 25, 2024

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

Document Proposal for prometheus-operator-cli
Related to: #6423

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

N/A

@nicolastakashi nicolastakashi requested a review from a team as a code owner March 25, 2024 16:38
@nicolastakashi
Copy link
Contributor Author

nicolastakashi commented Mar 25, 2024

Just for reference I have some draft CLI working on this repository:

Copy link
Member

@ArthurSens ArthurSens 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 changed our approach for new proposals and we're putting everything under Documentation/proposals instead of Documentation/designs. We still have the agent design over there but I think we agreed on moving it some months ago 🤔 Could we also follow the design template? 🙈

But anyway, thanks for starting the proposal! The idea sounds awesome

Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Comment on lines 12 to 15
### Why my Prometheus resource is not being created?

People were struggling to troubleshoot why their Prometheus resources were not being created. They were not sure if the issue was with the Prometheus Operator or with the Prometheus resource itself.
After long investigation, they found out that the Prometheus Operator were only watching the namespace where the Prometheus Operator was deployed, and the Prometheus resource was being created in a different namespace.
Copy link
Member

Choose a reason for hiding this comment

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

If I remember correctly, the problem was not about creating Prometheus resources but correctly configuring them. Creating just a single "Prometheus" resource is fairly simple, but also setting up the right permissions, attaching service accounts, troubleshooting target discovery was not straight forward

Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved

These are just some common issues that users reported, but there are many other issues that users face when managing Prometheus Operator resources, and we believe that a CLI tool can help users to manage Prometheus Operator resources more easily and efficiently.

## Proposal
Copy link
Member

Choose a reason for hiding this comment

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

It's not entirely clear how the CLI (as a kubectl plugin) could help with CI validations 🤔

For CI we don't need the kubernetes cluster context, so I wonder if a kubectl plugin is the best choice here

Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

I'm impatient to experiment with this tool :)

Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/designs/prometheus-operator-cli.md Outdated Show resolved Hide resolved
@nicolastakashi nicolastakashi force-pushed the doc/prometheus-operator-cli branch 2 times, most recently from b5416ca to 902797a Compare April 1, 2024 07:24
@ArthurSens
Copy link
Member

I know we don't have an "official proposal template", but all proposals we have today follow the same structure (documented by the thanos' folks[1])

The template is organized in a way to make sure both the problem and the solution are clear, that we know who are the interested parties, etc. A well-written proposal also attracts more people to contribute in case the current owners eventually fall short on capacity :)

Could we follow the proposal template?

simonpasquier
simonpasquier previously approved these changes Apr 3, 2024
Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Thanks! It's enough for me to get started with the new repository and experiment 👍

Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

Apologies if I'm being too picky 😅

I still think the proposal is confusing, but it's definitely progressing!

Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
Comment on lines 30 to 32
# Pitfalls of the current solution

At the moment people are struggling to manage Prometheus Operator resources, they have to manually create, update, and delete Prometheus Operator resources using `kubectl` or other tools, and troubleshooting and debugging Prometheus Operator resources is challenging.
Copy link
Member

Choose a reason for hiding this comment

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

I think the issues you pointed out above can be explored and explained in this section instead of having subsections under Why.

Troubleshooting Alertmanager, Prometheus and Thanos ruler pod creation is very manual and requires domain knowledge about what RBAC permissions are needed.

Target discovery also requires domain knowledge, understanding label selectors, RBAC permissions, etc.

And we could add links to existing support issues here in Github, StackOverflow, or Slack to show that we have data to back this up.

Copy link
Member

Choose a reason for hiding this comment

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

And what do you think about not adding a subsection for the problems mentioned? I feel like it's an overkill to add very big title just to say 1 paragraph 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ArthurSens could you review?

Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved

### Linting and Validation

Allow users to validate Prometheus Operator resources before creating them, the CLI should check if the resource manifest is valid.
Copy link
Member

Choose a reason for hiding this comment

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

What do you mean by valid? Kubernetes already does validation when applying objects 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The first use case I can see is the validation of the expressions used on rules

Copy link
Contributor

Choose a reason for hiding this comment

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

You can do that on apply as well, no?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not something that the Kube API can do on its own. You need an admission webhook service: https://prometheus-operator.dev/docs/user-guides/webhook/#prometheusrule

Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
@ArthurSens
Copy link
Member

Thanks! It's enough for me to get started with the new repository and experiment 👍

I agree with this part!!! Let's create the repository and play a little bit, but I think we can improve the proposal before merging it

Copy link
Contributor

@xiu xiu left a comment

Choose a reason for hiding this comment

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

Quick review, nothing blocking. Exciting proposal 🎉

Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved

For example, the CLI should allow the creation of a Prometheus object and the related Kubernetes objects such as service account, RBAC, service, pod disruption budget, and other related objects.

### Linting and Validation
Copy link
Contributor

Choose a reason for hiding this comment

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

Is one of the goals to replace po-lint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a fair point!
I think we could review it.
wdyt @simonpasquier @ArthurSens @slashpai ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Funnily enough, #6474 just popped up 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

To the best of my knowledge, po-lint is mostly unmaintained and we don't ship it in the releases page or containre images.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there was a idea to use kubeconform instead of po-lint

@haanhvu
Copy link
Contributor

haanhvu commented Apr 4, 2024

Just a question: In Contribfest, did participants report similar issues to GMP? Whether yes or no, do you know how they solve this problem? Do they solve it with a similar approach like this?

nicolastakashi and others added 17 commits April 12, 2024 08:28
Signed-off-by: Nicolas Takashi <nicolas.tcs@hotmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
ArthurSens
ArthurSens previously approved these changes Apr 12, 2024
Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

Some small nits, but good enough to get started :)

Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
Documentation/proposals/202403-prometheus-operator-cli.md Outdated Show resolved Hide resolved
nicolastakashi and others added 3 commits April 12, 2024 23:12
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
@nicolastakashi
Copy link
Contributor Author

@simonpasquier @slashpai @xiu @ArthurSens could you review it, I think I addressed the comments already.

Copy link
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

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

Let's get it started :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants