有没有办法在具有特定架构的节点上启动 Azure arc runner?

问题描述 投票:0回答:1

在配置azure arc runner来运行github操作时,我们可能有一些与平台相关的图像,这需要特定的架构,例如arm64或amd64。

有没有办法提及在 k8s 集群中旋转的 arc runners 控制器,以指定要旋转的 runner pod 的架构。

以我为例

我有一个需要arm64架构的sql,已使用以下配置配置了azure arc runner。 值.yaml

containerMode:
  type: "dind"

弧.tf

resource "helm_release" "arc" {
  repository = "oci://ghcr.io/actions/actions-runner-controller-charts"
  chart      = "gha-runner-scale-set-controller"
  name       = "arc-controller"
  namespace  = kubernetes_namespace.arc_systems.metadata[0].name
}

resource "helm_release" "arc_runners" {
  namespace  = kubernetes_namespace.arc_systems.metadata[0].name
  repository = "oci://ghcr.io/actions/actions-runner-controller-charts"
  chart      = "gha-runner-scale-set"
  name       = "azure-arc-runners"

  set {
    name  = "githubConfigUrl"
    value = "https://github.com/praja"
  }

  set {
    name  = "githubConfigSecret"
    value = kubernetes_secret.github_secret.metadata[0].name
  }

  set {
    name  = "minRunners"
    value = "0"
  }

  set {
    name  = "maxRunners"
    value = "5"
  }

  set {
    name  = "runnerScaleSetName"
    value = "azure-arc-runners"
  }

  values = [
    templatefile("${path.module}/values.yaml", {})
  ]

}

我们在azure中的k8s集群中有多个配置了amd64和arm64架构的节点。

这导致一些 runner pod 在 amd64 节点机器上旋转,这导致我们的 github 工作流程失败,由于 mysql 映像的架构不匹配,我们正在工作流程中获取。

所以我们需要有特定的配置,以便我们可以指定要在arm64节点机器上旋转的runner pod。

但是当我浏览 arc runner 控制器图表和值时,没有关于 runner pods 架构规范的参数可提及。

有什么办法可以解决这个问题吗?

azure kubernetes azure-pipelines github-actions cicd
1个回答
0
投票

我能够通过将以下配置添加到 vaules.yaml 来解决这个问题

template:
  spec:
    nodeSelector:
      "kubernetes.io/arch": arm64

现在能够在arm64节点机器上启动runner pod。

© www.soinside.com 2019 - 2024. All rights reserved.