metrics-server icon indicating copy to clipboard operation
metrics-server copied to clipboard

Minimize RBAC permissions

Open CrisNevares opened this issue 2 years ago • 25 comments

Merge changes by @serathius for #851 into helm chart's clusterrole.yaml

What this PR does / why we need it: Minimize the RBAC permissions of the system:metrics-server clusterrole when installing with the provided helm chart.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Completes #851

CrisNevares avatar Jun 09 '22 18:06 CrisNevares

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: CrisNevares (07d1d48b872bdff2e67c330ad6ff109702c952d8)

Welcome @CrisNevares!

It looks like this is your first PR to kubernetes-sigs/metrics-server 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/metrics-server has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Jun 09 '22 18:06 k8s-ci-robot

Hi @CrisNevares. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

k8s-ci-robot avatar Jun 09 '22 18:06 k8s-ci-robot

/retest

yangjunmyfm192085 avatar Jun 10 '22 00:06 yangjunmyfm192085

/retest

stevehipwell avatar Jun 10 '22 08:06 stevehipwell

Hmm, I think removing configmap permission might break deploying MS in different namespaces. Can't find the issue that was reported, but I remember some strange case where depending whether MS is deployed in kube-system vs any other namespaces it required different RBAC.

/hold Unitl we have confirmation.

serathius avatar Jun 10 '22 09:06 serathius

Hmm, I think removing configmap permission might break deploying MS in different namespaces. Can't find the issue that was reported, but I remember some strange case where depending whether MS is deployed in kube-system vs any other namespaces it required different RBAC.

/hold Unitl we have confirmation.

hmm @serathius Is PR #1019 the issue you're thinking of?

CrisNevares avatar Jun 10 '22 16:06 CrisNevares

Yes

serathius avatar Jun 12 '22 21:06 serathius

While I would agree that minimizing permissions is a good idea in general, I actually don't see any big reason to remove "configmap" completely. If metrics-server is installed in kube-system it already has much more permissions, for example querying every configmap in the kube-system namespace. For me it is much worse.

I would say leave "configmap" permission and lock it down to the needed configs, like "extension-apiserver-authentication::client-ca-file" retrieval.

ViliusS avatar Aug 02 '22 20:08 ViliusS

/remove-approve

stevehipwell avatar Aug 05 '22 16:08 stevehipwell

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: CrisNevares Once this PR has been reviewed and has the lgtm label, please ask for approval from stevehipwell by writing /assign @stevehipwell in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 avatar Aug 05 '22 16:08 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 05 '22 13:11 k8s-triage-robot

/remove-lifecycle stale

ViliusS avatar Nov 05 '22 16:11 ViliusS

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Feb 03 '23 17:02 k8s-triage-robot

/remove-lifecycle stale

ViliusS avatar Feb 03 '23 17:02 ViliusS

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar May 04 '23 18:05 k8s-triage-robot

/remove-lifecycle stale

ViliusS avatar May 04 '23 18:05 ViliusS

@serathius is this still relevant?

cpanato avatar Nov 28 '23 19:11 cpanato

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Feb 26 '24 19:02 k8s-triage-robot

/remove-lifecycle stale

ViliusS avatar Feb 27 '24 17:02 ViliusS

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar May 27 '24 17:05 k8s-triage-robot

/remove-lifecycle stale

ViliusS avatar May 28 '24 06:05 ViliusS

CC @serathius

stevehipwell avatar May 30 '24 10:05 stevehipwell