Platform
Cargo Operators
A Cargo Operator is an agent you host that runs CodeCargo's jobs in your own infrastructure.
CodeCargo does much of its work as jobs. Jobs scan your repositories' workflows, evaluate guardrails, run AI agents, and connect to the source servers you migrate from. By default, these jobs run on operators that CodeCargo hosts. A Cargo Operator runs them on your own Kubernetes cluster or Docker host instead.
The operator connects out to CodeCargo to receive jobs, and runs each job as a pod or container. CodeCargo never connects in to your network.
This page uses these terms:
- Operator: the record you create in CodeCargo. It has a name, an access ID, and the job categories it runs.
- Instance: one running copy of the operator. An operator can have several, on Kubernetes or on Docker hosts.
- Access token: the secret an instance uses to connect to CodeCargo and pull CodeCargo's images.
- Job category: a kind of work, such as Compliance Center evaluations. You choose which categories each operator runs, and where each category runs.
- Job slot: room for one running job. Each instance has a fixed number of slots.
Deciding Whether You Need One
Enterprise Feature
Self-hosted Cargo Operators are available on the Enterprise plan. SaaS-hosted execution is available on all plans. Talk to us about running CodeCargo in your own infrastructure, or see pricing for details.
You don't need an operator to use CodeCargo. By default, CodeCargo's hosted operators run every job, and you don't install anything.
Run your own operator when:
- Jobs need to reach a server inside your network. CodeCargo's hosted operators can reach only servers on the internet. A Migration Assistant source on a private network needs your own operator.
- Your servers use certificates from your own CA, or outbound traffic goes through an HTTP proxy. CodeCargo's hosted operators don't support a custom CA or proxy. See Internal CA and HTTP Proxy.
- You want jobs to run in infrastructure you control.
An operator runs only the job categories you choose. On plans that include per-category routing, you also choose where each category runs. A common setup is one operator that runs only Migration Assistant: source servers.
To set one up:
- Size the cluster it runs in.
- Create the operator and choose its job categories.
- Install it on Kubernetes or on a Docker host.
- Set up image pulls and, if you need them, your CA and proxy.
- Move jobs onto it.
Job Categories
There are five job categories:
- Migration Assistant: source servers: connection checks, inventory, exports, copies, and pipeline imports that reach your Bitbucket, GitLab, Azure DevOps, or GitHub Enterprise Server
- Migration Assistant: GitHub repositories: discovery, pipeline families, and rewiring on your GitHub repositories
- Compliance Center: guardrail evaluations and the guardrail editor
- Workflow sync: scanning your repositories' workflows
- AI agents and workspaces: agentic jobs, Dispatch, the AI assistants in the editor and the Policy Manager, service catalog detection, workspace commits, and MCP servers
An operator receives jobs only in the categories you select, and only while your organization runs those categories on its own operators. You set that under Where Jobs Run.
You choose an operator's categories when you create it, and you can change them later. Operators created before job categories existed run every category.
Sizing Your Cluster
Run the operator on its own node pool, with one operator instance on each node. Start with three nodes of 4 vCPU and 16 GB each. Add nodes when you need to run more jobs at once.
This section covers Kubernetes. A Docker host runs up to 20 jobs at once. See Running on a Docker Host.
| Size | Nodes (4 vCPU / 16 GB) | controller.replicas | Job slots |
|---|---|---|---|
| Small | 3 | 3 | 300 |
| Medium | 6 | 6 | 600 |
| Large | 9 | 9 | 900 |
Each node has 100 job slots if it allows 110 pods. Nodes that allow fewer pods have fewer slots. See Node Pod Capacity.
You can use any number of nodes. Set controller.replicas to the number of nodes.
Memory can also limit how many jobs a node runs at once. A busy job uses about 200 MiB of memory, and a 16 GB node runs out of memory at about 45 to 60 busy jobs. Most jobs are short, so usually only some of the running jobs are busy at the same time. If pods are evicted or killed for lack of memory, add nodes or use larger ones.
Add nodes when you see any of these:
- Work often shows Queued.
- A job shows Didn't start: no operator available.
- The operator posts Operator at capacity to Slack.
See When Every Operator Is Busy and Slack Notices from the Operator.
A Git copy of a very large repository can use about 5 GiB of memory. On a 16 GB node, it fits beside a busy operator. Don't use nodes with 8 GB of memory. A busy operator and one large copy can use more memory than an 8 GB node has.
What the Cluster Needs
- Dedicated nodes. Taint the node pool so that only the operator runs there. Give the operator the matching
controller.tolerationsandcontroller.nodeSelector. The operator sets its job slots from the node's pod limit, and its jobs must run on the same node as the operator. Other workloads on the node would use pods and memory that the operator expects to have. - One instance on each node. The operator runs as a StatefulSet. Use
controller.topologySpreadConstraintsto place one replica on each node. - Storage. Each instance has its own volume, 10Gi by default (
controller.storage.size). The volume holds copies of your active repositories and each running job's workspace. A Git copy clones the repository onto it, so make the volume big enough for the largest repository you copy. The cluster needs a default storage class, or set one incontroller.storage.className. - Outbound HTTPS. The operator and its jobs connect to
v1.connect.codecargo.com:443andapp.codecargo.com:443. Jobs also connect to GitHub and to the source servers you migrate from. Nodes pull images from the CodeCargo registry. See Sign In to Pull Images. If traffic goes through a proxy, see Internal CA and HTTP Proxy. - Kubernetes 1.29 or later. CargoWall runs as a native sidecar container in each job it protects.
- Privileged containers. The namespace must allow them, because the CargoWall sidecar runs privileged.
Helm Values for Each Size
These values are for Small. For another size, set replicas to the number of nodes. The taint and label are examples, so use your node pool's own.
controller:
replicas: 3
resources:
requests:
cpu: '2'
memory: 2Gi
storage:
size: 10Gi
nodeSelector:
node-pool: cargo-operator
tolerations:
- key: dedicated
value: cargo-operator
effect: NoSchedule
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/name: cargo-operator-controller
imagePuller:
nodeSelector:
node-pool: cargo-operator
tolerations:
- key: dedicated
value: cargo-operator
effect: NoSchedule
- By default, the chart sets no resource requests for the operator. Request 2 CPUs and 2Gi of memory, with no limit, as shown above. The operator can use up to about 4.5 GiB when it is busy. A larger request would leave less memory for jobs.
- Jobs and the update agent use the operator's tolerations. The image puller has its own, so set both.
- Leave job slots at the chart's default, which reads them from the node. See Node Pod Capacity.
Node Pod Capacity
Each node has a limit on how many pods it can run. Your cloud provider sets it, and it often depends on the node type. To see it, run:
kubectl get node <node> -o jsonpath='{.status.allocatable.pods}'
The operator uses this number minus 10 as its job slots. The 10 (controller.jobs.reservedPods) leave room for the operator and the node's system pods. A node that allows 110 pods has 100 slots. A node that allows 30 pods has 20.
The operator reads the node's limit with the ClusterRole that the chart creates. If it can't read the limit, it uses 20 slots.
Some providers let you raise a low limit. On EKS, use the maximum pods setting or prefix delegation. On GKE, set the maximum pods per node.
To set your own limit instead, turn off controller.jobs.autoDetect and set controller.jobs.maxConcurrentJobs. The limit applies to each instance.
controller:
jobs:
autoDetect: false
maxConcurrentJobs: 30
Where the Numbers Come From
The sizes are based on measured CodeCargo jobs:
- Most jobs use less than 130 MiB of memory at their peak. About 1 in 100 uses more than 350 MiB.
- When many jobs run at once, each uses about 200 MiB of memory and 0.08 CPU on average.
- The largest jobs, such as a Git copy of a large repository, use up to about 5 GiB of memory and 2.5 CPUs.
- The operator itself uses up to about 4.5 GiB of memory and 2 CPUs.
A 4 vCPU / 16 GB node has about 3.8 CPUs and 13.5 GiB of memory for pods. The exact amounts depend on your provider.
| Limit | Calculation | Jobs at once |
|---|---|---|
| Job slots | 110 pods − 10 | 100 |
| Jobs that CargoWall protects | (13.5 GiB − 2 GiB for the operator) ÷ 64 MiB | About 180, more than the slots |
| Busy jobs | (13.5 GiB − 2 to 4.5 GiB for the operator) ÷ 200 MiB | About 45 to 60 |
To size a different node, use the same calculations with its memory and pod limit.
Kubernetes reserves very little for a job. Each job runs as its own pod on the operator's node, and the operator removes the pod when the job ends. The job's container has no CPU or memory request, and you can't set one. The CargoWall sidecar requests 64Mi of memory, with a 512Mi limit. Everything else a job uses comes from the node's free memory. This is why the operator needs dedicated nodes.
Creating an Operator
Go to Organization Settings → Cargo Operators.
- Click Create Cargo Operator.
- Enter a Name for the operator.
- Choose the Job categories it runs. All categories start checked, and at least one must stay checked.
- Optionally, set Initial Token Expires At.
- Click Submit.
CodeCargo then shows an access token and setup instructions for installing the operator on Kubernetes. To run it without Kubernetes, see Running on a Docker Host.
Only organization admins can create and delete Cargo Operators. If there are none yet, admins see a Create Your First Cargo Operator button. Other members see a message asking them to contact an organization admin.
Installing on Kubernetes
Open the operator. Until it connects, the page shows its Setup instructions, with your access token, access ID, registry, and connection URL filled in. There are three steps:
- Create Namespace & Secret: create a Kubernetes namespace and store the access token in a secret.
- Install Helm Chart: install the operator with the CodeCargo Helm chart from the OCI registry.
- Verify Connection: use
kubectlto check that the operator is connected.
In step 2, add the Helm values for your size, and for your CA and proxy if you need them. Also set clusterName to a name for this cluster. The operator's Slack notices use it.
After the operator connects, you can hide the instructions. Click Setup Instructions to show them again.
The chart includes an update agent, which keeps the operator on the version CodeCargo has deployed.
Running on a Docker Host
Without Kubernetes, you can run the Docker operator on a Docker host. It runs each job as a container on that host. It is the same operator, packaged as the cargo-operator-docker image in the CodeCargo registry, and it uses the same access token.
- Run one per host, as a container with the host's Docker socket mounted. Use a supervisor such as systemd to keep it running. CodeCargo provides a sample systemd unit and run script.
- Give it the operator's name, its access token, the CodeCargo NATS URL, and an instance name that ends in a number, such as
cargo-operator-docker-0. The NATS URL iswss://v1.connect.codecargo.com. Each host that runs the same operator needs a different number. - Give each instance its own Docker volume.
- It pulls job images when it needs them, and logs in to the CodeCargo registry with the operator's token. It doesn't send credentials to a mirror you configure.
- It runs up to 20 jobs at once. To change that, set
CARGO_OPERATOR_MAX_CONCURRENT_JOBS.
The Docker operator also updates when CodeCargo deploys a new version. It stops taking new jobs and waits up to 30 minutes for its running jobs to finish. Then it exits, and its supervisor starts the new image. The operator doesn't pull or replace its own image. Jobs still running after 30 minutes run again when the operator restarts. To turn this off, start it with --disable-self-update.
Sign In to Pull Images
The operator and its jobs use images from the CodeCargo registry, which is registry.codecargo.com. Every pull needs one of these tokens:
- The access token you got when you created the operator. The registry calls it an operator token.
- A personal access token.
To log in, use the token as the password. Any username works. The setup instructions use codecargo-user. A pull without a valid token fails, and the error asks you to log in.
The registry is read-only. It serves only the images CodeCargo uses, such as the operator, the Docker operator, the update agent, the importers, CargoWall, the job agent, and the curated MCP servers. It reports any other repository as unknown.
The chart creates a pull secret from the operator's access token. This is on by default (codeCargo.createImagePullSecret). Every pod that pulls CodeCargo images uses it: the operator, the update agent, the image puller, and the jobs and MCP servers the operator starts. To pull from other registries, add your own secrets under imagePullSecrets.
- If the token is in
codeCargo.access.existingSecret, the chart reads it when you install or upgrade. Runhelm upgradeafter you rotate the token. Tools that render the chart without access to the cluster, such ashelm templateor Argo CD, fail at this step. In that case, create the pull secret yourself and setcodeCargo.existingImagePullSecret. - Operators installed before the registry required a token have no pull secret. Run
helm upgradewith the current chart to add one.
The optional natsmcp gateway (natsmcpGateway, off by default) works differently. Its image is a public package at ghcr.io/code-cargo and needs no login. If your cluster can't reach ghcr.io, set natsmcpGateway.image.registry to a mirror. Put credentials for a private mirror in controller.imagePullSecrets.
After you delete a token
A pull can still succeed for up to a minute after you delete the token.
Internal CA and HTTP Proxy
Set these Helm values if your servers use certificates from your own CA, or if outbound traffic goes through an HTTP proxy. The operator and all of its jobs use them, including for the connection to CodeCargo. If you leave them empty, the operator trusts the public root CAs and connects directly.
CodeCargo's hosted operators don't support a custom CA or proxy, so these settings need your own operator.
CA Bundle
Add the PEM certificates of the CAs that issued your servers' certificates. These servers include Bitbucket Data Center, GitHub Enterprise Server, and self-managed GitLab, and any proxy that inspects TLS. The operator trusts these CAs in addition to the public root CAs.
caBundle:
pem: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
Or use a ConfigMap in the release namespace:
caBundle:
existingConfigMap:
name: 'internal-roots'
key: 'ca.crt'
The operator won't start if the bundle contains anything other than certificates. Changing caBundle.pem restarts the operator. If you change your ConfigMap or remove the bundle, restart the controller:
kubectl rollout restart statefulset/cargo-operator-controller -n cargo-operator
If a Migration Assistant check says the operator doesn't trust a server's TLS certificate, fix the certificate or add the CA that issued it. Then try again.
HTTP Proxy
proxy:
httpsProxy: 'http://proxy.example.com:3128'
httpProxy: 'http://proxy.example.com:3128'
noProxy: 'bitbucket.example.com,.corp.example.com'
Use an http:// or https:// URL.
noProxylists hosts and domains to connect to directly, such as internal servers that the proxy can't reach. The chart always addslocalhost, in-cluster services (.svc,.cluster.local), and the Kubernetes API.- The proxy must allow
CONNECTto CodeCargo, to GitHub, and to every server your jobs reach through it. For CodeCargo, that includesv1.connect.codecargo.com:443. - Image pulls don't use this proxy. They use your nodes' container runtime proxy settings.
- SSH connections to source servers don't use an HTTP proxy.
The proxy URL is visible to jobs
Jobs get these settings as environment variables. Anyone who can read pods in the namespace can see them, and so can any process a job runs, including AI agents. Avoid putting a password in the proxy URL.
Behind a proxy, a job connects only to the proxy. CargoWall allows the proxy's host, but it can't see the final destination. Use the proxy to control that traffic. This is separate from the extra headers the importer sends to a source.
Where Jobs Run
After an operator connects, you can move jobs to it. Each job category runs either on CodeCargo's hosted operators or on your own. Set this on the Cargo Operators page.
Without per-category routing, the Self-hosted infrastructure card at the top of the page has one switch for all categories. Turn it on to run every job on your operators. Turn it off to run every job on CodeCargo's. You're asked to confirm either change.
On plans with per-category routing, a Where jobs run card replaces that switch. Each category has a row that describes it, with a choice of CodeCargo or Your operators. When you change a row, you're asked to confirm, and only that category moves.
A category can move to your operators only if one of your connected operators runs it. If none does, the row says so and links to your operators, and you can't choose Your operators. If a move fails, the card shows why, and nothing changes.
If a category runs on your operators but none of your connected operators runs it, those jobs can't run. The page names the category. To fix it, add the category to a connected operator, connect an operator that runs it, or move the category to CodeCargo.
Running jobs in two places
Running some categories on your operators and others on CodeCargo needs a plan that includes it. On any plan, you can move every category to the same place. If your jobs already run in both places and your plan no longer includes this, the Where jobs run card stays, with only Run all on CodeCargo and Run all on your operators.
You can turn off CargoWall for AI only while every category runs on your operators. Moving any category to CodeCargo turns it back on. The confirmation tells you this.
Operator List
Organization Settings → Cargo Operators lists your operators. Each one shows:
| Field | Description |
|---|---|
| Name | Links to the operator's page |
| Access ID | Unique identifier for the operator |
| Status | Connected (green) or Disconnected (gray) |
| Runs | The job categories it runs, or All job categories |
| Created | When the operator was created |
The status updates live as operators connect and disconnect.
Operator Detail Page
Click an operator's name to open its page.
Any member of the organization can open it. Organization admins see the whole page. Other members see the operator's status, details, job categories, and instances, read-only. They don't see access tokens or setup instructions, and a note tells them that an organization admin manages these.
Details
The Details card shows the operator's Status (Connected or Disconnected), Access ID, the job categories it Runs, when it was Created, and its Active Instances. Organization admins also see how many Access Tokens it has.
Changing Job Categories
Edit the list under Job categories, then click Save. Click Cancel to undo your changes. A category you remove stops right away. A category you add starts the next time the operator reconnects, within an hour. To apply it sooner, restart the operator.
Access Tokens & Instances
Organization admins see the Access tokens & instances card. Other members see an Instances card with the same instances and no token columns.
An operator can have several access tokens. Each token shows:
- Short ID: a shortened token ID
- Status: Active (green), Expired (red), or Never Used (gray)
- Expires: the expiration date, or Never
- Instances: how many operator instances use the token
Under each token are the instances that use it. Each instance shows its name, connection status, when it connected or disconnected, and when the token was last used.
Token Security
Copy a new access token right away. It isn't shown again. Store it in a Kubernetes secret or in your organization's secret manager.
To add a token, click Add Token. To change a token's expiration date or delete it, use the token's Manage menu. An operator must keep at least one token.
When Every Operator Is Busy
Each operator has a fixed number of job slots. When every operator that runs a job is full, background work waits in CodeCargo. It starts as soon as a slot is free. Background work includes service catalog scans, guardrail evaluations, workflow sync, agent runs that the Migration Assistant or a Dispatch plan starts, and Migration Assistant imports, copies, and source jobs.
Work that someone is waiting on right now doesn't wait in CodeCargo. It goes to the operator with the most free slots.
Waiting work shows Queued. A service catalog scan shows Scanning, and a guardrail evaluation runs, only after an operator picks it up.
If a job waits longer than its limit, 30 minutes by default, it ends without starting. It shows Didn't start: no operator available as a warning, and it doesn't count as a failed attempt. The message says whether every operator was busy or no operator had finished starting. Start the job again when an operator has room. A scan that didn't start shows Retry. See Service Catalog.
If your operators are often full, add nodes and instances, or connect another operator that runs those job categories. An operator can also post to Slack when it stays full. See Slack Notices from the Operator.
Slack Notices from the Operator
An operator can post to your own Slack incoming webhook. Set the webhook URL in slack.webhookUrl. The operator posts when a job fails and, by default, when it stays at capacity:
- Operator at capacity: every job slot has been in use for about 30 seconds. The post shows the cluster (
clusterName), the operator, when the episode started, the number of slots, the running, starting, and queued jobs, and the longest wait. It's posted once per episode, and at most once every 15 minutes. - Operator recovered: the slots haven't been full for 5 minutes. The post says how long the episode lasted. It's sent only after an Operator at capacity post.
To post only job failures, set slack.capacityNotices: false. To add a link to the operator's logs, set grafana.baseUrl. Without a webhook, the operator doesn't post anything. On a Docker host, use CARGO_OPERATOR_SLACK_WEBHOOK_URL and CARGO_OPERATOR_SLACK_CAPACITY_NOTICES.
