首先在k8s集群中安装gha-runner-scale-set-controller,这是新arc的controller。其中 AutoScalingRunnerSet Controller调用 GitHub 的 API 来获取这个 Runner scale set 所属的 runner 组 ID。
AutoScalingRunnerSet 资源创建后会自动创建AutoscalingListener资源, 创建AutoscalingListener之前会调用 Actions Service (可能是如果没有获取到组ID,会调用API创建组,还有获取注册token)
一个 Runner ScaleSet Listener pod 由 AutoScaling Listener Controller 创建。在此 pod 中,他会连接到 Actions Service 进行身份验证并建立长轮询 HTTPS 连接。它接收来自 Actions Service 的 Job Available 消息。
Error: Jobs without a job container are forbidden on this runner, please add a 'container:' to your job or contact your self-hosted runner administrator.
# 存储库、组织或企业的 URLgithubConfigUrl:"https://github.com/SoulChildTc/tekton-demo"githubConfigSecret:# PAT令牌github_token:ghp_xxxxxxxxxxxxxxxxxxxxxxxxx# 使用 k8s 模式, 会自动创建一个ROLE <RELEASE-NAME>-gha-runner-scale-set-kube-mode-role , 没有它 runner pod 无法创建 job podcontainerMode:type:"kubernetes"## type can be set to dind or kubernetes# ## 这个 volume 就是`runner pod` 和 `job pod` 共享数据用的, 在这个地方用下面的配置或者在template中声明一个名为work的volume都可以# kubernetesModeWorkVolumeClaim:# accessModes: ["ReadWriteOnce"]# # For local testing, use https://github.com/openebs/dynamic-localpv-provisioner/blob/develop/docs/quickstart.md to provide dynamic provision volume with storageClassName: openebs-hostpath# storageClassName: "dynamic-blob-storage"# resources:# requests:# storage: 1Gitemplate:spec:containers:- name:runnerimage:ghcr.io/actions/actions-runner:latestcommand:["/home/runner/run.sh"]env:- name:ACTIONS_RUNNER_CONTAINER_HOOKSvalue:/home/runner/k8s/index.js- name:ACTIONS_RUNNER_POD_NAMEvalueFrom:fieldRef:fieldPath:metadata.name- name:ACTIONS_RUNNER_REQUIRE_JOB_CONTAINERvalue:"false"volumeMounts:- name:workmountPath:/home/runner/_workvolumes:- name:workephemeral:volumeClaimTemplate:spec:accessModes:["ReadWriteOnce"]storageClassName:"standard"resources:requests:storage:1Gi