How a cluster takes web traffic: "public" (ports 80 and 443 on every server but build-only ones), "tailscale" (only from the tailnet, or only inside the cluster without Tailscale) or "tunnel" (through Cloudflare Tunnel, with no ports 80 and 443 open). For "tunnel", the team's Cloudflare token needs Cloudflare Tunnel:Edit and SSL and Certificates:Edit, and the cluster's install must be Pyo's (run its connect command first when it's older). Domains in zones of the tunnel's account move to the tunnel. Those with a DNS record Pyo didn't make wait for setDomainTunnel with replace. Pyo does the Cloudflare work in the background: the cluster's tunnel shows how it's going. Team owners and admins. Prefer setClusterPaths.
API key access: full.
apiKeyAuthorizationBearer <pyo_…>An API key from the dashboard's API keys page: Authorization: Bearer pyo_…. Keys can expire, and an expired one gets a 401.
application/jsonHow a cluster takes web traffic: "public" (ports 80 and 443 on every server but build-only ones), "tailscale" (only from the tailnet, or only inside the cluster without Tailscale) or "tunnel" (through Cloudflare Tunnel, with no ports 80 and 443 open). For "tunnel", the team's Cloudflare token needs Cloudflare Tunnel:Edit and SSL and Certificates:Edit, and the cluster's install must be Pyo's (run its connect command first when it's older). Domains in zones of the tunnel's account move to the tunnel. Those with a DNS record Pyo didn't make wait for setDomainTunnel with replace. Pyo does the Cloudflare work in the background: the cluster's tunnel shows how it's going. Team owners and admins. Prefer setClusterPaths.
API key access: full.
op*"setClusterTraffic""setClusterTraffic"clusterId*stringmode*stringdefaultDomain?|A zone of the token (its apex, like "example.com"): services get names under it, and *.example.com goes through the tunnel. Optional.
accountId?|The Cloudflare account for the tunnel, when the token's zones are in more than one.
portsPublic?|Public TCP and UDP ports stay on the servers in tunnel mode (they don't go through the tunnel). On by default.
Done. Always ok: true, and some operations add more, such as a new API key or a join command. A warning comes with a change that went through but won't fully take effect yet, such as more replicas than the servers have room for.
application/jsoncurl -X POST 'https://your-pyo.example.com/api/v1/ops' \
-H 'Content-Type: application/json' \
-d '{
"clusterId": "cl_8kq2x7ad",
"mode": "example",
"op": "setClusterTraffic"
}'{}