Skip to content

Instantly share code, notes, and snippets.

@izzyleung
Last active September 25, 2024 16:49
Show Gist options
  • Select an option

  • Save izzyleung/e87b4bf6440a4d063bc54090cc3d3a3d to your computer and use it in GitHub Desktop.

Select an option

Save izzyleung/e87b4bf6440a4d063bc54090cc3d3a3d to your computer and use it in GitHub Desktop.
Run TeamCity agents in your Kubernetes cluster

How to run TeamCity agents in your Kubernetes cluster

For typical CI/CD tasks that don't require Docker daemon access, use the agent.yml pod sepc.

For CI/CD jobs that need Docker daemon to build Docker images, use the privileged-agent.yml pod spec.

apiVersion: v1
kind: Pod
metadata:
name: teamcity-build-agent
spec:
containers:
- name: teamcity-build-agent
image: jetbrains/teamcity-agent:2020.1 # Change this version tag with your server.
imagePullPolicy: IfNotPresent
apiVersion: v1
kind: Pod
metadata:
name: teamcity-build-agent
spec:
containers:
- name: teamcity-build-agent
image: jetbrains/teamcity-agent:2020.1 # Change this version tag with your server.
imagePullPolicy: IfNotPresent
env:
- name: DOCKER_IN_DOCKER
value: start
securityContext:
privileged: true
runAsUser: 0
@joeybenamy
Copy link

This saved my life

@omers
Copy link

omers commented Mar 28, 2024

Is there any way to autoscale it and authorize the agent automatically ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment