Skip to content

Commit 45fe37e

Browse files
authored
Revise YAML examples for runner pod configuration (#56820)
1 parent 05d7903 commit 45fe37e

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

content/actions/tutorials/actions-runner-controller/troubleshooting-actions-runner-controller-errors.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,31 +120,32 @@ To fix this, you can do one of the following things.
120120
* Use a volume type that supports `securityContext.fsGroup`. `hostPath` volumes do not support this property, whereas `local` volumes and other types of volumes do support it. Update the `fsGroup` of your runner pod to match the GID of the runner. You can do this by updating the `gha-runner-scale-set` helm chart values to include the following. Replace `VERSION` with the version of the `actions-runner` container image you want to use.
121121

122122
```yaml copy
123-
spec:
123+
template:
124+
spec:
124125
securityContext:
125-
fsGroup: 123
126+
fsGroup: 123
126127
containers:
127-
- name: runner
128-
image: ghcr.io/actions/actions-runner:latest
129-
command: ["/home/runner/run.sh"]
128+
- name: runner
129+
image: ghcr.io/actions/actions-runner:latest
130+
command: ["/home/runner/run.sh"]
130131
```
131132
132133
* If updating the `securityContext` of your runner pod is not a viable solution, you can work around the issue by using `initContainers` to change the mounted volume's ownership, as follows.
133134

134135
```yaml copy
135136
template:
136-
spec:
137+
spec:
137138
initContainers:
138-
- name: kube-init
139-
image: ghcr.io/actions/actions-runner:latest
140-
command: ["sudo", "chown", "-R", "1001:123", "/home/runner/_work"]
139+
- name: kube-init
140+
image: ghcr.io/actions/actions-runner:latest
141+
command: ["sudo", "chown", "-R", "1001:123", "/home/runner/_work"]
141142
volumeMounts:
142-
- name: work
143+
- name: work
143144
mountPath: /home/runner/_work
144145
containers:
145-
- name: runner
146-
image: ghcr.io/actions/actions-runner:latest
147-
command: ["/home/runner/run.sh"]
146+
- name: runner
147+
image: ghcr.io/actions/actions-runner:latest
148+
command: ["/home/runner/run.sh"]
148149
```
149150

150151
## Error: `failed to get access token for {% data variables.product.prodname_github_app %} auth: 401 Unauthorized`

0 commit comments

Comments
 (0)