Skip to content

Commit 7250bf4

Browse files
authored
Inline Role YAML (#1134)
Since sg/sg is no longer public, the files linked to here no longer exists. For the link at the bottom, I changed it so it points to the public snapshot. There are a lot of files in those folders and I'm not sure if we want to recreate those files somewhere else.
1 parent 5fe6947 commit 7250bf4

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

docs/admin/executors/deploy_executors_kubernetes.mdx

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,48 @@ Executors interact with the Kubernetes API to manage the lifecycle of individual
1313
| `batch` | `jobs` | `create`, `delete` | Executors create Job pods to run processes. Once Jobs are completed, they are cleaned up. |
1414
| | `pods`, `pods/log` | `get`, `list`, `watch` | Executors need to look up and steam logs from the Job Pods. |
1515

16-
See the [example Role YAML](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/blob/cmd/executor/kubernetes/batches/executor-batches.Role.yml) for more details on the exact RBAC requirements for native Kubernetes Executors.
16+
Here's an example Role YAML to demonstrate the RBAC requirements for native Kubernetes Executors:
17+
18+
```yaml
19+
apiVersion: rbac.authorization.k8s.io/v1
20+
kind: Role
21+
metadata:
22+
name: sg-executor-batches-role
23+
namespace: default
24+
rules:
25+
- apiGroups:
26+
- batch
27+
resources:
28+
- jobs
29+
verbs:
30+
- create
31+
- delete
32+
- apiGroups:
33+
- ""
34+
resources:
35+
- pods
36+
- pods/log
37+
verbs:
38+
- get
39+
- list
40+
- watch
41+
# Secrets are required post 5.5, when all pods run a single job
42+
- apiGroups:
43+
- ""
44+
resources:
45+
- secrets
46+
verbs:
47+
- create
48+
- delete
49+
# PVCs are required if KUBERNETES_JOB_VOLUME_TYPE is "pvc"
50+
# - apiGroups:
51+
# - ""
52+
# resources:
53+
# - persistentvolumeclaims
54+
# verbs:
55+
# - create
56+
# - delete
57+
```
1758

1859
## Deployment
1960

@@ -94,5 +135,5 @@ The Executor Docker image is available on Docker Hub at [`sourcegraph/executor-k
94135
### Example Configuration YAML
95136

96137
See
97-
the [local development YAMLs](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@main/-/blob/cmd/executor/kubernetes)
98-
for an example of how to configure the Executor in Kubernetes.
138+
the [local development YAMLs](https://sourcegraph.com/github.com/sourcegraph/sourcegraph-public-snapshot@main/-/blob/cmd/executor/kubernetes)
139+
for an example of how to configure the Executor in Kubernetes.

0 commit comments

Comments
 (0)