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 |
Is there any way to autoscale it and authorize the agent automatically ?
This saved my life