-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
add useExistingRole option - to support running in specific namespace… #1325
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Welcome @KlavsKlavsen! |
CLA signed |
/assign @mrueg @KlavsKlavsen you need to push an empty commit to validate the CLA again, I believe the command is gone now to revalidate. Thanks for the PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution and apologies it takes so long to get this change in.
Rebased - ready for merge.. ? |
/approve |
@mrueg only missing an /lgtm label CI says ? |
/hold Lets please wait for CI to be fully resolved before merging this.
|
The fix has been merged 6 days ago.. Hows the "simple PR" going? it seems to be stalled. |
@KlavsKlavsen during this time of the year, please be aware that responses might take longer. |
@KlavsKlavsen the PR isn't the problem, it's test infra that needs to remove required checks from the gh-pages branch. I'm not a repo admin so the feedback loop is slower - and much slower right now because repo maintainers are away over the holidays (as they should be!) 😃 If this PR were merged before that is resolved, it would not create a chart release. Backfilling that release would then have to be a manual process - more annoying and confusing to end users than just waiting to merge the PR. Hope that helps explain it. Happy new year! Looking forward to resolving this soon. |
@scottrigby Hi Scott and a good new year to you :) - I see version of chart has been updated.. Is everything in place for merging this, or ? |
@KlavsKlavsen Not yet. @tariq1890 and I are trying to schedule a collab session. I would think we will find a time for this very soon. Feel free to also follow along or join in Slack chat: https://kubernetes.slack.com/archives/CJJ529RUY/p1609938365003800 |
The chart github release was already created, but due to a k8s infra ci issue the index could not be pushed to gh-pages branch. See: - kubernetes/test-infra#20426 - kubernetes#1345 - kubernetes#1342 - kubernetes#1325 (comment) Signed-off-by: Scott Rigby <scott@r6by.com>
Unblocked by kubernetes/test-infra#20426 Fixes: kubernetes#1342 Reverts kubernetes#1345 Unblocks kubernetes#1325 See kubernetes#1325 (comment) Signed-off-by: Scott Rigby <scott@r6by.com>
@@ -0,0 +1,27 @@ | |||
{{- if and (eq .Values.rbac.create true) (eq .Values.rbac.useClusterRole false) -}} | |||
{{- range (split "," $.Values.namespace) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the range makes sense over here. I see that the {{- end -}}
is placed correctly. I am just confused by the range block used in role.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The range block in role - is because a Clusterrole must be ONLY once.. But when operating on only a few namespaces - each must have the relevant role.. so there must be a role per namespace we operate on (as it's NOT a ClusterRole - it only affects the individual namespace and lives within it).
I hope that makes it clearer :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and there USED to be a clusterrole.yaml and a role.yaml- but I was asked to merge the two - as they were 99% identical.
@KlavsKlavsen You have my sincere apologies for making you wait for this PR for so long. But I am afraid that we can only merge this PR once we go live with The reason is that As a frequent user of helm charts myself, I feel it's in the best interest of open source users and maintainers to make the helm charts have the same cadence as that of the binary. In light of this, I think we should merge and publish this change only when kube-state-metrics v2 is released. |
{{- if .Values.rbac.create -}} | ||
{{- if and (eq $.Values.rbac.create true) (not .Values.rbac.useExistingRole) -}} | ||
{{- if eq .Values.rbac.useClusterRole false }} | ||
{{- range (split "," $.Values.namespace) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{- range (split "," $.Values.namespace) }} | |
{{- range (split "," $.Values.namespaces) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @tariq1890 @KlavsKlavsen , i think this suggested change may have been accidentally missed.
may i know if the chart is going to use namespaces moving forward? a little confusing as the values.yaml specified use of namespaces
(field used in rolebinding.yaml
) but this role.yaml
template is expecting namespace
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are absolutely correct Jianhao. (namespace was before 2.0 - its called namespaces in 2.0+). This chart has since been moved to https://github.com/prometheus-community/helm-charts/blob/d6ae19c6bb7089bd0080952ca6f98b68177e3dcb/charts/kube-state-metrics/templates/role.yaml#L3 - where it still lists namespace instead of namespaces - even though it has moved to 2.0.
@@ -0,0 +1,27 @@ | |||
{{- if and (eq .Values.rbac.create true) (eq .Values.rbac.useClusterRole false) -}} | |||
{{- range (split "," $.Values.namespace) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{- range (split "," $.Values.namespace) }} | |
{{- range (split "," $.Values.namespaces) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KlavsKlavsen You have my sincere apologies for making you wait for this PR for so long. But I am afraid that we can only merge this PR once we go live with
kube-state-metrics v2.0
(correct me if I am mistaken @mrueg ).The reason is that
.Values.namespace
is intended to be a single value field. We need to use the--namespaces
field and that change has been made only in v2.0.As a frequent user of helm charts myself, I feel it's in the best interest of open source users and maintainers to make the helm charts have the same cadence as that of the binary. In light of this, I think we should merge and publish this change only when kube-state-metrics v2 is released.
Let's keep this change on ksm-v1.9.x to be able to move forward and integrate it. I'm tracking v2 changes in
#1358
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In upstream 1.9 branch - the docs says: --namespace string Comma-separated list of namespaces to be enabled. Defaults to ""
So it has the exact same use for kube-state-metrics in 1.9.x as it has in 2.x - its just gotten an extra s for clarification.
So I'm not quite sure what you're referring to here, namespace also in 1.9.x supported multiple namespaces. ?
In upstream 1.9 branch - the docs says: So it has the exact same use for kube-state-metrics in 1.9.x as it has in 2.x - its just gotten an extra s for clarification. So I'm not quite sure what you're referring to here ? |
@KlavsKlavsen Thanks for the quick turnaround, can you remove 22057b4 (we release this for ksm-v1.x) and I'll make sure to get it merged immediately. |
reverted the change to support 2.x. I'll gladly submit a PR for 2.x with that small commit if you like.. I don't know where you keep the 2.x kube-state-metrics version of the chart though and how you want it.. :) |
@KlavsKlavsen I meant removing the commit, not reverting. While at it, can you stash the commits into a single one? Thanks! |
Squashed all commits into one :) |
in specific namespaces only when user has no access to entire cluster (like in typical OpenShift environments). Signed-off-by: Klavs Klavsen <klavs@enableit.dk>
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: KlavsKlavsen, mrueg 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 |
Unblocked by kubernetes/test-infra#20426 Fixes: kubernetes/kube-state-metrics#1342 Reverts kubernetes/kube-state-metrics#1345 Unblocks kubernetes/kube-state-metrics#1325 See kubernetes/kube-state-metrics#1325 (comment) Signed-off-by: Scott Rigby <scott@r6by.com>
Unblocked by kubernetes/test-infra#20426 Fixes: kubernetes/kube-state-metrics#1342 Reverts kubernetes/kube-state-metrics#1345 Unblocks kubernetes/kube-state-metrics#1325 See kubernetes/kube-state-metrics#1325 (comment) Signed-off-by: Scott Rigby <scott@r6by.com>
Unblocked by kubernetes/test-infra#20426 Fixes: kubernetes/kube-state-metrics#1342 Reverts kubernetes/kube-state-metrics#1345 Unblocks kubernetes/kube-state-metrics#1325 See kubernetes/kube-state-metrics#1325 (comment) Signed-off-by: Scott Rigby <scott@r6by.com> Signed-off-by: Thor Anker Kvisgård Lange <tal@netic.dk>
Unblocked by kubernetes/test-infra#20426 Fixes: kubernetes/kube-state-metrics#1342 Reverts kubernetes/kube-state-metrics#1345 Unblocks kubernetes/kube-state-metrics#1325 See kubernetes/kube-state-metrics#1325 (comment) Signed-off-by: Scott Rigby <scott@r6by.com> Signed-off-by: QuentinBisson <quentin@giantswarm.io>
Unblocked by kubernetes/test-infra#20426 Fixes: kubernetes/kube-state-metrics#1342 Reverts kubernetes/kube-state-metrics#1345 Unblocks kubernetes/kube-state-metrics#1325 See kubernetes/kube-state-metrics#1325 (comment) Signed-off-by: Scott Rigby <scott@r6by.com>
…s without needing clusteradmin privs
This is a repost of helm/charts#23953
This adds support for running on kubernetes setups (such as is typical in openshift) where you only have access to your own namespaces.
I've gotten this support merged in both Prometheus and Grafana charts and
I'd really like to get it in this last chart I use for our Prometheus setup ;)