ํ์ ์กฐ๊ฑด
ARC๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ๋ค์์ด ์๋์ง ํ์ธํฉ๋๋ค.
-
Kubernetes ํด๋ฌ์คํฐ
-
๊ด๋ฆฌ ํด๋ผ์ฐ๋ ํ๊ฒฝ์ ๊ฒฝ์ฐ AKS๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ Azure AI ์๋น์ค ์ค๋ช ์์ Azure Kubernetes ์๋น์ค๋ฅผ ์ฐธ์กฐํ์ธ์.
-
๋ก์ปฌ ์ค์ ์ ๊ฒฝ์ฐ minikube ๋๋ kind๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ minikube ์ค๋ช ์์ minkube ์์ ๋ฐ kind ์ค๋ช ์์ kind๋ฅผ ์ฐธ์กฐํ์ธ์.
์ฐธ๊ณ ํญ๋ชฉ
OpenShift ํด๋ฌ์คํฐ๋ ํ์ฌ ์ง์๋์ง ์์ต๋๋ค.
-
-
Helm 3
- ์์ธํ ๋ด์ฉ์ Helm ์ค๋ช ์์์ "Helm ์ค์น"๋ฅผ ์ฐธ์กฐํ์ธ์.
-
ARC๋ฅผ ๋ฐฐํฌํ ํ์๋ ์์ง๋ง ํ๋ก๋์ ์ํฌํ๋ก์์ ARC๋ฅผ ๋ฐฐํฌํ๊ธฐ ์ ์ ์ปจํธ๋กค๋ฌ, ์์ ๊ธฐ ๋ฐ ์์ ์คํ๊ธฐ์์ ๋ก๊ทธ๋ฅผ ์์งํ๊ณ ์ ์งํ๋ ๋ฐฉ๋ฒ์ ๊ตฌํํ๋์ง ํ์ธํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
Actions Runner Controller ์ค์น
-
ํด๋ฌ์คํฐ์ ์ด์์ ๋ฐ CRD(์ฌ์ฉ์ ์ง์ ๋ฆฌ์์ค ์ ์)๋ฅผ ์ค์นํ๋ ค๋ฉด ๋ค์์ ์ํํฉ๋๋ค.
- Helm ์ฐจํธ์์ ์ฐ์ฐ์ Pod๋ฅผ ๋ง๋ค ์์น๋ก
NAMESPACE
๊ฐ์ ์ ๋ฐ์ดํธํฉ๋๋ค. ์ด ๋ค์์คํ์ด์ค๋ Kubernetes API ์๋ฒ์ ๋ํ ์ก์ธ์ค๋ฅผ ํ์ฉํด์ผ ํฉ๋๋ค. - Helm ์ฐจํธ ์ค์น
๋ค์ ์์์๋ ์ฐจํธ์ ์ต์ ๋ฒ์ ์ ์ค์นํฉ๋๋ค. ํน์ ๋ฒ์ ์ ์ค์นํ๋ ค๋ฉด ์ค์นํ๋ ค๋ ์ฐจํธ ๋ฒ์ ๊ณผ ํจ๊ป
--version
์ธ์๋ฅผ ์ ๋ฌํ ์ ์์ต๋๋ค. GitHub ์ปจํ ์ด๋ ๋ ์ง์คํธ๋ฆฌ์์ ๋ฆด๋ฆฌ์ค ๋ชฉ๋ก์ ์ฐพ์ ์ ์์ต๋๋ค.Bash NAMESPACE="arc-systems" helm install arc \ --namespace "${NAMESPACE}" \ --create-namespace \ oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller
NAMESPACE="arc-systems" helm install arc \ --namespace "${NAMESPACE}" \ --create-namespace \ oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller
์ถ๊ฐ Helm ๊ตฌ์ฑ ์ต์ ์ ARC ์ค๋ช ์์
values.yaml
์ ์ฐธ์กฐํ์ธ์. - Helm ์ฐจํธ์์ ์ฐ์ฐ์ Pod๋ฅผ ๋ง๋ค ์์น๋ก
-
ARC์์ GitHub์ ์ธ์ฆํ ์ ์๋๋ก ํ๋ ค๋ฉด personal access token (classic)์(๋ฅผ) ์์ฑํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ "GitHub API์ ARC ์ธ์ฆ"์ ์ฐธ์กฐํ์ธ์.
์คํ๊ธฐ ํ์ฅ ์งํฉ ๊ตฌ์ฑ
-
์คํ๊ธฐ ํ์ฅ ์งํฉ์ ๊ตฌ์ฑํ๋ ค๋ฉด ARC ๊ตฌ์ฑ์ ๊ฐ์ ์ฌ์ฉํ์ฌ ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ ์คํํฉ๋๋ค.
๋ช ๋ น์ ์คํํ ๋ ๋ค์ ์ฌํญ์ ์ ์ํ์ธ์.
-
INSTALLATION_NAME
๊ฐ์ ์ ์คํ๊ฒ ์ ๋ฐ์ดํธํฉ๋๋ค. ์ค์น ์ด๋ฆ์ ์ํฌํ๋ก์runs-on
๊ฐ์ผ๋ก ์ฌ์ฉํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ GitHub Actions์ ๋ํ ์ํฌํ๋ก ๊ตฌ๋ฌธ์(๋ฅผ) ์ฐธ์กฐํ์ธ์. -
์คํ๊ธฐ Pod๋ฅผ ๋ง๋ค๋ ค๋ ์์น๋ก
NAMESPACE
๊ฐ์ ์ ๋ฐ์ดํธํฉ๋๋ค. -
GITHUB_CONFIG_URL
์ ๋ฆฌํฌ์งํ ๋ฆฌ, ์กฐ์ง ๋๋ ์ํฐํ๋ผ์ด์ฆ์ URL๋ก ์ค์ ํฉ๋๋ค. ์คํ๊ธฐ์์ ์ํ๊ฒ ๋ ์ํฐํฐ์ ๋๋ค. -
์ด ์์ ๋ช ๋ น์ Helm ์ฐจํธ์ ์ต์ ๋ฒ์ ์ ์ค์นํฉ๋๋ค. ํน์ ๋ฒ์ ์ ์ค์นํ๋ ค๋ฉด ์ค์นํ๋ ค๋ ์ฐจํธ ๋ฒ์ ๊ณผ ํจ๊ป
--version
์ธ์๋ฅผ ์ ๋ฌํ ์ ์์ต๋๋ค. GitHub ์ปจํ ์ด๋ ๋ ์ง์คํธ๋ฆฌ์์ ๋ฆด๋ฆฌ์ค ๋ชฉ๋ก์ ์ฐพ์ ์ ์์ต๋๋ค.์ฐธ๊ณ ํญ๋ชฉ
- ๋ณด์์ ์ํด ์คํ๊ธฐ ํฌ๋๋ ์ด์์ ํฌ๋๊ฐ ์๋ ๋ค์์คํ์ด์ค๊ฐ ์๋ ๋ค๋ฅธ ๋ค์์คํ์ด์ค์ ๋ง๋ญ๋๋ค.
- ๋ณด์์ ์ํด Kubernetes ๋น๋ฐ์ ๋ง๋ค๊ณ ๋น๋ฐ ์ฐธ์กฐ๋ฅผ ์ ๋ฌํฉ๋๋ค. ๋น๋ฐ์ CLI์์ ์ผ๋ฐ ํ ์คํธ๋ก ์ ๋ฌํ๋ฉด ๋ณด์ ์ํ์ด ๋ฐ์ํ ์ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ Actions Runner Controller๋ฅผ ์ฌ์ฉํ์ฌ ์คํ๊ธฐ ํ์ฅ ์งํฉ ๋ฐฐํฌ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
Bash INSTALLATION_NAME="arc-runner-set" NAMESPACE="arc-runners" GITHUB_CONFIG_URL="https://github.com/<your_enterprise/org/repo>" GITHUB_PAT="<PAT>" helm install "${INSTALLATION_NAME}" \ --namespace "${NAMESPACE}" \ --create-namespace \ --set githubConfigUrl="${GITHUB_CONFIG_URL}" \ --set githubConfigSecret.github_token="${GITHUB_PAT}" \ oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set
INSTALLATION_NAME="arc-runner-set" NAMESPACE="arc-runners" GITHUB_CONFIG_URL="https://github.com/<your_enterprise/org/repo>" GITHUB_PAT="<PAT>" helm install "${INSTALLATION_NAME}" \ --namespace "${NAMESPACE}" \ --create-namespace \ --set githubConfigUrl="${GITHUB_CONFIG_URL}" \ --set githubConfigSecret.github_token="${GITHUB_PAT}" \ oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set
์ถ๊ฐ Helm ๊ตฌ์ฑ ์ต์ ์ ARC ์ค๋ช ์์
values.yaml
์ ์ฐธ์กฐํ์ธ์.
-
-
ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ ์คํํ์ฌ ์ค์น๋ฅผ ํ์ธํฉ๋๋ค.
Bash helm list -A
helm list -A
๋ค์๊ณผ ์ ์ฌํ ๊ฒฐ๊ณผ๊ฐ ํ์๋ฉ๋๋ค.
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION arc arc-systems 1 2023-04-12 11:45:59.152090536 +0000 UTC deployed gha-runner-scale-set-controller-0.4.0 0.4.0 arc-runner-set arc-runners 1 2023-04-12 11:46:13.451041354 +0000 UTC deployed gha-runner-scale-set-0.4.0 0.4.0
-
๊ด๋ฆฌ์ Pod๋ฅผ ์ค์นํ๋ ค๋ฉด ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ ์คํํฉ๋๋ค.
Bash kubectl get pods -n arc-systems
kubectl get pods -n arc-systems
๋ชจ๋ ํญ๋ชฉ์ด ์ฑ๊ณต์ ์ผ๋ก ์ค์น๋๋ฉด Pod์ ์ํ๊ฐ ์คํ ์ค์ผ๋ก ํ์๋ฉ๋๋ค.
NAME READY STATUS RESTARTS AGE arc-gha-runner-scale-set-controller-594cdc976f-m7cjs 1/1 Running 0 64s arc-runner-set-754b578d-listener 1/1 Running 0 12s
์ค์น์ ์ฑ๊ณตํ์ง ๋ชปํ ๊ฒฝ์ฐ ๋ฌธ์ ํด๊ฒฐ ์ ๋ณด๋ Actions Runner Controller ์ค๋ฅ ๋ฌธ์ ํด๊ฒฐ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
์คํ๊ธฐ ํ์ฅ ์งํฉ ์ฌ์ฉ
์ด์ ์คํ๊ธฐ ํ์ฅ ์งํฉ ์คํ๊ธฐ๋ฅผ ์ฌ์ฉํ๋ ๊ฐ๋จํ ํ ์คํธ ์ํฌํ๋ก๋ฅผ ๋ง๋ค๊ณ ์คํํ๊ฒ ๋ ๊ฒ์ ๋๋ค.
-
๋ฆฌํฌ์งํ ๋ฆฌ์์ ๋ค์ ์์ ์ ์ ์ฌํ ์ํฌํ๋ก๋ฅผ ๋ง๋ญ๋๋ค. ๊ฐ์
runs-on
์๋ ์ค์ผ์ผ๋ง ์คํ๊ธฐ ์งํฉ์ ์ค์นํ ๋ ์ฌ์ฉํ Helm ์ค์น ์ด๋ฆ๊ณผ ์ผ์นํด์ผ ํฉ๋๋ค.๋ฆฌํฌ์งํ ๋ฆฌ์ ํ์ผ ์ถ๊ฐ์ ๋ํ ์์ธํ ๋ด์ฉ์ GitHub Actions์ฉ ๋น ๋ฅธ ์์์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
YAML name: Actions Runner Controller Demo on: workflow_dispatch: jobs: Explore-GitHub-Actions: # You need to use the INSTALLATION_NAME from the previous step runs-on: arc-runner-set steps: - run: echo "๐ This job uses runner scale set runners!"
name: Actions Runner Controller Demo on: workflow_dispatch: jobs: Explore-GitHub-Actions: # You need to use the INSTALLATION_NAME from the previous step runs-on: arc-runner-set steps: - run: echo "๐ This job uses runner scale set runners!"
-
๋ฆฌํฌ์งํ ๋ฆฌ์ ์ํฌํ๋ก๋ฅผ ์ถ๊ฐํ ํ ์ํฌํ๋ก๋ฅผ ์๋์ผ๋ก ํธ๋ฆฌ๊ฑฐํฉ๋๋ค. ์์ธํ ๋ด์ฉ์ ์ํฌํ๋ก ์๋ ์คํ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
-
์ํฌํ๋ก๊ฐ ์คํ๋๋ ๋์ ์์ฑ๋๋ ์คํ๊ธฐ Pod๋ฅผ ๋ณด๋ ค๋ฉด ํฐ๋ฏธ๋์์ ๋ค์ ๋ช ๋ น์ ์คํํฉ๋๋ค.
Bash kubectl get pods -n arc-runners
kubectl get pods -n arc-runners
์ฑ๊ณตํ๋ฉด ์ถ๋ ฅ์ ๋ค์๊ณผ ์ ์ฌํ๊ฒ ํ์๋ฉ๋๋ค.
NAMESPACE NAME READY STATUS RESTARTS AGE arc-runners arc-runner-set-rmrgw-runner-p9p5n 1/1 Running 0 21s
๋ค์ ๋จ๊ณ
Actions Runner Controller์(๋) GitHub Actions ์คํ๊ธฐ๋ฅผ ํจ์จ์ ์ผ๋ก ๊ด๋ฆฌํ๋ ๋ฐ ๋์์ด ๋ ์ ์์ต๋๋ค. ์์ํ ์ค๋น๊ฐ ๋์ จ๋์? ARC๋ฅผ ์ฌ์ฉํ์ฌ ๋ค์ ๋จ๊ณ๋ฅผ ์ํํ๋ ๋ฐ ์ ์ฉํ ๋ช ๊ฐ์ง ๋ฆฌ์์ค๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
- ์ธ์ฆ ์ ๋ณด์ ๋ํ ์์ธํ ๋ด์ฉ์ GitHub API์ ARC ์ธ์ฆ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
- ์ํฌํ๋ก์์ ARC ์คํ๊ธฐ๋ฅผ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ํ ๋์๋ง์ ์ํฌํ๋ก์์ Actions Runner Controller ์คํ๊ธฐ ์ฌ์ฉ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
- ๋ฐฐํฌ ์ ๋ณด๋ Actions Runner Controller๋ฅผ ์ฌ์ฉํ์ฌ ์คํ๊ธฐ ํ์ฅ ์งํฉ ๋ฐฐํฌ์(๋ฅผ) ์ฐธ์กฐํ์ธ์.
๋ฒ์ ๊ณ ์ง
๋ค์์ 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.