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
sxlimits list --kubeconfig /path/to/kubeconfig

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


LimitRange not found

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

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

Fix: List existing LimitRanges first:

kubectl get limitrange -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: ["limitranges"]
    verbs: ["get", "list", "create", "update", "patch", "delete"]

Resize produces unexpected values

Symptom: After sxlimits 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.

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.


adjust panics with nil map

Symptom: The adjust subcommand panics with a nil map dereference.

Cause: This was a known bug (Bug #6) fixed in v0.2.10. Upgrade to the latest version.

Fix:

sxlimits version  # verify you are on v0.2.11 or later


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/sxlimits:latest list