Skip to content

kubernetes mode missing required environment variables #211

@reiniertimmer

Description

@reiniertimmer

Checks

Controller Version

0.11.0

Deployment Method

ArgoCD

Checks

  • This isn't a question or user support case (For Q&A and community support, go to Discussions).
  • 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. Create a regular autoscalingrunnerset
2. Create an autoscalingrunnerset with container mode "kubernetes"
3. Run a workflow that displays the environment variables (like `env`)
4. In kubernetes mode, variables like `GITHUB_ACTIONS` and `CI` are missing

Describe the bug

In kubernetes mode, variables like GITHUB_ACTIONS and CI are missing, even though these are specified as being [default environment variables])https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables).

Describe the expected behavior

Both GITHUB_ACTIONS and CI environment variables should be present and contain the value true

Additional Context

Runner setup snippets from helm values


containerMode:
  type: kubernetes
  kubernetesModeWorkVolumeClaim:
    storageClassName: default
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 5Gi

template:
  spec:
    securityContext:
      fsGroup: 123
    containers:
      - command:
          - /home/runner/run.sh
        env:
          - name: ACTIONS_RUNNER_CONTAINER_HOOKS
            value: /home/runner/k8s/index.js
          - name: ACTIONS_RUNNER_POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: ACTIONS_RUNNER_REQUIRE_JOB_CONTAINER
            value: 'true'
        image: 'ghcr.io/actions/actions-runner:latest'
        name: runner
        volumeMounts:
          - mountPath: /home/runner/_work
            name: work

Controller Logs

There doesn't seem to be an error with the controller, but for completeness, here it is https://gist.github.com/reiniertimmer/547744ef5178b90b27f09b04ade3f576

Runner Pod Logs

https://gist.github.com/reiniertimmer/ca2cdaca95706c1bc945a100d30820bd

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions