actions-runner-controller icon indicating copy to clipboard operation
actions-runner-controller copied to clipboard

Can't use underscore in "runnerScaleSetName" on the helm charts

Open thomassandslyst opened this issue 2 years ago • 1 comments

Checks

  • [X] I've already read https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/troubleshooting-actions-runner-controller-errors and I'm sure my issue is not covered in the troubleshooting guide.
  • [X] I am using charts that are officially provided

Controller Version

0.6.1

Deployment Method

ArgoCD

Checks

  • [X] This isn't a question or user support case (For Q&A and community support, go to Discussions).
  • [X] I've read the Changelog before submitting this issue and I'm sure it's not due to any recently-introduced backward-incompatible changes

To Reproduce

1. Set "runnerScaleSetName" to any word containing an underscore such as "x86_64"
2. Attempt to apply the chart

Describe the bug

"runnerScaleSetName" (defined as "gha-runner-scale-set.scale-set-name" in _helpers.tpl) is tightly bound to several values in the metadata including resource names, this limits the Github Actions label resulting from this to the k8s' RFC 1123 naming scheme which restricts it to lower case only and no underscores.

This is troublesome as many descriptive labels, such as architectures, contain capital letters or underscores such as "x86_64".

I suggest decoupling runnerScaleSetName and instead relying on "gha-runner-scale-set.name" in _helpers.tpl which should be set by the helm release name or by a separate name value.

Describe the expected behavior

"runnerScaleSetName" should be able to be set in the helm chart to any combination of characters supported by Github Actions.

Additional Context

gha-runner-scale-set:
  githubConfigUrl: ########
  maxRunners: 20
  minRunners: 0
  runnerGroup: "Default"
  runnerScaleSetName: "x86_64"

  controllerServiceAccount:
    namespace: gha-runner-scale-set
    name: gha-runner-scale-set-controller-gha-rs-controller

  template:
    spec:
      nodeSelector:
        kubernetes.io/arch: amd64
        # Fixed zone due to EBS cache
        topology.kubernetes.io/zone: eu-west-1a

      shareProcessNamespace: True # For EBS cache script information sharing
      initContainers:
        - name: init-dind-externals
          image: ghcr.io/actions/actions-runner:latest
          command:
            [
              "cp",
              "-r",
              "-v",
              "/home/runner/externals/.",
              "/home/runner/tmpDir/",
            ]
          volumeMounts:
            - name: dind-externals
              mountPath: /home/runner/tmpDir

      containers:
        - name: runner
          image: ######
          imagePullPolicy: Always
          command: ["/home/runner/run.sh"]
          env:
            - name: DOCKER_HOST
              value: unix:///run/docker/docker.sock
            - name: "ACTIONS_RUNNER_HOOK_JOB_STARTED"
              value: "/usr/bin/cache-init.sh"
          volumeMounts:
            - name: work
              mountPath: /home/runner/_work
            - name: dind-sock
              mountPath: /run/docker
              readOnly: true
            - mountPath: "/home/runner/.dockercreds"
              name: dockercreds
              readOnly: true
          resources:
            limits:
              cpu: "2"
              memory: "8Gi"
            requests:
              cpu: 500m
              memory: "2Gi"
          lifecycle:
            postStart:
              exec:
                command:
                  - /bin/sh
                  - -c
                  - mkdir -p ~/.docker && cp ~/.dockercreds/config.json ~/.docker/config.json
        - name: dind
          image: docker:dind
          imagePullPolicy: Always
          env:
            - name: DOCKER_GROUP_GID
              value: "123"
          securityContext:
            privileged: true
          volumeMounts:
            - name: work
              mountPath: /home/runner/_work
            - name: dind-sock
              mountPath: /run/docker
            - name: dind-externals
              mountPath: /home/runner/externals
          resources:
            limits:
              cpu: "2"
              memory: "8Gi"
            requests:
              cpu: 500m
              memory: "2Gi"
      volumes:
        - name: work
          emptyDir: {}
        - name: dind-sock
          emptyDir: {}
        - name: dind-externals
          emptyDir: {}
        - name: dockercreds
          secret:
            secretName: dockercreds

Controller Logs

Helm chart issue, controller logs not applicable. Here's the apply error instead:


one or more objects failed to apply, reason: ServiceAccount "x86_64-gha-rs-no-permission" is invalid: metadata.name: Invalid value: "x86_64-gha-rs-no-permission": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'),Secret "x86_64-gha-rs-github-secret" is invalid: metadata.name: Invalid value: "x86_64-gha-rs-github-secret": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'),AutoscalingRunnerSet.actions.github.com "x86_64" is invalid: metadata.name: Invalid value: "x86_64": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Runner Pod Logs

Helm chart issue, Pod logs not applicable

thomassandslyst avatar Nov 21 '23 11:11 thomassandslyst

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.

github-actions[bot] avatar Nov 21 '23 11:11 github-actions[bot]