Skip to content

Commit 0a9a764

Browse files
committed
Add cluster role binding for coder/kubevirt+talos
1 parent 327af8c commit 0a9a764

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

.sharing.io/init

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ clusterctl init --infrastructure kubevirt
6161
clusterctl init --infrastructure=packet
6262
clusterctl init --bootstrap talos --control-plane talos
6363

64+
# we'll need these extra rolebindings for the coder service account for our template to work
65+
# must be applied after coder helm chart is run and clusterctl init -- talos
66+
kubectl apply -f ./examples/templates/kubevirt-talos/role+rolebinding.yaml
67+
6468
kubectl create ns coder-workspaces
6569

70+
6671
#TODO : upload / update the kubernetes template
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Requires:
2+
# clusterctl init --infrastructure kubevirt
3+
# clusterctl init --bootstrap talos --control-plane talos
4+
# Some are at Cluster Level, some are at the coder namespace level
5+
apiVersion: rbac.authorization.k8s.io/v1
6+
kind: ClusterRole
7+
metadata:
8+
name: coder-clusterapi-perms
9+
rules:
10+
- apiGroups:
11+
- "apiextensions.k8s.io"
12+
resources:
13+
- "customresourcedefinitions"
14+
verbs:
15+
- "list"
16+
- "get"
17+
- apiGroups:
18+
- ""
19+
- "cluster.x-k8s.io"
20+
- "bootstrap.cluster.x-k8s.io"
21+
- "controlplane.cluster.x-k8s.io"
22+
- "infrastructure.cluster.x-k8s.io"
23+
- "addons.cluster.x-k8s.io"
24+
resources:
25+
- "namespaces"
26+
- "configmaps"
27+
- "clusters"
28+
- "machinedeployments"
29+
- "talosconfigtemplates"
30+
- "taloscontrolplanes"
31+
- "kubevirtclusters"
32+
- "kubevirtmachinetemplates"
33+
- "clusterresourcesets"
34+
verbs:
35+
- "list"
36+
- "get"
37+
- "patch"
38+
- "create"
39+
- "delete"
40+
---
41+
apiVersion: rbac.authorization.k8s.io/v1
42+
kind: ClusterRoleBinding
43+
metadata:
44+
name: coder-clusterapi
45+
namespace: coder
46+
roleRef:
47+
apiGroup: rbac.authorization.k8s.io
48+
kind: ClusterRole
49+
name: coder-clusterapi-perms
50+
subjects:
51+
- kind: ServiceAccount
52+
name: coder
53+
namespace: coder
54+
# ---
55+
# apiVersion: rbac.authorization.k8s.io/v1
56+
# kind: Role
57+
# metadata:
58+
# name: coder-clusterapi-perms
59+
# namespace: coder
60+
# rules:
61+
# - apiGroups:
62+
# - ""
63+
# resources:
64+
# - "configmaps"
65+
# verbs:
66+
# - "list"
67+
# - "get"
68+
# ---
69+
# apiVersion: rbac.authorization.k8s.io/v1
70+
# kind: RoleBinding
71+
# metadata:
72+
# name: coder-clusterapi
73+
# namespace: coder
74+
# roleRef:
75+
# apiGroup: rbac.authorization.k8s.io
76+
# kind: Role
77+
# name: coder-clusterapi-perms
78+
# subjects:
79+
# - kind: ServiceAccount
80+
# name: coder
81+
---
82+
apiVersion: rbac.authorization.k8s.io/v1
83+
kind: RoleBinding
84+
metadata:
85+
name: coder-clusterapi-cluster
86+
namespace: coder
87+
roleRef:
88+
apiGroup: rbac.authorization.k8s.io
89+
kind: ClusterRole
90+
name: coder-clusterapi-perms
91+
subjects:
92+
- kind: ServiceAccount
93+
name: coder
94+
namespace: coder

0 commit comments

Comments
 (0)