The Simplest Way to Make Bitbucket and Linkerd Work Like They Should
Teams use bitbucket and linkerd to ship code into a secure service mesh. Bitbucket runs the build pipeline, and Linkerd encrypts traffic between your cluster pods. This pairing lets your team push code updates with strong network rules. Your build runner talks to the cluster API to update app pods. Then the service mesh adds sidecar containers to those new pods. Every pod gets mutual TLS right when it starts up. How bitbucket and linkerd share identity and data The build runner needs a clear
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.
Teams use bitbucket and linkerd to ship code into a secure service mesh. Bitbucket runs the build pipeline, and Linkerd encrypts traffic between your cluster pods.
This pairing lets your team push code updates with strong network rules. Your build runner talks to the cluster API to update app pods. Then the service mesh adds sidecar containers to those new pods. Every pod gets mutual TLS right when it starts up.
How bitbucket and linkerd share identity and data
The build runner needs a clear way to log in to your cluster. Most teams use OpenID Connect tokens or scoped cluster service accounts for this step. Bitbucket sends a signed token to the cluster during the deploy step. The cluster checks this token before it allows any pod changes.
Next, the pipeline applies your app manifests to the target namespace. The cluster API alerts the Linkerd control plane about the new pod request. A webhook modifies the pod spec to add the mesh sidecar container. The mesh identity service then sends a short-lived TLS certificate to that pod.
Data flows along two distinct paths in this setup. Control data moves from your Bitbucket runner to the cluster API server. App traffic stays inside the cluster and flows through the Linkerd data plane. Separating these two paths keeps your network clean and easy to audit.
Common failure modes and how to scope roles
Many teams make the mistake of using one broad cluster admin token. They store this static key in Bitbucket and share it across all repos. If a bad actor steals that key, they can delete the whole mesh. Static keys also fail when someone forgets to rotate them on time.
Unlogged cluster commands create another big blind spot for security teams. When five pipelines share one account, the logs show the same generic user. You cannot tell which repo or developer broke a mesh traffic rule. Data masking can rewrite emails or card numbers in logs, but identity comes first.
End-to-End Encryption + Linkerd Security Features: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You can fix this by giving each repo its own scoped cluster role. Map each Bitbucket pipeline identity to a single namespace in your cluster. Allow the runner to update app deployments, but block changes to mesh control planes. Keep the Linkerd control plane in a locked namespace with strict role rules.
Testing mesh traffic rules in your build pipeline
A good pipeline checks more than just app code before a release. It also checks that your service mesh rules work as expected. If a build ships with a broken traffic split, users see errors fast. Catching these network mistakes early saves hours of stressful debug work.
You can run a test step right after the deploy step finishes. Have the runner check that every new pod has a healthy sidecar container. Wait until the sidecar reports that its TLS certificates are active and valid. If the sidecar fails to start, the pipeline should roll back the change.
Teams also use canary steps to test new releases with live traffic. The pipeline updates a mesh traffic rule to send ten percent of requests to new pods. The runner reads error rates from the mesh metrics for a few minutes. When error rates stay low, the pipeline shifts all traffic to the new version.
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
How does a Bitbucket runner trigger Linkerd sidecar injection?
The runner does not need to call the service mesh directly. It applies a deployment manifest to a namespace that has the mesh injection annotation. The cluster admission controller sees this label and adds the sidecar container on its own.
Should build pipelines have permission to edit Linkerd control plane settings?
No, normal app pipelines should never touch the mesh control plane namespace. Put mesh upgrades in a separate repo with its own strict approval rules. App pipelines only need rights to update pods and traffic splits in their own namespace.
Why do my deploy steps fail right after the pod starts?
Your deploy script might try to make network calls before the sidecar is ready. The mesh proxy needs a few seconds to start and fetch its TLS certificate. Add a brief wait check in your pod spec so the app starts second.
Related guides
In this post