The Simplest Way to Make Rook and Teamcity Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Rook and TeamCity work together by giving cloud build agents persistent storage inside Kubernetes. TeamCity runs your build jobs, while Rook manages the storage volumes that hold build caches. This pairing helps engineering teams speed up slow builds. Ephemeral build pods often lose their local data after every single run. When you add persistent volumes, your agents keep their downloaded packages and build outputs. The next build starts right away without pulling old files over the network aga

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Rook and TeamCity work together by giving cloud build agents persistent storage inside Kubernetes. TeamCity runs your build jobs, while Rook manages the storage volumes that hold build caches.

This pairing helps engineering teams speed up slow builds. Ephemeral build pods often lose their local data after every single run. When you add persistent volumes, your agents keep their downloaded packages and build outputs. The next build starts right away without pulling old files over the network again.

How data and permissions flow between Rook and TeamCity

TeamCity starts a build by talking to the Kubernetes API to create a new pod. That pod asks the cluster for a persistent storage volume before the build steps begin. Rook watches for these storage claims and tells Ceph to mount a block or file volume.

The build agent logs in to the cluster using a Kubernetes service account key. This key must have the right role to ask for storage claims in that namespace. Once the volume mounts, the agent reads old cache files and writes new build artifacts. When the job ends, the pod stops, but Rook keeps the storage volume safe on disk.

Teams also use this setup to share data across multiple agents at the same time. Rook can set up shared file systems that let many pods read one common cache. This means ten build agents can read the same base files without making ten copies. You save disk space and cut down on network traffic inside your cluster.

Common failure modes and how to scope roles

Many teams fail by giving the build server one giant cluster admin key. If a bad actor steals that broad token, they can read or delete all storage volumes. You should fix this by creating a tight role just for the build namespace. The build agent only needs permission to create pods and claim volumes in its own space.

Another common bug happens when two build pods try to write to one block volume. Standard block storage only lets one node mount and write to a disk at once. If a second pod starts on a different node, it will hang and fail to mount. You must match your volume mode to how your build agents run their jobs.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged storage changes also cause major headaches during an outage. Engineers often log in with a shared admin account to fix stuck volumes by hand. When someone deletes a volume or changes a pool rule, nobody knows who did it. Teams should tie every cluster change to a real user identity and log every command.

Network paths between build pods and storage nodes also need clear rules. Build jobs often run untrusted code from outside pull requests. If you do not lock down your network, a rogue build might scan your storage network. Use network policies so build pods only talk to the exact storage ports they need.

Finally, watch out for full disks caused by old build caches that never get cleaned up. TeamCity will keep writing data until the Rook storage pool runs out of free space. Set up clear storage quotas on each volume claim so one project cannot starve the rest. Run regular cleanup jobs to wipe out old cache folders that nobody uses anymore.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Why do my TeamCity build pods get stuck waiting for storage?

This usually happens when a block volume is still attached to an old node. Check if the previous build pod shut down clean or if you need shared file storage.

Should I use block storage or a shared file system for build caches?

Use block storage if you run one build pod per volume for fast disk speed. Use a shared file system if many build agents need to read the same cache together.

How do I stop build agents from filling up the Rook storage cluster?

Set hard size limits on every storage claim your build agents ask for. You can also use TeamCity cleanup rules to delete old files inside the cache directories.

The query runs. The emails stay hidden.