Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to pass dnsConfig to self-hosted autoscaling runners #761

Closed
sammcj opened this issue Aug 24, 2021 · 5 comments
Closed

Unable to pass dnsConfig to self-hosted autoscaling runners #761

sammcj opened this issue Aug 24, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@sammcj
Copy link
Contributor

sammcj commented Aug 24, 2021

I'm trying to set dnsConfig on the self-hosted autoscaling runner deployments.

Apologies if I'm simply trying to set it in the wrong place - I'm new to helm and very new to Actions.

Checks

  • [?] My actions-runner-controller version (v0.12.7) does support the feature
  • [-] I'm using an unreleased version of the controller I built from HEAD of the default branch

To Reproduce

I followed actions-runner-controller.md, using helm for the controller and deploying the runners via a simple kubernetes deployment manifest.

Which errors as it can't find RunnerDeployment.spec.template.spec.dnsConfig:

error: error validating "runnerdeployment.yaml": error validating data: ValidationError(RunnerDeployment.spec.template.spec): unknown field "dnsConfig" in dev.summerwind.actions.v1alpha1.RunnerDeployment.spec.template.spec; if you choose to ignore these errors, turn validation off with --validate=false

Steps to reproduce the behavior:

  1. Deploy the self-hosted runner controller using the provided helm chart.
  2. Create a deployment.yaml similar to those supplied in actions-runner-controller.md.
  3. Add dnsConfig to the deployment.yaml and apply.
  4. Try applying the deployment.
  5. Experience error above as the CRD doesn't accept RunnerDeployment.spec.template.spec.dnsConfig

Expected behavior

The following k8s deployment manifest (or similar) to work:

apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
  name: gha-runner-deployment
spec:
  template:
    spec:
      dnsConfig:
        options:
        - name: ndots     
          value: "1"

and from that dnsConfig should be passed to runner pods which configures /etc/resolv.conf inside containers with the provided options.

Environment:

  • Controller Version - 0.19.0
  • Deployment Method - Helm
  • Helm Chart Version - v0.12.7

Additional Context:

The reason I'm needing to configure this is because it seems with DIND (or really Docker in ContainerD) some base images (such as alpine) incorrectly get ndots:5 configured in /etc/resolv.conf which causes DNS lookup failures inside the container.

information on what ndots is

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 24, 2021

@sammcj Hey! This sounds like a valid feature request. Would you mind submitting a PR like #628 to add the additional pod template field support for Runner and RunnerDeployment resources?

You can also try RunnerSet which is still an unreleased feature, if you could try building a custom build of actions-runner-controller from master branch.

https://github.com/actions-runner-controller/actions-runner-controller#stateful-runners

RunnerSets supports any pod template fields out of the box.

@mumoshu mumoshu added the enhancement New feature or request label Aug 24, 2021
@callum-tait-pbx
Copy link
Contributor

@sammcj FYI https://github.com/rewanthtammana/kubectl-fields this plugin is super helpful for checking if a attribute is part of your deployed CRD set, for example here what it found for the limits attribute:

$ kubectl fields runnerdeployment limits

spec.template.spec.dockerdContainerResources.limits
spec.template.spec.resources.limits
spec.template.spec.volumes.ephemeral.volumeClaimTemplate.spec.resources.limits

@sammcj
Copy link
Contributor Author

sammcj commented Aug 24, 2021

Thanks for confirming this isn't currently possible @mumoshu, I'll submit a PR!

@sammcj
Copy link
Contributor Author

sammcj commented Aug 24, 2021

@callum-tait-pbx that looks really useful! Thank you!

@sammcj
Copy link
Contributor Author

sammcj commented Aug 25, 2021

@mumoshu - Initial crack at it: #764

I've almost certainly missed a few things and the local test suite takes over 40 mins to run which made experimentation a little difficult - I'm hoping Github Actions workflow for PRs has the same coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants