Skip to content

kubectl on Kestrel

Your kestrel context (from Install kubelogin) points at https://proxy.kestrel.arbutus.cloud. That endpoint is capsule-proxy: it forwards requests to the API server and filters cluster-scoped lists, such as kubectl get namespaces, down to your tenant.

Deploy through Git and ArgoCD (Your repo, your workloads). Use kubectl to inspect, debug and run short experiments.

Every member of your tenant has the admin role in every tenant namespace (Tenancy), so get, describe, logs, exec, port-forward, apply, delete and the rest work there. kubectl top works too, because metrics-server is installed. Use kubectl auth can-i --list -n <tenant>-prod to see the full set. ArgoCD syncs with the same roles (ArgoCD on Kestrel).

You can’tInstead
Node operations (cordon, drain, taint)Open a ticket.
Create, edit or patch Applications in argo-cdUse the ArgoCD UI, or keep the Application in one of your namespaces (Your repo, your workloads).
Create ServiceMonitors or PodMonitorsAsk RCS (Monitoring).
List or delete PersistentVolumesOpen a ticket (Persistent volumes).
Create LimitRange, ResourceQuota or ResourcePoolClaim objectsRequest quota changes (Quotas).
Create namespaces not named <tenant>-<name>kubectl create namespace <tenant>-<name>

Admission also rejects LoadBalancer, NodePort and ExternalName Services, priority classes other than uber-user-*, wildcard Ingress hosts, and Pods that violate PodSecurity restricted. These apply equally to kubectl and ArgoCD; see Known limitations.

When a Deployment’s Pods are denied, whether by PodSecurity or the namespace’s LimitRange, no Pods appear and the error is only in the ReplicaSet’s events:

Terminal window
kubectl describe replicaset -n <tenant>-prod -l app=my-app

Tenants can’t add ephemeral containers, so kubectl debug on a running Pod fails with forbidden on pods/ephemeralcontainers. Debug a copy of the Pod instead. This starts a copy with the named container’s command replaced by a shell:

Terminal window
kubectl debug my-app-7d9f8-abcde -n <tenant>-prod -it \
--copy-to=my-app-debug --container=my-app --profile=restricted -- sh
  • The copy keeps the Pod’s securityContext, so it passes PodSecurity restricted. It has no labels, so Services don’t route to it.
  • The container’s image needs a shell. To swap in another image, add --set-image=my-app=<image>; it must run as a non-root numeric UID unless the Pod sets runAsUser.
  • Delete the copy when you finish: kubectl delete pod my-app-debug -n <tenant>-prod.

With selfHeal: true (the recommended default), ArgoCD watches the resources it manages and reverts live drift within seconds. The Git poll only governs how fast new commits deploy.

On an ArgoCD-managed resourceResult
apply, edit, patch, scale, set imageReverted within seconds. Change Git instead.
deleteRecreated from Git. To remove it, delete the manifest from Git (with prune: true).
rollout restartNot reverted. The Pods roll as usual.
rollout undoReverted if the result differs from Git. Revert the commit instead.
delete podThe ReplicaSet replaces the Pod. ArgoCD sees no drift.

Resources that no Application manages are left alone.

To keep a kubectl change long enough to test it:

  1. Pause. In the ArgoCD UI, open the Application → App Details → Sync Policy → Disable Auto-Sync. For an Application in argo-cd, this is UI-only: kubectl patch there returns Forbidden.
  2. Mutate. Your kubectl apply, scale, set image and similar changes now stick. The Application shows OutOfSync.
  3. Capture or revert. To keep the change, commit it to Git first, then click Enable Auto-Sync; ArgoCD finds no drift. To discard it, click Enable Auto-Sync right away and ArgoCD restores the Git state.