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

Move Prometheus as an Add-On #4362

Merged
merged 54 commits into from
Jul 9, 2020
Merged

Move Prometheus as an Add-On #4362

merged 54 commits into from
Jul 9, 2020

Conversation

Pothulapati
Copy link
Contributor

@Pothulapati Pothulapati commented May 8, 2020

Fixes #3590, #3406
Implements first part of linkerd/rfc#16, #4375

This PR moves Prometheus as a add-on, thus making it optional but enabled by default. The main benefit of this work is to make linkerd-prometheus more configurable, and allow it to have its own life-cycle for upgrades, configuration, etc.

This work will be followed by documentation that help users configure existing Prometheus to work with Linkerd.

Changes Include:

  • moving prometheus manifests into a separate chart at charts/add-ons/prometheus, and adding it as a dependency to linkerd2
  • implement the addOn interface to support the same with CLI.
  • include configuration in linkerd-config-addons

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

Looking good 👍

Can I ask you to make a parent issue, besides the couple of issues already referenced, with a list of checkboxes for the specific things that will be addressed in separate PRs? So that we can keep track of other things like the health checks, the extra validations the helm chart will require (discussed in the RFC), documentation, test plan issue, etc. And then that issue can be the main one that the RFC will link to. Makes sense?

I'll be thoroughly testing this tomorrow 😉

@@ -34,7 +29,6 @@ data:
static_configs:
- targets: ['localhost:9090']

{{ if .Values.grafana.enabled -}}
Copy link
Member

Choose a reason for hiding this comment

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

Why the removal of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alpeb As grafana is a separate add-on, and those fields are only propagated into their sub-chart. We can't get this value in Prometheus add-on.

I don't think prometheus would have any problem regarding the scrape-config even when there is no grafana, but I will test this out!

For other fields that would need to be accessed across multiple add-ons, we can use the global and have that in linkerd-config-addons!

charts/add-ons/prometheus/templates/prometheus.yaml Outdated Show resolved Hide resolved
cli/cmd/install_addon_test.go Outdated Show resolved Hide resolved
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
@Pothulapati
Copy link
Contributor Author

This PR also has the following additional changes:

  • prometheusImage and prometheusLogLevel flags have been removed as when these flags are set we would essentially want to set prometheus. fields which in the default case are not present as those fields are commented out in values.yaml and defaults are in prometheus/values.yaml and would cause additional complexity to create an append. This is not worth in my opinion as users can now set these values in prometheus.image and promtehus.args.log.level through the addon-config file.

@@ -92,7 +93,6 @@ webhookFailurePolicy: Ignore

# controller configuration
controllerImage: gcr.io/linkerd-io/controller
controllerLogLevel: &controller_log_level info
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alpeb Though we moved this flag to be global like we should, but we don't actually have a way to use this directly in prometheus/values.yaml as we can't template values there. and putting that in the templates directly means that we don't have a way to merge them and appending might cause prometheus to complain just like it did with other values in configmap (I will try this out today)

@olix0r olix0r changed the base branch from master to main June 24, 2020 18:39
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
@alpeb
Copy link
Member

alpeb commented Jun 25, 2020

Thanks @Pothulapati for the extended explanations 🙂

According to my understanding on how this should work, I suggest we remove the commented properties in charts/linkerd2/values.yaml under the prometheus section, since that's not the place to override them (also avoiding the extra work for us to keep them in sync with charts/add-ons/prometheus/values.yaml). And instead put a comment like this one before that section:

# This add-on's default property values are declared in `charts/add-ons/prometheus/values.yaml`.
# If installing/upgrading with Helm, you can override them through the usual `--set` or `-f` flags.
# Do not override them in this file!
# If installing/upgrading with linkerd's CLI, use the `--addon-config` flag.

And a comment like this in the header of charts/add-ons/prometheus/values.yaml:

# These are the default properties for this add-on.
# If installing/upgrading with Helm, you can override them through the usual `--set` or `-f` flags.
# Do not override them in this file!
# If installing/upgrading with linkerd's CLI, use the `--addon-config` flag.

Does that makes sense?

@Pothulapati
Copy link
Contributor Author

@alpeb I was thinking that with Helm, when users want to overwrite they would use linkerd2/values.yaml and not add-on specific values.yaml. As the configuration into linkerd-config-addons is taken from linkerd2//values.yaml

This way they still get

  • Checks, etc that depend on the configuration present in linkerd-config-addons
  • Upgrades, etc would still work as its still values.yaml and helm would re-use that and hence provide the same helm upgrade semantics with that of

@alpeb
Copy link
Member

alpeb commented Jun 26, 2020

Ok cool. So the only thing we have to say is to not touch the charts/add-ons/prometheus/values.yaml file?

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
@Pothulapati
Copy link
Contributor Author

@alpeb Yep, Updated /prometheus/values.yaml accordingly.

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
@alpeb
Copy link
Member

alpeb commented Jun 30, 2020

@Pothulapati would you check the behavior of linkerd upgrade --addon-overwrite? I installed using a custom prom config passed with --addon-config but then linkerd upgrade --addon-overwrite isn't resetting to the default values...

Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

It seems I had done a linkerd upgrade --addon-overwrite while at the same time changing something inside the main values.yaml, so that's the change I was seeing in linkerd-config-addons. So it's working as expected 👍
I did a round of tests with CLI and Helm for installs and upgrade, and it all seems correct to me 👍

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
files accordingly to include more

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

The addon-related changes still look good to me 👍

#4724 addresses the linkerd check changes required when the addon is disabled. There are still lots of other places that fail without it (heartbeat, dashboard (when accessed, the controller pod dies), smi-metrics, CLI commands).

What do you think about addressing the non-prometheus scenario in all those places before tackling the customized prom url case and the "addonification" of the other components? That way we don't leave that failed case open in the upcoming edges for too long. Definitely in a separate PR, so we can merge this one and move on.

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
@Pothulapati Pothulapati merged commit 2a099cb into main Jul 9, 2020
@Pothulapati Pothulapati deleted the tarun/prom-addon branch July 9, 2020 17:59
han-so1omon pushed a commit to han-so1omon/linkerd2 that referenced this pull request Jul 15, 2020
This moves Prometheus as a add-on, thus making it optional but enabled by default. The also make `linkerd-prometheus` more configurable, and allow it to have its own life-cycle for upgrades, configuration, etc.

This work will be followed by documentation that help users configure existing Prometheus to work with Linkerd.

**Changes Include:**
- moving prometheus manifests into a separate chart at `charts/add-ons/prometheus`, and adding it as a dependency to `linkerd2`
- implement the `addOn` interface to support the same with CLI.
- include configuration in `linkerd-config-addons`

**User Facing Changes:**
The default install experience does not change much but for users who have already configured Prometheus differently, would need to apply the same using the new configuration fields present in chart README

Signed-off-by: Eric Solomon <errcsool@engineer.com>
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.

Make Prometheus Pluggable
4 participants