The Simplest Way to Make Gitea and Linkerd Work Like They Should
Running gitea and linkerd together adds mutual TLS encryption to internal Git traffic. This setup lets build runners pull code over verified service mesh routes. Teams self-host Gitea to keep source code inside their own cluster. Linkerd wraps those pods in a service mesh that encrypts network packets. When you pair them, you control which cluster workloads can reach your Git server. You also get clear metrics on request rates and error counts. How identity and traffic flow between gitea and
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.
Running gitea and linkerd together adds mutual TLS encryption to internal Git traffic. This setup lets build runners pull code over verified service mesh routes.
Teams self-host Gitea to keep source code inside their own cluster. Linkerd wraps those pods in a service mesh that encrypts network packets. When you pair them, you control which cluster workloads can reach your Git server. You also get clear metrics on request rates and error counts.
How identity and traffic flow between gitea and linkerd
Gitea runs as a stateful workload inside your Kubernetes cluster. It needs routes for web traffic, SSH Git pushes, and database calls. When you add the Gitea namespace to Linkerd, the mesh injects a sidecar. This sidecar sits next to the Gitea container inside the same pod.
The Linkerd sidecar intercepts all TCP and HTTP traffic entering or leaving the pod. It uses short-lived certificates tied to Kubernetes service accounts to verify peer pods. When an internal CI runner pulls code over HTTP, both sidecars check each other's identity. They encrypt the traffic in transit without needing manual TLS certs inside Gitea.
User logins still happen inside Gitea through your identity provider or local accounts. Linkerd handles workload identity at the network layer between cluster services. Gitea handles user roles and repo permissions at the app layer. Keeping these two layers separate makes your security model much easier to manage.
Common failure modes and how to scope network paths
A common problem happens with SSH traffic on port twenty-two. HTTP traffic gets rich metrics and routing rules inside the service mesh. Raw TCP traffic like SSH needs explicit port config so the sidecar handles it right. If you miss this step, Git clones over SSH will hang or drop.
Another risk comes from shared service accounts across your build runners. If every pod uses the default service account, mesh authorization policies cannot tell them apart. Any compromised pod in that namespace could reach the Gitea API. You should give each runner pool its own Kubernetes service account.
End-to-End Encryption + Linkerd Security Features: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Broad personal tokens inside Gitea also create big blind spots. Teams often create one admin token for webhooks and automation scripts. When that token leaks, an attacker gains full write access to every repo. Instead, create bot accounts with narrow read or write roles for single repos.
Database calls from Gitea also need careful scoping. Gitea stores repo metadata, issues, and user keys in a relational database. Put that database in its own meshed namespace and write strict server authorization rules. Only the Gitea service account should have permission to talk to the database port. Unlogged queries or direct engineer connections to that database bypass Gitea audit logs. Lock down the network path so only the app pod can reach the data store.
Auditing Git and database actions in your cluster
Linkerd logs connection metadata like source pod, target pod, and response codes. Still, a service mesh does not inspect the contents of database queries or admin sessions. When engineers debug Gitea in production, they often need direct access to the pod or database.
Relying on shared kubeconfig files or static database passwords breaks your audit trail. You need a way to tie every admin action back to a real person. You also want to mask sensitive fields like emails or phone numbers in query results. Combining mesh network rules with strong session controls gives you full visibility across the stack.
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
How does Linkerd handle Gitea SSH connections?
Linkerd treats SSH as opaque TCP traffic rather than HTTP traffic. It still encrypts the packets with mutual TLS between meshed pods inside the cluster. For external users pushing code over SSH, configure your ingress controller to pass TCP traffic through.
Should we put the Gitea database inside the Linkerd mesh?
Yes, meshing the database pod encrypts traffic between Gitea and its storage backend. It also lets you enforce strict policy rules based on Kubernetes service accounts. This stops other cluster workloads from opening connections to the database port.
Can Linkerd replace Gitea user authentication?
No, Linkerd only verifies workload identity between pods at the network layer. You still need OIDC, SAML, or local accounts inside Gitea to log in human users. Use both layers together to secure both service traffic and user actions.
Related guides
In this post