Start Building for Free
CircleCI.comAcademyBlogCommunitySupport

Container runner installation (Kubernetes)

2 months ago3 min read
Cloud
On This Page

This page describes how to install CircleCI’s container runner.

Prerequisites

To install container runners and run jobs, you will need to have root access, and have the following set up and installed:

Self-hosted runner terms agreement

1. Create namespace and resource class

2. Container runner installation

  1. Add the container runner Helm repo by running the following command:

    helm repo add container-agent https://packagecloud.io/circleci/container-agent/helm
  2. Next, run the following:

    helm repo update
  3. Then, run the following command to create the circleci Kubernetes namespace:

    kubectl create namespace circleci
  4. Create a file called values.yaml file containing the following:

    agent:
      resourceClasses:
        namespace/my-rc:
          token: <resource_class_token>
  5. Finally, run the following command:

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

Container runner configuration example

Once you have installed the container runner within your cluster, create and trigger a CircleCI job that uses the Docker executor to validate the installation. The fields you must set for a specific job to run using your container runners are:

  • image:

  • resource_class: <namespace>/<resource-class>

Simple example of how you could set up a job (cimg/base:2021.11 is a commonly used CircleCI Docker image):

version: 2.1

jobs:
  build:
    docker:
      - image: cimg/base:2021.11
    resource_class: <namespace>/<resource-class>
    steps:
      - checkout
      - run: echo "Hi I'm on Runners!"

workflows:
  build-workflow:
    jobs:
      - build

Troubleshooting

Refer to the Troubleshoot Container Runner section of the Troubleshoot Self-hosted Runner guide if you encounter issues installing or running container runner.


Help make this document better

This guide, as well as the rest of our docs, are open source and available on GitHub. We welcome your contributions.

Need support?

Our support engineers are available to help with service issues, billing, or account related questions, and can help troubleshoot build configurations. Contact our support engineers by opening a ticket.

You can also visit our support site to find support articles, community forums, and training resources.