Skip to main content

Actions Runner Controller 오류 문제 해결

Actions Runner Controller 오류를 해결하는 방법을 알아봅니다.

법적 고지 사항

로깅

컨트롤러, 수신기 및 실행기를 포함하는 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의 로그를 확인할 수 있습니다.

Bash
kubectl logs -n <CONTROLLER_NAMESPACE> -l app.kubernetes.io/name=gha-runner-scale-set-controller

다음 명령을 사용하면 실행기 집합 수신기의 로그를 확인할 수 있습니다.

Bash
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에 인증" 및 "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
    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"]
    

다음은 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.