actions / actions-runner-controller

Kubernetes controller for GitHub Actions self-hosted runners
Apache License 2.0
4.76k stars 1.12k forks source link

Not possible to deploy gha-runner-scale-set-controller helm chart via Fluxcd #3728

Open Mikey032 opened 2 months ago

Mikey032 commented 2 months ago

Checks

Controller Version

0.9.3

Deployment Method

Helm

Checks

To Reproduce

1. Deploy the gha-runner-scale-set-controller helm chart via Fluxcd. Flux yaml files are added in additional context.
2. Deployment fails with error:

NAME    REVISION            SUSPENDED   READY   MESSAGE                                                                                                                                                                           
arc     0.9.3+4fda46fd8c4e  False       False   Helm install failed for release arc systems/arc with chart gha-runner-scale-set-controller@0.9.3+4fda46fd8c4e: 1 error occurred:                                                                                                                                                                                                                                                              * Deployment.apps "arc-gha-rs-controller" is invalid: spec.template.labels: Invalid value: "0.9.3+4fda46fd8c4e": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')

Describe the bug

The chart revision is used in the arc-gha-rs-controller Deployment which contains a + sign which is not allowed.

Describe the expected behavior

Succesfull deployment of arc-gha-rs-controller

Additional Context

apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
  name: arc
  namespace: arc-systems
spec:
  interval: 10m
  url: oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller
  ref:
    tag: 0.9.3
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: arc
  namespace: arc-systems
spec:
  interval: 5m
  install:
    remediation:
      retries: 10
  releaseName: arc
  targetNamespace: arc-systems
  chartRef:
    kind: OCIRepository
    name: arc

Controller Logs

None, not yet running

Runner Pod Logs

None, not yet running
github-actions[bot] commented 2 months ago

Hello! Thank you for filing an issue.

The maintainers will triage your issue shortly.

In the meantime, please take a look at the troubleshooting guide for bug reports.

If this is a feature request, please review our contribution guidelines.

t4eman commented 2 months ago

I had a similar issue. I would suggest pulling from GitHub directly.

apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: GitRepository
metadata:
  name: arc
  namespace: arc-systems
spec:
  interval: 10m
  url: https://github.com/actions/actions-runner-controller
  ref:
    tag: gha-runner-scale-set-0.9.3
Fareroo7 commented 2 months ago

@mumoshu @rentziass same issue here... Would love to see this PR merged soon!

arnauvp-factorial commented 1 month ago

Hi! we use flux to deploy ARC to our CI clusters.

This is the yaml for the repository:

apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: gha-runner-scale-set
  namespace: flux-system
spec:
  interval: 30m
  type: oci
  url: oci://ghcr.io/actions/actions-runner-controller-charts
jhaumont commented 1 month ago

Hello @arnauvp-factorial

EDIT: I finally have a working solution (issue with egress filtering on the cluster...)

Can you share your helmRelease manifest ? 🙏 I currently try to setup it. I have the same HelmRepository but I have the following error:

source-controller chart pull error: failed to download chart for remote reference: failed to get 'oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller:0.9.3': failed to do request: Head "https://ghcr.io/v2/actions/actions-runner-controller-charts/gha-runner-scale-set-controller/manifests/0.9.3": read tcp 10.64.9.170:48980->140.82.121.33:443: read: connection reset by peer

And the chart declaration in the HR:

chart:
    spec:
      chart: gha-runner-scale-set-controller
      version: 0.9.3
      sourceRef:
        kind: HelmRepository
        name: actions-runner-controller-charts
lexdevelop commented 1 week ago

This works for me

apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: GitRepository
metadata:
  name: actions-runner-controller
  namespace: arc-systems
spec:
  interval: 10m
  url: https://github.com/actions/actions-runner-controller
  ref:
    tag: gha-runner-scale-set-0.9.3
  ignore: |
    # exclude all
    /*
    # include charts directory
    !/charts/
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: gha-runner-scale-set-controller
  namespace: arc-systems
spec:
  interval: 10m
  chart:
    spec:
      chart: ./charts/gha-runner-scale-set-controller
      version: 0.9.3
      sourceRef:
        kind: GitRepository
        name: actions-runner-controller
sim-tails commented 12 hours ago

I also had this issue, and pulling as a GitRepo worked. Thanks!