mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #59686 from nicksardo/gce-roles
Automatic merge from submit-queue (batch tested with PRs 59683, 59964, 59841, 59936, 59686). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. GCE: Create cloud-provider roles and bindings via addons **What this PR does / why we need it**: This removes the `cloud-provider` role and role binding from the rbac boostrapper and replaces it with a policy applied via addon mgr. This also creates a new clusterrole allowing the service account to create events for any namespace. **Special notes for your reviewer**: /assign @bowei @timstclair /cc timstclair **Release note**: ```release-note GCE: A role and clusterrole will now be provided with GCE/GKE for allowing the cloud-provider to post warning events on all services and watching configmaps in the kube-system namespace. ```
This commit is contained in:
commit
3a60b0b4f2
30
cluster/gce/addons/loadbalancing/cloud-provider-binding.yaml
Normal file
30
cluster/gce/addons/loadbalancing/cloud-provider-binding.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
|
name: cloud-provider
|
||||||
|
namespace: kube-system
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: cloud-provider
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: cloud-provider
|
||||||
|
namespace: kube-system
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
|
name: cloud-provider
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: cloud-provider
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: cloud-provider
|
||||||
|
namespace: kube-system
|
35
cluster/gce/addons/loadbalancing/cloud-provider-role.yaml
Normal file
35
cluster/gce/addons/loadbalancing/cloud-provider-role.yaml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
|
name: cloud-provider
|
||||||
|
namespace: kube-system
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- configmaps
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- get
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
|
name: cloud-provider
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- events
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- patch
|
||||||
|
- update
|
@ -2250,8 +2250,11 @@ function start-image-puller {
|
|||||||
/etc/kubernetes/manifests/
|
/etc/kubernetes/manifests/
|
||||||
}
|
}
|
||||||
|
|
||||||
# Starts a l7 loadbalancing controller for ingress.
|
# Setups manifests for ingress controller and gce-specific policies for service controller.
|
||||||
function start-lb-controller {
|
function start-lb-controller {
|
||||||
|
setup-addon-manifests "addons" "loadbalancing"
|
||||||
|
|
||||||
|
# Starts a l7 loadbalancing controller for ingress.
|
||||||
if [[ "${ENABLE_L7_LOADBALANCING:-}" == "glbc" ]]; then
|
if [[ "${ENABLE_L7_LOADBALANCING:-}" == "glbc" ]]; then
|
||||||
echo "Start GCE L7 pod"
|
echo "Start GCE L7 pod"
|
||||||
prepare-log-file /var/log/glbc.log
|
prepare-log-file /var/log/glbc.log
|
||||||
|
Loading…
Reference in New Issue
Block a user