actions-runner-controller: flag provided but not defined: --watch-namespace

When installing via helm, I have the singleNamespace: true and watchNamespace: "gitactions-xxx" populated. I check in rancher the status of the manager and I’m seeing the error that the flag is provided but not defined.

I’m running v0.12.0 of the runner controller.

I checked the source code of the v0.12.0 and I can see the --watch-namespace feature, it’s just not working as expected when installing. To be sure, I cleared all of my namespaces, crds, and all our of rancher and tried to do a clean install of the controller.

  • Controller Version: v0.12.0
  • Deployment Method: Helm

the watchNamespace feature is very important in running multiple organizations with different installation ID’s. There is no documentation on how to get this working properly…

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 44 (1 by maintainers)

Commits related to this issue

Most upvoted comments

@rxa313 Thanks for confirming! I reread the values.yaml comment and it was actually correct. The point was that you had to set either singleNamespace: true OR watchNamespace.

You set singleNamespace: false before in https://github.com/actions-runner-controller/actions-runner-controller/issues/782#issuecomment-918538786 and that was why the watchNamespace defaulting didn’t work.

The comment starts with “If `scope.singleNamespace=true”, so I believe it’s correct.

@mumoshu I got that from the values.yml file itself ( in regards to watchNamespace ) it says:

# The default value is "", which means the namespace of the controller
  watchNamespace: ""

I didn’t see it in the README, just in the values.yml file is where this information is displayed.

I’m able to deploy “successfully” multiple controllers into a single namespace with the mentioned chart fix. However, there are other issues explained in #807

https://github.com/actions-runner-controller/actions-runner-controller/blob/master/charts/actions-runner-controller/templates/_helpers.tpl#L13 https://github.com/actions-runner-controller/actions-runner-controller/blob/master/charts/actions-runner-controller/templates/_helpers.tpl#L67

@rxa313 A lot of the resource names get set based on the fullnameOverride values property (and githubWebhookServer.fullnameOverride property for the webhook server), I don’t think there is a technical reason why multiple controllers can’t live in the same namespace as long as the resources in the chart have unique names for each install. Try setting this property (or both if you are using the webhook server) so that each install uses a unique prefix for its resources.

The alternative as @mumoshu has pointed out is that you install each chart into a unique namespace, either in the namespace that that charts controller will be monitoring runners in or a unique one, just as long as no 2 chart controller installs share the same namespace.

Either way, please do try my first suggestion and report back.