The Simplest Way to Make Google Pub/Sub and Tekton Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Using google pub/sub and tekton together lets cloud events start build tasks right away. The message queue sends alerts to an event listener that runs your cluster steps. Teams use this setup to build apps when code changes or data lands. You do not need slow timers that check for new work every minute. Instead, a cloud event pushes a message that starts the right build pipeline. This keeps your build cluster idle until real work arrives in the queue. How google pub/sub and tekton pass identi

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.

Using google pub/sub and tekton together lets cloud events start build tasks right away. The message queue sends alerts to an event listener that runs your cluster steps.

Teams use this setup to build apps when code changes or data lands. You do not need slow timers that check for new work every minute. Instead, a cloud event pushes a message that starts the right build pipeline. This keeps your build cluster idle until real work arrives in the queue.

How google pub/sub and tekton pass identity and data

First, an app or cloud service writes a message to a topic. The message holds data about a code push, a file upload, or an alert. Next, a push subscription sends that message over HTTPS to your cluster listener. Pull subscriptions also work when your cluster sits behind a strict firewall.

The listener checks the message header and body before it starts any task. Cloud topics sign each push request with a token from a service account. Your cluster must check this token to prove the message came from your project. After the check passes, the listener maps message fields into task inputs.

Then the task runner starts a fresh pod to do the actual work. That pod needs its own cloud role to read code or push images. Using workload identity lets the pod trade its cluster token for a cloud token. This flow avoids storing static key files inside your cluster secrets.

Common failure modes and how to scope roles

Many teams make the mistake of sharing one service account across all builds. When every task uses the same role, a test job can touch prod data. Static keys stored in cluster secrets also create a huge risk for teams. Those keys rarely expire, and anyone with secret read rights can copy them.

Unlogged database queries during a build step cause another big blind spot. A task might run a script against a live database to update schemas. Standard build logs only show that the step ran, not the exact queries. If a script reads customer emails or card numbers, you need clear audit trails.

End-to-End Encryption + Tekton Pipeline Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix identity sprawl, give each build pipeline its own cloud service account. Grant only the exact topic read or image write permissions that specific job needs. Bind each cluster service account to one cloud role using workload identity rules. This stops a dev build from reaching prod buckets or prod topics.

You should also lock down network paths between the message queue and the listener. Use private network links or strict firewall rules to block public traffic. Check every incoming payload so bad data cannot run rogue commands in pods. Finally, mask sensitive fields like phone numbers or national IDs in your build logs.

Keeping event builds fast and safe at scale

High event volume can flood your cluster with too many build pods at once. If a topic gets a thousand messages, your nodes might run out of memory. Set clear limits on how many task pods can run at the same time. If a build fails to start, let the subscription retry with a slow backoff.

Dead-letter topics help catch bad messages that fail over and over again. When a task crashes five times, move that event to a holding topic. Engineers can inspect the bad payload there and fix the broken pipeline rule. This keeps one bad message from blocking the rest of your team.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should I use push or pull subscriptions for build triggers?

Use push when your listener has a safe endpoint that accepts signed cloud requests. Use pull when your cluster runs in a private network that blocks incoming traffic.

How do I stop duplicate messages from running two builds?

Check the unique message ID inside your listener before starting a new task run. Your listener or task script can skip IDs that already started a build.

What is the safest way to give build pods cloud permissions?

Use workload identity to link a cluster service account to a cloud role. This gives pods short tokens and removes the need for saved key files.

The query runs. The emails stay hidden.