-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Support Kubelet --authorization-mode=Webhook #5176
Comments
The remedy for kubelet is to switch to scrape metrics from https to http port which does not requires authorization (for Regarding the
source: #3891 (comment) |
Thanks @krogon , switching to http fixed prometheus for now. |
@jeyglk Also you can pass configuration argument to kubelet |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale I've found that I still have to bind the appropriate I'm using the following config for kubelet: kubelet:
anonymousAuth: false
authenticationTokenWebhook: true
authorizationMode: Webhook kops version 1.10.0. I think it would make sense to just bind |
same as you @devyn I'm using the following configuration: kubelet:
anonymousAuth: false
authorizationMode: Webhook
authenticationTokenWebhook: true together with kube-prometheus. I have the $ kubectl get clusterrole system:kubelet-api-admin -o yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
creationTimestamp: 2018-12-13T10:45:49Z
labels:
kubernetes.io/bootstrapping: rbac-defaults
name: system:kubelet-api-admin
resourceVersion: "60"
selfLink: /apis/rbac.authorization.k8s.io/v1/clusterroles/system%3Akubelet-api-admin
uid: 40f9fe23-fec4-11e8-bad8-0ed9e9ae5b3c
rules:
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes
verbs:
- proxy
- apiGroups:
- ""
resources:
- nodes/log
- nodes/metrics
- nodes/proxy
- nodes/spec
- nodes/stats
verbs:
- '*' however when I try to proxy like this I get an error: $ kubectl port-forward svc/grafana 3000 \
error: error upgrading connection: unable to upgrade connection: Forbidden (user=kubelet-api, verb=create, resource=nodes, subresource=proxy) |
@mazzy89 You're close, you also need a ClusterRoleBinding. Here's what I use to get logs/exec to work:
|
I had to simply add the |
a bit off kilter here, but kops 1.11 recommends to set |
@jurgenweber : I'm not sure there is a good way to audit anon access. That was one of the things that was mentioned in relation to the CVE that prompted the recommendation to disable anon auth, was that there was little visibility into what might have exploited it. Main impact as I saw was around metrics-server's API aggregation needing to authenticate, and the need to enable this webhook auth mode, and related RBAC stuff which I think the metrics-server helm chart now incorporates. |
@jhohertz Could you please to share what exactly related RBAC have you added ? I also meet this problem with metrics-server. Thanks. Best Regards, |
@vietwow: So there were two bits done... one was adding this (as seen in chart now): https://github.com/helm/charts/blob/master/stable/metrics-server/templates/aggregated-metrics-reader-cluster-role.yaml And the other was to give kubelet-api access, per: https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet-authentication-authorization/
|
The initial request for the /close |
@rdrgmnzs: Closing this issue. In response to this:
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. |
The ability to set --authorization-mode=Webhook for kubelet in the cluster specs.
Currently, setting
anonymous-auth=false
for kubelet switches it to cert auth. We need--authorization-mode=Webhook
in order to allow serviceaccount tokens to communicate with kubelet.This would for example fix the Prometheus kubelet exporter, which currently returns
server returned HTTP status 401 Unauthorized
on a Kops cluster withanonymous-auth=false
.I see there is already a flag for this https://github.com/kubernetes/kops/blob/release-1.9/pkg/apis/kops/componentconfig.go#L28
But this is not really supported by kops yet, many things would break.
The text was updated successfully, but these errors were encountered: