The Simplest Way to Make Harness and Rancher Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use harness and rancher together to ship apps to Kubernetes clusters with less manual work. Harness runs the delivery pipeline while Rancher manages the target clusters and user roles. This pairing lets engineers push code updates without logging into every single node by hand. You set up the pipeline once, and the two tools handle the rollout steps. How harness and rancher share keys and roles Harness needs a way to talk to the clusters that Rancher controls. A worker agent sits insid

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 harness and rancher together to ship apps to Kubernetes clusters with less manual work. Harness runs the delivery pipeline while Rancher manages the target clusters and user roles.

This pairing lets engineers push code updates without logging into every single node by hand. You set up the pipeline once, and the two tools handle the rollout steps.

How harness and rancher share keys and roles

Harness needs a way to talk to the clusters that Rancher controls. A worker agent sits inside your network and pulls jobs from the pipeline server. This worker then sends commands to the cluster API that Rancher manages.

To make this work, an admin creates a service account or API key in Rancher. The admin puts this key into the pipeline secret store so the worker can log in. When a build runs, the worker uses that key to push new container images. Rancher checks the role tied to that key before it allows any changes.

Data flows in both directions during a normal rollout. The pipeline sends manifest files and pod specs to the cluster API. The cluster sends back health status and pod logs so the pipeline knows the rollout worked. If a pod fails to start, the pipeline reads that error and rolls back the change.

Common risks with shared keys and broad access

Many teams take shortcuts when they first wire these two platforms together. The most common mistake is giving the pipeline a cluster admin key. If one pipeline has full admin rights, any person who edits that pipeline owns the whole cluster. A bad script or a leaked token can wipe out every namespace at once.

Shared service accounts also ruin your audit logs. When ten teams use the same pipeline worker, every action in Rancher looks the same. You cannot tell which engineer pushed a bad config or read a secret value. Security teams see the worker name in the log, not the human who clicked the run button.

Rancher Access Control + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another big issue happens when a deploy fails and an engineer needs to fix it. The engineer often asks for a static kubeconfig file to run commands from a laptop. Once you hand out static cluster keys, you lose control over what people run. Those keys sit on laptops for months and bypass all the rules in your pipeline.

To fix the pipeline side, scope each worker to a single namespace and role. Create a separate Rancher project for each app team in your company. Give each pipeline worker a narrow role that can only write to its own project. Lock down the network path so only known worker nodes can reach the cluster control plane.

Keeping human debug sessions safe and clean

Scoping the pipeline worker only solves half of the access problem. Engineers still need a safe way to check live pods and databases when an app breaks. If they log into Rancher with broad human roles, they might run a bad delete command. They might also query a database pod and pull sensitive customer rows onto their screen.

Good teams match every human action to a real identity from their login provider. They check each command or query before it hits the cluster or database. They also use data masking to rewrite sensitive fields like emails, phone numbers, and card numbers in query results. This way, an engineer can check a broken state without exposing private user data or using a shared admin key.

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

Where should the Harness worker run when connecting to Rancher?

Run the worker inside the target cluster or in a private network that can reach the Rancher API. This keeps cluster traffic off the public internet and lets you lock down firewall rules.

How do we stop pipelines from changing every cluster in Rancher?

Do not use a global admin token for your deploy jobs. Create a dedicated role scoped to one project or namespace, and bind each worker to its own narrow role.

What is the safest way for engineers to debug a failed rollout?

Avoid handing out static kubeconfig files or shared admin accounts for manual fixes. Tie every live session to the user identity, log every command, and limit what actions each role can run.

The query runs. The emails stay hidden.