๋ก๊น
์ปจํธ๋กค๋ฌ, ์์ ๊ธฐ ๋ฐ ์คํ๊ธฐ๋ฅผ ํฌํจํ๋ Actions Runner Controller(ARC) ๋ฆฌ์์ค๋ ํ์ค ์ถ๋ ฅ(stdout
)์ ๋ก๊ทธ๋ฅผ ์๋๋ค. ์ด๋ฌํ ๋ก๊ทธ๋ฅผ ์์งํ๊ณ ์ ์ฅํ๋ ๋ก๊น
์๋ฃจ์
์ ๊ตฌํํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ๋ก๊ทธ๋ฅผ ์ฌ์ฉํ ์ ์์ผ๋ฉด ๋ฌธ์ ํด๊ฒฐ ๋ฐ ๋๋ฒ๊น
์ ํตํด ์ฌ์ฉ์ ๋๋ GitHub๋ฅผ ์ง์ํ ์ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ ๋ก๊น
์ํคํ
์ฒ๋ฅผ ์ฐธ์กฐํ์ธ์.
๋ฆฌ์์ค ๋ ์ด๋ธ
๋ ์ด๋ธ์ ์ปจํธ๋กค๋ฌ, ์์ ๊ธฐ ๋ฐ ์คํ๊ธฐ Pod๋ฅผ ํฌํจํ๋ Actions Runner Controller์์ ๋ง๋ ๋ฆฌ์์ค์ ์ถ๊ฐ๋ฉ๋๋ค. ์ด๋ฌํ ๋ ์ด๋ธ์ ์ฌ์ฉํ์ฌ ๋ฆฌ์์ค๋ฅผ ํํฐ๋งํ๊ณ ๋ฌธ์ ํด๊ฒฐ์ ๋์์ ์ค ์ ์์ต๋๋ค.
์ปจํธ๋กค๋ฌ Pod
์ปจํธ๋กค๋ฌ Pod์ ๋ค์ ๋ ์ด๋ธ์ด ์ ์ฉ๋ฉ๋๋ค.
app.kubernetes.io/component=controller-manager
app.kubernetes.io/instance=<controller installation name>
app.kubernetes.io/name=gha-runner-scale-set-controller
app.kubernetes.io/part-of=gha-runner-scale-set-controller
app.kubernetes.io/version=<chart version>
์์ ๊ธฐ Pod
๋ค์ ๋ ์ด๋ธ์ ์์ ๊ธฐ Pod์ ์ ์ฉ๋ฉ๋๋ค.
actions.github.com/enterprise= # Will be populated if githubConfigUrl is an enterprise URL
actions.github.com/organization= # Will be populated if githubConfigUrl is an organization URL
actions.github.com/repository= # Will be populated if githubConfigUrl is a repository URL
actions.github.com/scale-set-name= # Runners scale set name
actions.github.com/scale-set-namespace= # Runners namespace
app.kubernetes.io/component=runner-scale-set-listener
app.kubernetes.io/part-of=gha-runner-scale-set
app.kubernetes.io/version= # Chart version
์คํ๊ธฐ Pod
๋ค์ ๋ ์ด๋ธ์ ์คํ๊ธฐ Pod์ ์ ์ฉ๋ฉ๋๋ค.
actions-ephemeral-runner= # True | False
actions.github.com/organization= # Will be populated if githubConfigUrl is an organization URL
actions.github.com/scale-set-name= # Runners scale set name
actions.github.com/scale-set-namespace= # Runners namespace
app.kubernetes.io/component=runner
app.kubernetes.io/part-of=gha-runner-scale-set
app.kubernetes.io/version= # Chart version
์ปจํธ๋กค๋ฌ ๋ฐ ์คํ๊ธฐ ์งํฉ ์์ ๊ธฐ์ ๋ก๊ทธ ํ์ธ
๋ค์ ๋ช ๋ น์ ์ฌ์ฉํ๋ฉด ์ปจํธ๋กค๋ฌ Pod์ ๋ก๊ทธ๋ฅผ ํ์ธํ ์ ์์ต๋๋ค.
kubectl logs -n <CONTROLLER_NAMESPACE> -l app.kubernetes.io/name=gha-runner-scale-set-controller
kubectl logs -n <CONTROLLER_NAMESPACE> -l app.kubernetes.io/name=gha-runner-scale-set-controller
๋ค์ ๋ช ๋ น์ ์ฌ์ฉํ๋ฉด ์คํ๊ธฐ ์งํฉ ์์ ๊ธฐ์ ๋ก๊ทธ๋ฅผ ํ์ธํ ์ ์์ต๋๋ค.
kubectl logs -n <CONTROLLER_NAMESPACE> -l auto-scaling-runner-set-namespace=arc-systems -l auto-scaling-runner-set-name=arc-runner-set
kubectl logs -n <CONTROLLER_NAMESPACE> -l auto-scaling-runner-set-namespace=arc-systems -l auto-scaling-runner-set-name=arc-runner-set
master
๋ถ๊ธฐ์ ์ฐจํธ ์ฌ์ฉ
master
๋ถ๊ธฐ ๋์ ์ต์ ๋ฆด๋ฆฌ์ค์ ์ฐจํธ๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค. master
๋ถ๊ธฐ๋ ๋งค์ฐ ๋ถ์์ ํ๋ฉฐ master
๋ถ๊ธฐ์ ์ฐจํธ ๊ฐ ์ง์ ๋ ์๊ฐ์ ์๋ํ๋๋ก ๋ณด์ฅํ ์ ์์ต๋๋ค.
๋ฌธ์ ํด๊ฒฐ: ์์ ๊ธฐ Pod
์ปจํธ๋กค๋ฌ Pod๊ฐ ์คํ ์ค์ด์ง๋ง ์์ ๊ธฐ Pod๊ฐ ์๋ ๊ฒฝ์ฐ ๋จผ์ ์ปจํธ๋กค๋ฌ์ ๋ก๊ทธ๋ฅผ ๊ฒ์ฌํ๊ณ ์ค๋ฅ๊ฐ ์๋์ง ํ์ธํฉ๋๋ค. ์ค๋ฅ๊ฐ ์๊ณ ์คํ๊ธฐ ์งํฉ ์์ ๊ธฐ Pod๊ฐ ์์ง ์คํ๋์ง ์๋ ๊ฒฝ์ฐ ์ปจํธ๋กค๋ฌ Pod๊ฐ ํด๋ฌ์คํฐ์ Kubernetes API ์๋ฒ์ ์ก์ธ์คํ ์ ์๋์ง ํ์ธํฉ๋๋ค.
ํ๋ก์๊ฐ ๊ตฌ์ฑ๋์๊ฑฐ๋ Istio์ ๊ฐ์ด ์๋์ผ๋ก ์ฝ์ ๋๋ ์ฌ์ด๋์นด ํ๋ก์๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ์ปจํธ๋กค๋ฌ ์ปจํ ์ด๋(๊ด๋ฆฌ์)์์ Kubernetes API ์๋ฒ๋ก์ ํธ๋ํฝ์ ํ์ฉํ๋๋ก ๊ตฌ์ฑ๋์๋์ง ํ์ธํฉ๋๋ค.
์๋ ์ค์ผ์ผ๋ง ์คํ๊ธฐ ์งํฉ์ ์ค์นํ์ง๋ง ์์ ๊ธฐ Pod๊ฐ ๋ง๋ค์ด์ง์ง ์์ ๊ฒฝ์ฐ, ์ ๊ณตํ githubConfigSecret
๊ฐ ์ฌ๋ฐ๋ฅธ์ง, ์ ๊ณตํ githubConfigUrl
์ด ์ ํํ์ง ํ์ธํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ GitHub API์ ARC ์ธ์ฆ ๋ฐ Actions Runner Controller๋ฅผ ์ฌ์ฉํ์ฌ ์คํ๊ธฐ ํ์ฅ ์งํฉ ๋ฐฐํฌ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
์ทจ์๋ ์ํฌํ๋ก ์คํ ํ ์คํ๊ธฐ Pod๊ฐ ๋ค์ ๋ง๋ค์ด์ง๋๋ค.
์ํฌํ๋ก ์คํ์ด ์ทจ์๋๋ฉด ๋ค์ ์ด๋ฒคํธ๊ฐ ๋ฐ์ํฉ๋๋ค.
- ์ทจ์ ์ ํธ๋ ์คํ๊ธฐ์ ์ง์ ์ ์ก๋ฉ๋๋ค.
- ์คํ๊ธฐ ์ ํ๋ฆฌ์ผ์ด์ ์ด ์ข ๋ฃ๋์ด ์คํ๊ธฐ Pod๋ ์ข ๋ฃ๋ฉ๋๋ค.
- ๋ค์ ํด๋ง์์ ์์ ๊ธฐ๊ฐ ์ทจ์ ์ ํธ๋ฅผ ๋ฐ์ต๋๋ค.
์คํ๊ธฐ๊ฐ ์ ํธ๋ฅผ ์์ ํ๋ ์๊ธฐ์ ์์ ๊ธฐ๊ฐ ์ ํธ๋ฅผ ์์ ํ๋ ์์ ์ฌ์ด์ ์ฝ๊ฐ์ ์ง์ฐ์ด ์์ ์ ์์ต๋๋ค. ์คํ๊ธฐ Pod๊ฐ ์ข ๋ฃ๋๊ธฐ ์์ํ๋ฉด ์์ ๊ธฐ๋ ์ํ์ ๋ฐ๋ผ ์ํ๋ ์์ ์คํ๊ธฐ์ ์ผ์นํ๋๋ก ์ ์คํ๊ธฐ๋ฅผ ๋ถ๋ฌ ์ค๋ ค๊ณ ํฉ๋๋ค. ๊ทธ๋ฌ๋ ์์ ๊ธฐ๋ ์ทจ์ ์ ํธ๋ฅผ ์์ ํ๋ฉด ์คํ๊ธฐ ์๋ฅผ ์ค์ด๋ ์กฐ์น๋ฅผ ์ทจํฉ๋๋ค. ๊ฒฐ๊ตญ ์์ ๊ธฐ๋ ์ํ๋ ์คํ๊ธฐ ์๋ก ์ถ์๋ฉ๋๋ค. ๊ทธ ๋์, ์ฌ๋ถ์ ์คํ๊ธฐ๋ฅผ ๋ณผ ์ ์์ต๋๋ค.
์ค๋ฅ: Name must have up to n characters
ARC๋ ํน์ ๋ฆฌ์์ค์ ์์ฑ๋ ์ด๋ฆ์ ๋ค๋ฅธ ๋ฆฌ์์ค์ ๋ํ ๋ ์ด๋ธ๋ก ์ฌ์ฉํฉ๋๋ค. ์ด ์๊ตฌ ์ฌํญ์ผ๋ก ์ธํด ARC๋ ๋ฆฌ์์ค ์ด๋ฆ์ 63์๋ก ์ ํํฉ๋๋ค.
๋ฆฌ์์ค ์ด๋ฆ์ ์ผ๋ถ๊ฐ ์ฌ์ฉ์์ ์ํด ์ ์๋๋ฏ๋ก ARC๋ ์ค์น ์ด๋ฆ ๋ฐ ๋ค์์คํ์ด์ค์ ์ฌ์ฉํ ์ ์๋ ๋ฌธ์ ์์ ์ ํ์ ์ ์ฉํฉ๋๋ค.
Error: INSTALLATION FAILED: execution error at (gha-runner-scale-set/templates/autoscalingrunnerset.yaml:5:5): Name must have up to 45 characters
Error: INSTALLATION FAILED: execution error at (gha-runner-scale-set/templates/autoscalingrunnerset.yaml:8:5): Namespace must have up to 63 characters
์ค๋ฅ: Access to the path /home/runner/_work/_tool is denied
์๊ตฌ ๋ณผ๋ฅจ๊ณผ ํจ๊ป Kubernetes ๋ชจ๋๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ์ด ์ค๋ฅ๊ฐ ํ์๋ ์ ์์ต๋๋ค. ์ด ์ค๋ฅ๋ ์คํ๊ธฐ ์ปจํ ์ด๋๊ฐ ๋ฃจํธ๊ฐ ์๋ ์ฌ์ฉ์์ ํจ๊ป ์คํ ์ค์ด๊ณ ์ด๋ก ์ธํด ํ์ฌ๋ ๋ณผ๋ฅจ๊ณผ ๊ถํ์ด ์ผ์นํ์ง ์๋ ๊ฒฝ์ฐ์ ๋ฐ์ํฉ๋๋ค.
๋ค์ ์์ ์ค ํ๋๋ฅผ ๋ฐ๋ฅด๋ฉด ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์ต๋๋ค.
-
securityContext.fsGroup
๋ฅผ ์ง์ํ๋ ๋ณผ๋ฅจ ํ์์ ์ฌ์ฉํฉ๋๋ค.hostPath
๋ณผ๋ฅจ์ ์ด ์์ฑ์ ์ง์ํ์ง ์์ง๋งlocal
๋ณผ๋ฅจ ๋ฐ ๊ธฐํ ์ ํ์ ๋ณผ๋ฅจ์ ์ด ์์ฑ์ ์ง์ํฉ๋๋ค. ์คํ๊ธฐ์ GID์ ์ผ์นํ๋๋ก ์คํ๊ธฐ Pod์fsGroup
๋ฅผ ์ ๋ฐ์ดํธํฉ๋๋ค. ๋ค์์ ํฌํจํ๋๋กgha-runner-scale-set
helm ์ฐจํธ ๊ฐ์ ์ ๋ฐ์ดํธํ๋ฉด ์ด ์์ ์ ์ํํ ์ ์์ต๋๋ค.VERSION
๋ฅผ, ์ฌ์ฉํ๋ ค๋ ๋ฒ์ ์actions-runner
์ปจํ ์ด๋ ์ด๋ฏธ์ง๋ก ๋ฐ๊ฟ๋๋ค.YAML template: spec: securityContext: fsGroup: 123 containers: - name: runner image: ghcr.io/actions/actions-runner:latest command: ["/home/runner/run.sh"]
template: spec: securityContext: fsGroup: 123 containers: - name: runner image: ghcr.io/actions/actions-runner:latest command: ["/home/runner/run.sh"]
-
์คํ๊ธฐ Pod์
securityContext
๋ฅผ ์ ๋ฐ์ดํธํ๋ ๊ฒ์ด ์คํ ๊ฐ๋ฅํ ์๋ฃจ์ ์ด ์๋ ๊ฒฝ์ฐ ๋ค์๊ณผ ๊ฐ์ดinitContainers
๋ฅผ ์ฌ์ฉํ์ฌ ํ์ฌ๋ ๋ณผ๋ฅจ์ ์์ ๊ถ์ ๋ณ๊ฒฝํ๋ฉด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์์ต๋๋ค.YAML template: spec: initContainers: - name: kube-init image: ghcr.io/actions/actions-runner:latest command: ["sudo", "chown", "-R", "1001:123", "/home/runner/_work"] volumeMounts: - name: work mountPath: /home/runner/_work containers: - name: runner image: ghcr.io/actions/actions-runner:latest command: ["/home/runner/run.sh"]
template: spec: initContainers: - name: kube-init image: ghcr.io/actions/actions-runner:latest command: ["sudo", "chown", "-R", "1001:123", "/home/runner/_work"] volumeMounts: - name: work mountPath: /home/runner/_work containers: - name: runner image: ghcr.io/actions/actions-runner:latest command: ["/home/runner/run.sh"]
์ค๋ฅ: failed to get access token for GitHub App auth: 401 Unauthorized
GitHub App์ ๋ํ ์ก์ธ์ค ํ ํฐ์ ์ป์ผ๋ ค๊ณ ํ ๋ 401 Unauthorized
์ค๋ฅ๊ฐ ๋ฐ์ํ๋ ๊ฒ์ NTP(๋คํธ์ํฌ ์๊ฐ ํ๋กํ ์ฝ) ๋๋ฆฌํํธ์ ๊ฒฐ๊ณผ์ผ ์ ์์ต๋๋ค. Kubernetes ์์คํ
์ด NTP ์๋ฒ์ ์ ํํ๊ฒ ๋๊ธฐํ๋๊ณ ์์ผ๋ฉฐ ์๋นํ ์๊ฐ ๋๋ฆฌํํธ๊ฐ ์๋์ง ํ์ธํฉ๋๋ค. ์์คํ
์๊ฐ์ด GitHub์ ์๊ฐ๋ณด๋ค ๋ฆ๋ค๋ฉด ์ฌ์ ๊ฐ ์กฐ๊ธ ์๊ฒ ์ง๋ง ํ๊ฒฝ ์๊ฐ์ด ๋ช ์ด ์ด์ ๋น ๋ฅด๋ค๋ฉด GitHub App์ ์ฌ์ฉํ ๋ 401 ์ค๋ฅ๊ฐ ๋ฐ์ํ๊ฒ ๋ฉ๋๋ค.
๋ฌ๋ ๊ทธ๋ฃน ์ ํ
ํ๋์ ๋ฌ๋ ๊ทธ๋ฃน์์ ์ต๋ 10,000๊ฐ์ ์์ฒด ํธ์คํ ๋ฌ๋๋ฅผ ๊ฐ์ง ์ ์์ต๋๋ค. ์ด ์ ํ์ ๋๋ฌํ๋ฉด ์ ์คํ๊ธฐ๋ฅผ ์ถ๊ฐํ ์ ์์ต๋๋ค.
๋ฒ์ ๊ณ ์ง
๋ค์์ Apache-2.0 ๋ผ์ด์ ์ค์์ https://github.com/actions/actions-runner-controller/๋ก๋ถํฐ ์ผ๋ถ ์กฐ์ ๋์์ต๋๋ค.
Copyright 2019 Moto Ishizawa
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.