Managed Kubernetes
Latest
Frequently Asked Questions
Solutions
How Tos
Internal Only
Templates
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Kubectl Exec Command is Failing Intermittently With i/o Timeout Error
Copy Markdown
Open in ChatGPT
Open in Claude
Problem
- The kubectl exec command is failing intermittently with i/o timeout Error.
Kubectl Command
xxxxxxxxxx$ kubect exec -it <POD_NAME> -n <NAMESPACE> -- bashError from server: error dialing backend: dial tcp [WORKER_NODE_IP]:10250: i/o timeout- Corresponding API Server logs on the Master Node.
API Server Logs
E0611 [TIME_STAMP] status.go:71] apiserver received an error that is not an metav1.Status: &errors.errorString{s:"error dialing backend: dial tcp [WORKER_NODE_IP]:10250: i/o timeout"}: error dialing backend: dial tcp [WORKER_NODE_IP]:10250: i/o timeoutEnvironment
- Platform9 Managed Kubenetes - v5.9 and Higher
- Platform9 Self Managed Cloud Platform - v-5.9.2-3199093 and Higher.
Cause
- Not all nodes in the Kubernetes cluster have the
net.ipv4.ip_local_reserved_portssetting configured to reserve the NodePort range. This lead to ephemeral port conflicts and service binding failures.
The net.ipv4.ip_local_reserved_ports setting in Linux is a sysctl parameter that allows you to reserve specific local port numbers so they won’t be used for automatic port assignments during outbound connections.
Resolution
- Ensure consistent reservation of the NodePort range across
all cluster nodes (both workers and master nodes) using the
net.ipv4.ip_local_reserved_portssysctl parameter.
Implementation Steps:
- Determine the NodePort range used in your cluster. Default is
30000–32767, unless customized in the Kubernetes API server configuration. - Apply the reservation on all nodes.
sysctl command
xxxxxxxxxxecho "net.ipv4.ip_local_reserved_ports = <NODEPORT_IP_RANGE>" >> /etc/sysctl.confsysctl -p- Confirm the change is active.
sysctl command
xxxxxxxxxxsysctl net.ipv4.ip_local_reserved_ports- Use automation (e.g., Ansible, scripts, or DaemonSets) to enforce this setting across all current and future nodes.
Additional Information
- To learn more about using sysctls in a Kubernetes Cluster, refer to the Official Kubernetes Documentation.
VariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
Last updated on
Was this page helpful?
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message