Skip to content

Commit

Permalink
rbac: Use kubevirt-infra
Browse files Browse the repository at this point in the history
The cluster-admin rol is needed on all (somehow) privileged pods.
This I merged the kubevirt and kubevirt-admin ServiceAccounts into a single
one (kubevirt-ifnra) which can be used by all kubevirt infrastructure components
which require some privileges.
Once KubeVirt becomes more stable we can make this more fine granular.

Signed-off-by: Fabian Deutsch <[email protected]>
  • Loading branch information
fabiand committed Sep 8, 2017
1 parent a40a965 commit 688a91f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion manifests/haproxy.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
labels:
app: haproxy
spec:
serviceAccountName: kubevirt-admin
serviceAccountName: kubevirt-infra
containers:
- name: haproxy
image: {{ docker_prefix }}/haproxy:{{ docker_tag }}
Expand Down
1 change: 1 addition & 0 deletions manifests/iscsi-demo-target.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ spec:
app: iscsi-demo-target
name: iscsi-demo-target-tgtd
spec:
serviceAccountName: kubevirt-infra
containers:
- name: target
image: {{ docker_prefix }}/iscsi-demo-target-tgtd:{{ docker_tag }}
Expand Down
1 change: 1 addition & 0 deletions manifests/libvirt.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ spec:
labels:
daemon: libvirt
spec:
serviceAccountName: kubevirt-infra
hostNetwork: true
hostPID: true
hostIPC: true
Expand Down
16 changes: 8 additions & 8 deletions manifests/rbac.authorization.k8s.io.yaml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: kubevirt
name: kubevirt-infra
labels:
name: kubevirt
rules:
Expand Down Expand Up @@ -42,7 +42,7 @@ rules:
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubevirt
name: kubevirt-infra
labels:
name: kubevirt
---
Expand All @@ -56,29 +56,29 @@ metadata:
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kubevirt
name: kubevirt-infra
labels:
name: kubevirt
roleRef:
kind: ClusterRole
name: kubevirt
name: kubevirt-infra
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: kubevirt
name: kubevirt-infra
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kubevirt-admin
name: kubevirt-infra-cluster-admin
labels:
name: kubevirt-admin
name: kubevirt
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: kubevirt-admin
name: kubevirt-infra
namespace: default
2 changes: 1 addition & 1 deletion manifests/virt-api.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
labels:
app: virt-api
spec:
serviceAccountName: kubevirt
serviceAccountName: kubevirt-infra
containers:
- name: virt-api
image: {{ docker_prefix }}/virt-api:{{ docker_tag }}
Expand Down
2 changes: 1 addition & 1 deletion manifests/virt-controller.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
labels:
app: virt-controller
spec:
serviceAccountName: kubevirt
serviceAccountName: kubevirt-infra
containers:
- name: virt-controller
image: {{ docker_prefix }}/virt-controller:{{ docker_tag }}
Expand Down
1 change: 1 addition & 0 deletions manifests/virt-handler.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ spec:
labels:
daemon: virt-handler
spec:
serviceAccountName: kubevirt-infra
hostPID: true
containers:
- name: virt-handler
Expand Down

0 comments on commit 688a91f

Please sign in to comment.