Scale Your Automated Builds with TeamCity and Kubernetes Integration

Deploy TeamCity build agents to your Kubernetes cluster for a robust and scalable CI/CD solution, in the cloud or bare metal.

Continuous Integration and Continuous Delivery Pipelines for Kubernetes with TeamCity

Kubernetes allows teams to “abstract” themselves from using and being dependent on bare metal servers. With the help of Kubernetes, users get a consistent, continuous service: IT teams can stop using any server at any time, take it away for maintenance, and then put it back.

Kubernetes also allows you to optimize resources by launching several tasks on the same server.

With TeamCity and Kubernetes integration, operations teams don’t need to choose between over-provisioning and risking a reduced server availability when contention for resources increases.

Choose your TeamCity format:

Integrate TeamCity with Your Kubernetes Cluster

Thanks to the Kubernetes Support plugin, TeamCity can run build agents in your Kubernetes cluster. The plugin is bundled with TeamCity, so you don’t have to download or install it separately.

  • Implement a scalable CI/CD architecture on top of Kubernetes. Build agents can be launched automatically when you need them, do their job, and then be removed after the build is completed. TeamCity will start containers with installed TeamCity agents on demand while distributing a build queue.
  • Native Docker support. TeamCity lets you automate CI/CD for projects of any size and complexity while using Docker for every step of your pipeline.
  • Run every build in an isolated environment by setting up every project with its own cloud profile which points to its own Kubernetes cluster.
  • Leverage the elasticity of your cloud-hosted infrastructure while taking advantage of Kubernetes’ intelligent resource allocation and resilient design.
  • Run parallelized tasks with the help of Kubernetes pods. Pods are allocated to cloud-hosted machines as efficiently as possible, maximizing the potential for tasks to run in parallel. Once a task is complete, the pods that were being used for that task are either terminated to free up resources or left running in line with your settings.

Improving deployment management with Kubernetes

TeamCity’s native support for Docker enables a fully containerized continuous integration and deployment process.

Container images

Create new container images and publish them to your container registry with the Docker build runner, ready to deploy to your Kubernetes-managed pre-production environments.

Configure testing and staging environments

Configure testing and staging environments that closely match production and let Kubernetes roll out your latest builds, which are ready for automated integration and end-to-end tests, and manual verification.

Detailed reporting

TeamCity provides detailed reporting for automated testing, with results reported on the fly, complete with links to the relevant logs and stack traces so you can investigate failures immediately.

Helm build runner for mirroring your live environment

Use the Helm build runner (available as a plugin) to configure Kubernetes workloads and ensure that your pre-production deployments mirror your live environment.

Get started with Kubernetes CI/CD

For a fully scalable, highly resilient continuous integration and deployment pipeline, configure a Kubernetes cluster to handle your CI build jobs and deploy your containerized application to Kubernetes-hosted testing and staging environments that accurately replicate your production system.

To configure TeamCity to use Kubernetes cluster resources:

  • Set up a Kubernetes cluster to host your TeamCity build agents. Choose between using a Kubernetes hosting service, such as GKE from Google Cloud or Amazon EKS, or hosting Kubernetes yourself in the cloud or on bare metal servers.
  • To host both build jobs and test environments on the same cluster, configure dedicated namespaces in Kubernetes.
  • Grant TeamCity the relevant write permissions to your cluster.
  • From TeamCity, configure a Kubernetes Cloud Profile and specify the Cloud Agent settings. To set the limits on the compute resources available to each instance of a TeamCity build agent or to configure the restart policy, use a custom pod template.
  • Configure TeamCity to use the cloud agent for build jobs.

FAQ

How does TeamCity and Kubernetes integration work?

Each time a new job is added to the build queue, TeamCity identifies a compatible build agent image and then passes the request to Kubernetes. The container orchestrator either identifies an existing pod with the correct build agent or spins up a new pod to meet the demand. Multiple containerized build jobs can run on the same virtual machine, without any risk of interference.

How do I get started with Kubernetes and TeamCity?

With TeamCity’s support for Kubernetes, you can leverage the full benefits of highly scalable, resilient infrastructure for both your build jobs and automated tests. Find out more about the benefits of CI/CD, the purpose of a CI/CD pipeline, and considerations for building a cloud-hosted CI/CD pipeline from our CI/CD Guide.

Ready to get started? Integrate TeamCity with your Kubernetes clusters and run your first build in a Kubernetes continuous integration and deployment pipeline.

Get started with TeamCity

Powerful CI/CD for teams that use Kubernetes