Container agent (container runner) setup

I followed container-runner docs to deploy (via Helm) a container agent. I created a resource class and noted the token in the WebUI. I created a values.yaml with the following content (scrubbed).

# values.yaml
---
resourceClasses:
  namespace/my-rc:
    token: MY_TOKEN

Helm deploy shows success:

helm install -f values.yaml container-agent circleci/container-agent -n circleci

However, pod logs show WARN: Missing API Key.. I’ve exec’d into the container and checked out the contents for /etc/container-agent/config.yaml and it shows the following. I don’t see anything representing my resource class and token.

# /etc/container-agent/config.yaml
resourceClasses:

Digging a bit more I think the deployment’s init container is doing some work to prep a config.yaml via the taskpod-config volume. It’s merging the config map container-agent with the secret container-agent. Values for both of these in my setup are equal to resourceClasses:. resourceClasses: is written to config.yaml and copied to the volume taskpod-config which is then mounted to /etc/container-agent/config.yaml in the container-agent container.

In an attempt to just make it work I updated config.yaml with the contents of my values.yaml and while exec’d into the pod ran kill 1; ./container-agent. The container-agent registered and can now successfully run jobs.

Looks like values.yaml was off by a property in the docs. Adding agent gets the init container to properly merge the yaml. Not a Helm expert here :rofl:, open to suggestions and explanations. Thanks!

# values.yaml
---
agent:
  resourceClasses:
    namespace/my-rc:
      token: MY_TOKEN

Glad you got it figured out! I’m updating the docs to include agent: as the top-line key in that section to avoid confusion going forward. Sorry about that.

Let me know if you have any questions or concerns with the container runner!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.