-
Notifications
You must be signed in to change notification settings - Fork 38.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
Remove e2e-rbac-bindings. #46750
Remove e2e-rbac-bindings. #46750
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: heapster-binding | ||
labels: | ||
kubernetes.io/cluster-service: "true" | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: system:heapster | ||
subjects: | ||
- kind: ServiceAccount | ||
name: heapster | ||
namespace: kube-system | ||
--- | ||
# Heapster's pod_nanny monitors the heapster deployment & its pod(s), and scales | ||
# the resources of the deployment if necessary. | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: Role | ||
metadata: | ||
name: system:pod-nanny | ||
namespace: kube-system | ||
labels: | ||
kubernetes.io/cluster-service: "true" | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- "extensions" | ||
resources: | ||
- deployments | ||
verbs: | ||
- get | ||
- update | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: RoleBinding | ||
metadata: | ||
name: heapster-binding | ||
namespace: kube-system | ||
labels: | ||
kubernetes.io/cluster-service: "true" | ||
addonmanager.kubernetes.io/mode: Reconcile | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: system:pod-nanny | ||
subjects: | ||
- kind: ServiceAccount | ||
name: heapster | ||
namespace: kube-system | ||
--- |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1126,8 +1126,8 @@ function start-kube-addons { | |
local -r src_dir="${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty" | ||
local -r dst_dir="/etc/kubernetes/addons" | ||
|
||
# prep the additional bindings that are particular to e2e users and groups | ||
setup-addon-manifests "addons" "e2e-rbac-bindings" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this script set up the rbac addon which now contains the replacement kubelet binding? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does now... :) |
||
# prep addition kube-up specific rbac objects | ||
setup-addon-manifests "addons" "rbac" | ||
|
||
# Set up manifests of other addons. | ||
if [[ "${ENABLE_CLUSTER_MONITORING:-}" == "influxdb" ]] || \ | ||
|
@@ -1136,6 +1136,7 @@ function start-kube-addons { | |
[[ "${ENABLE_CLUSTER_MONITORING:-}" == "standalone" ]] || \ | ||
[[ "${ENABLE_CLUSTER_MONITORING:-}" == "googleinfluxdb" ]]; then | ||
local -r file_dir="cluster-monitoring/${ENABLE_CLUSTER_MONITORING}" | ||
setup-addon-manifests "addons" "cluster-monitoring" | ||
setup-addon-manifests "addons" "${file_dir}" | ||
# Replace the salt configurations with variable values. | ||
base_metrics_memory="140Mi" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1481,10 +1481,6 @@ function start-kube-addons { | |
local -r src_dir="${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty" | ||
local -r dst_dir="/etc/kubernetes/addons" | ||
|
||
# TODO(mikedanese): only enable these in e2e | ||
# prep the additional bindings that are particular to e2e users and groups | ||
setup-addon-manifests "addons" "e2e-rbac-bindings" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this line be
as above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind, it was already in this file. |
||
|
||
# prep addition kube-up specific rbac objects | ||
setup-addon-manifests "addons" "rbac" | ||
|
||
|
@@ -1495,6 +1491,7 @@ function start-kube-addons { | |
[[ "${ENABLE_CLUSTER_MONITORING:-}" == "standalone" ]] || \ | ||
[[ "${ENABLE_CLUSTER_MONITORING:-}" == "googleinfluxdb" ]]; then | ||
local -r file_dir="cluster-monitoring/${ENABLE_CLUSTER_MONITORING}" | ||
setup-addon-manifests "addons" "cluster-monitoring" | ||
setup-addon-manifests "addons" "${file_dir}" | ||
# Replace the salt configurations with variable values. | ||
base_metrics_memory="140Mi" | ||
|
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.
heapster only gets pods in the kube-system 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.
I saw the "pod_nanny" (one of heapster's containers) getting the heapster pod from the API.
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 sidecar dynamically resizes the heapster deployment, so it'll also need to do a put/patch on deployments to resize itself.
@Q-Lee
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.
Ya, you need write on deployments.
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.
This seems like a questionable power to grant to a pod. If its given the power to modify its own deployment, then a compromise of a particular pod cannot be resolved by simply deleting the pod since it has been allowed to modify its own config.
In addition, by doing it inside of the kube-system namespace, if you compromise the heapster pod, you will have compromised every deployment, rs, rc, secret, etc in the cluster because it gained the power to change its service account which gave it the power to mount any SA token in the
kube-system
namespace where controller SAs are located.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.
Agree, and since not all installations run the pod nanny, it shouldn't be part of the standard heapster role.
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.
It would be nice if we could assign service accounts to individual pods. I wonder if there's a work around.
Could we create a "heapster-nanny" role, bind it to a service account, and mount the service account's secret where SAs are usually mounted?
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.
All 5 of the supported CLUSTER_MONITORING setups have the pod-nanny running with heapster, and we don't create this role/binding unless one of those is selected.
I renamed that role to system:pod-nanny.
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.
I agree that it is not optimal, but it's better than what currently exists.