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.

Revisions

  1. izzyleung revised this gist Jun 2, 2020. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -3,3 +3,13 @@
    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.

    # Notes

    Make sure you are running TeamCity server version >= 2020.1 or have the [Kubernetes support plugin](https://plugins.jetbrains.com/plugin/9818-kubernetes-support) installed.

    Create a new cloud profile in your cloud profiles settings.

    For the agent image configuration popup, choose "Use custom pod template", then fill in content of the YAML file below that matches your need.

    You might want to create two Agent pool and two Cloud Profiles, for privileged and unprivileged agents respectively.
  2. izzyleung created this gist Jun 2, 2020.
    5 changes: 5 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # 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.
    9 changes: 9 additions & 0 deletions agent.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    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
    15 changes: 15 additions & 0 deletions privileged-agent.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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