kubectl access to troubleshoot your application in a customer’s cloud. This guide limits access to pod inspection and exec in app-system, with a 30-minute grant.
Just-in-time access means you hold no standing credentials for the environment. You request access when you need it, your customer approves it, and the access ends on its own when the window closes.
The example uses a support-debug permission set, a customer-prod environment, the app-system namespace, and an api installation. Substitute your own names.
Before you start
The requester and the approver must be different identities. The server rejects an approval by the identity that made the request.
You also need:
customer-prodrunning components that support permission sets. See provisioning prerequisites.- kubectl v1.31 or newer. Ryvn bridges pod exec over WebSocket, and older kubectl negotiates SPDY instead.
app-systemmanaged by Ryvn in that environment, either declared on the environment or created for an installation. AnamespaceNamesscope does not cover namespaces Ryvn does not manage.- A namespace that is not reserved. Ryvn refuses
ryvn-system,kube-system,kube-public,kube-node-lease, andobservability.
Step 1: Create the permission set
Environment administrator. A permission set is a named set of Kubernetes RBAC rules paired with a Ryvn scope.- CLI
- Dashboard
create on pods/exec, so that verb is the one the set needs.
Add pod logs only if your team needs them:
secrets, wildcards (*), or a cluster scope. Every rule you add applies for the full duration of every grant issued against the set.
Read back what you published:
Step 2: Require approval on the environment
Environment administrator. Set the environment’s Connect mode to by-request so no one reaches the cluster without an approved grant.- Dashboard
- GitOps
Go to Environments → customer-prod → Settings → Ryvn Connect, choose By request only, then click Save Connect access.
Two other modes exist. Default access (
mode: default with a defaultPermissionSet) grants that one set without approval and follows its latest revision. Off (mode: off) blocks new access and revokes active grants. An environment that has never set connect keeps its previous role-derived behavior.Step 3: Request access
Request 30 minutes of access and include the reason:--reason is required. --duration defaults to 1 hour and cannot exceed 8 hours. An undecided request expires after 24 hours, which is a deadline for the decision, not the length of the access.
While an identical request is still pending, running the same command again returns that request instead of creating a second one. Change the reason or duration and you create a new request.
Check on it without re-requesting:
Step 4: Approve
Your customer approves in the dashboard Inbox, or under Environment → Access requests on their stack. Pending only lists what needs a decision; All requests and View grants show decisions already made. Each request shows the requester, the environment, the permission set and its revision, the requested duration, and the reason. Expand it to read the rules before deciding. Approval accepts exactly what was requested; there is no field for trimming the namespace or dropping a verb. To narrow it, deny the request and ask for a different permission set.- Dashboard
- CLI
Click Approve, or Deny with a note.
kubectl command. A new request emits an access_request.pending notification to any Slack destination subscribed to that event.
Step 5: Connect and debug
Run the resume command the CLI printed. In the dashboard, use Copy resume command on your own pending request, or Copy connect command once it is approved. Both commands pin the org, so prefer them over retyping:-- <command> to run one command and exit instead.
-n app-system explicitly. Every request is authorized against the namespace it names, so a command in another namespace is denied, and so is a cluster-wide request such as kubectl get pods -A. A command without -n uses your current context’s namespace, which is denied when that namespace is outside the grant.
Reconnect as often as you need while the grant lasts. A single exec or watch stream is capped at 15 minutes; run the command again for a new stream. Add --kubeconfig to write a context into ~/.kube/config for your own tooling; it stops working when the grant ends. Only pod exec is bridged, so kubectl attach and kubectl port-forward are refused.
Step 6: Revoke access
Revoke your own grant when you are finished. Your customer can revoke any grant on their environment.Troubleshooting
Status stays approval_pending
Status stays approval_pending
Nobody has decided yet, and re-running
ryvn connect returns the same request. Ask a developer or operator on the environment other than yourself to decide. Undecided requests expire after 24 hours.Approved, but connect returns materialization_pending
Approved, but connect returns materialization_pending
The grant is valid and the environment has not confirmed the revision on the cluster yet. The agent may be updating, disconnected, or running components that predate permission sets. Retry shortly; if it persists, ask the environment administrator to check the environment’s deployed components. Readiness can also cause the server to refuse an approval.
kubectl access is not enabled for this environment
kubectl access is not enabled for this environment
The environment has no access relay for Ryvn Connect, independent of permission sets. Ask the environment administrator to enable Connect for it.
This request is outside the permission set granted to your session
This request is outside the permission set granted to your session
The verb, resource, and namespace of that one request are not in the revision your grant pinned. Common causes are a different namespace, a cluster-wide request, a subresource the rules omit such as
pods/log, or exec rules missing a verb. Check the pinned revision with ryvn describe permission-set support-debug --revision <revision-id>. Editing the set does not change a grant already approved.This session is not permitted to exec into pods
This session is not permitted to exec into pods
The set’s
pods/exec rule lacks create, the verb exec requests are authorized against. Publish a revision granting create on pods/exec and request again.Exec requires WebSocket streaming
Exec requires WebSocket streaming
kubectl is negotiating SPDY. Upgrade to kubectl v1.31 or newer.
Namespace not found, or forbidden despite matching the name
Namespace not found, or forbidden despite matching the name
A
namespaceNames scope covers only namespaces Ryvn manages in that environment. Confirm the name with ryvn describe installation api -e customer-prod, and confirm the namespace is declared on the environment or created for an installation. Reserved namespaces are always refused.Multiple grants, or the wrong org or profile
Multiple grants, or the wrong org or profile
multiple_grants means more than one active grant applies; choose one with ryvn connect customer-prod --grant <grant-id>. If a permission set or environment appears not to exist, check ryvn auth status and pass --profile for the org that owns the environment.Related
- Deployment Approvals for the same review model applied to changes
- Access Policy for the roles that decide who may request, approve, and revoke
- Ryvn CLI for installation, profiles, and authentication