0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Actions Runner Controllerの0.10.1をArgoCDでInstallする方法

0
Last updated at Posted at 2025-03-06

Actions Runner ControllerとArgoCDの相性で課題があり、以下のPRで必要になった為、この手順を用意しました.

1. kindクラスタ作成

kind create cluster --image mirror.gcr.io/kindest/node:v1.32.0

2. ArgoCDをインストール

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

※ UI にアクセスする場合は、以下でポートフォワードしてください:

kubectl port-forward svc/argocd-server -n argocd 8080:443

3. GitHub PAT Secret の作成

ArgoCD Application の syncOptions により namespace が自動作成された後に、以下を実行してください。

kubectl create secret generic github-pat-secret \\
  -n default \\
  --from-literal=github_token='<YOUR_PAT>'

※ <YOUR_PAT> は実際の PAT に置き換えてください。

4. ArgoCD Application: gha-runner-scale-set-controller

以下の内容を gha-runner-scale-set-controller-app.yaml として保存してください。

Helm Chart バージョンは 0.10.1 を使用し、image.repository は指定しつつ、デフォルトタグを利用。さらに、excludeLabelPropagationPrefixes の配列設定を追加しています。

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: gha-runner-scale-set-controller
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: default
  source:
    repoURL: "ghcr.io/actions/actions-runner-controller-charts"
    chart: "gha-runner-scale-set-controller"
    targetRevision: "0.10.1"
    helm:
      parameters:
        - name: githubConfigSecret
          value: "github-pat-secret"
        - name: serviceAccount.name
          value: "gha-runner-scale-set-controller"
        - name: flags.excludeLabelPropagationPrefixes[0]
          value: "argocd.argoproj.io/instance"
        - name: flags.excludeLabelPropagationPrefixes[1]
          value: "app.kubernetes.io/component"
        - name: flags.excludeLabelPropagationPrefixes[2]
          value: "app.kubernetes.io/instance"
        - name: flags.excludeLabelPropagationPrefixes[3]
          value: "app.kubernetes.io/managed-by"
        - name: flags.excludeLabelPropagationPrefixes[4]
          value: "app.kubernetes.io/name"
        - name: flags.excludeLabelPropagationPrefixes[5]
          value: "app.kubernetes.io/part-of"
        - name: flags.excludeLabelPropagationPrefixes[6]
          value: "app.kubernetes.io/version"
  destination:
    server: "https://kubernetes.default.svc"
    namespace: arc-systems
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
      - ServerSideApply=true

Applyすると以下の通りになります

image.png

5. ArgoCD Application: demo (Runner Scale Set)

以下の内容を gha-runner-scale-set-app.yaml(ファイル名は任意)として保存してください。

Helm Chart バージョンは 0.10.1 固定、最小ランナー数を 1 に設定。

また、以下の helm パラメータを設定しています。

  • controllerServiceAccount.name: "gha-runner-scale-set-controller-gha-rs-controller"
  • controllerServiceAccount.namespace: "default"
  • githubConfigSecret: "github-pat-secret"
  • githubConfigUrl: "<https://github.com/kahirokunn/actions-runner-controller>"
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: demo
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: default
  source:
    repoURL: "ghcr.io/actions/actions-runner-controller-charts"
    chart: "gha-runner-scale-set"
    targetRevision: "0.10.1"
    helm:
      parameters:
        - name: minRunners
          value: "1"
        - name: controllerServiceAccount.name
          value: "gha-runner-scale-set-controller"
        - name: controllerServiceAccount.namespace
          value: "arc-systems"
        - name: githubConfigSecret
          value: "github-pat-secret"
        - name: githubConfigUrl
          value: "https://github.com/kahirokunn/actions-runner-controller"
  destination:
    server: "https://kubernetes.default.svc"
    namespace: default
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
      - ServerSideApply=true

ApplyするとArgoCDからは以下の様に見えます
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?