Skip to content

Troubleshooting

Kubeconfig not found

Symptom: The binary exits immediately with an error like could not load kubeconfig.

Cause: No kubeconfig file was found at the default path (~/.kube/config) and no --kubeconfig flag was provided.

Fix:

# Point to your kubeconfig explicitly
sxquotas list --kubeconfig /path/to/kubeconfig

# Or export it as an environment variable
export KUBECONFIG=/path/to/kubeconfig
sxquotas list


ResourceQuota not found

Symptom: adjust, resize, or delete exits with resourcequota not found.

Cause: The ResourceQuota name provided does not exist in the target namespace.

Fix: List existing ResourceQuotas first:

kubectl get resourcequota -n <namespace>


Insufficient permissions

Symptom: API calls return forbidden errors.

Cause: The kubeconfig service account or user does not have the required RBAC permissions.

Fix: Grant the following permissions in the target namespace:

rules:
  - apiGroups: [""]
    resources: ["resourcequotas"]
    verbs: ["get", "list", "create", "update", "patch", "delete"]

Resize produces unexpected values

Symptom: After sxquotas resize <name> <factor>, values are not what you expected.

Cause: CPU values are stored in millicores (m). The resize factor is applied to the parsed integer value. Memory values are stored in the unit specified by the existing quota (Mi, Gi, etc.).

Fix: Run with --debug to see the before/after values at each step. Refer to the adjust subcommand doc for details on how values are computed.


Docker image cannot reach the cluster

Symptom: The container exits immediately when run with podman run or docker run.

Cause: The container cannot access the kubeconfig or the cluster API endpoint.

Fix: Mount the kubeconfig into the container:

podman run --rm \
  -v ~/.kube/config:/root/.kube/config:ro \
  docker.io/startx/sxquotas:latest list