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

pkg/helm/run.go,pkg/internal/scaffold: helm operator metrics #1482

Merged
merged 6 commits into from
Jun 5, 2019

Conversation

joelanford
Copy link
Member

Description of the change:
Adds controller-runtime metrics to the helm-operator.

Motivation for the change:
Improves observability of helm-operator.

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 23, 2019
Copy link
Member

@lilic lilic left a comment

Choose a reason for hiding this comment

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

lgtm just one question

- apiGroups:
- apps
resources:
- replicasets
Copy link
Member

Choose a reason for hiding this comment

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

Why replicasets here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is necessary for code that moves up the owner reference chain from the pod to figure out which resource to use for the metrics service owner reference. Since our default operator workload kind is Deployment, the code needs to be able to GET both pods and replicasets. Since we end up using the replicaset's owner reference, we don't actually need GET permission on deployments.

Copy link
Contributor

Choose a reason for hiding this comment

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

We already have pods and replicasets listed with the verb * above in Lines 164-184

- apiGroups:
  - ""
  resources:
  - pods
...
  verbs:
  - "*"
- apiGroups:
  - apps
  resources:
  - deployments
  - daemonsets
  - replicasets
  - statefulsets
  verbs:
  - "*"

Those are the general default rules and these ones are specific to allowing metrics to be exposed. Do you think it's worth adding a comment in the scaffold so it's obvious to the user why we've repeated the rules for pods and replicasets?

Copy link
Member Author

Choose a reason for hiding this comment

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

This would be nice. Lili asked this same question when we introduced the initial helm role generation. I looked into it and it turns out it isn't straigtforward since we unmarshal and remarshal the YAML (thus losing the comments) to update the role for CRD APIs.

Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

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

/lgtm

after one question

internal/pkg/scaffold/helm/role.go Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2019
@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 4, 2019
Copy link
Member

@lilic lilic left a comment

Choose a reason for hiding this comment

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

Maybe add a mention in the CHANGELOG that helm now comes with metrics by default. I would also amend the docs to mention that, but that is fine in a later PR as well.

still lgtm

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 4, 2019
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 4, 2019
Copy link
Contributor

@hasbro17 hasbro17 left a comment

Choose a reason for hiding this comment

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

LGTM

@joelanford joelanford merged commit ed57559 into operator-framework:master Jun 5, 2019
@joelanford joelanford deleted the helm-metrics branch June 5, 2019 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants