Skip to content

Instantly share code, notes, and snippets.

@jesuino
Last active January 14, 2026 13:52
Show Gist options
  • Select an option

  • Save jesuino/1828fcfb686ea78b86540e72712e2059 to your computer and use it in GitHub Desktop.

Select an option

Save jesuino/1828fcfb686ea78b86540e72712e2059 to your computer and use it in GitHub Desktop.
Kimi response for kind on linux and host.docker.internal

I'll help you troubleshoot the localhost resolution issue in your Kind cluster on Podman. Let me search for the most current information about this specific setup. Based on my research, this is a known issue with Podman on Linux. The host.containers.internal and host.docker.internal entries are not being reliably added to /etc/hosts in Kind clusters. Here are the main solutions:

Primary Solutions

1. Network Backend Configuration (Most Common Fix)

The issue is often related to Podman's network backend. Try changing from pasta to slirp4netns:

Edit your ~/.config/containers/containers.conf file:

[network]
default_rootless_network_cmd = "slirp4netns"

Then restart your Kind cluster.

2. Manual Host Addition

Add the host entries manually when creating your Kind cluster:

kind create cluster --config kind-config.yaml

Create a kind-config.yaml:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  extraPortMappings:
  - containerPort: 30000
    hostPort: 30000
  kubeadmConfigPatches:
  - |
    kind: InitConfiguration
    nodeRegistration:
      kubeletExtraArgs:
        node-labels: "ingress-ready=true"

3. Podman Network Configuration

For Podman 5.0+, the default network backend changed. You can also try:

# Check your current network backend
podman info --debug | grep -i network

# If using pasta, try switching to slirp4netns
podman network create kind-network
kind create cluster --network kind-network

4. Direct IP Access

As a workaround, find your host's IP and use it directly:

# Get your host IP
ip route show default | awk '{print $3}'

# Or use this in your pods
curl http://$(ip route show default | awk '{print $3}'):8080

5. Custom DNS Configuration

Create a custom DNS configuration:

# Create a custom resolv.conf
echo "nameserver 8.8.8.8" > custom-resolv.conf
echo "nameserver 8.8.4.4" >> custom-resolv.conf

# Run Kind with custom DNS
podman run --rm -v $(pwd)/custom-resolv.conf:/etc/resolv.conf:Z kind create cluster

Quick Test

After applying any of these solutions, test the resolution:

# Create a test pod
kubectl run test --image=busybox --rm -it -- sh

# Inside the pod, test:
nslookup host.containers.internal
# or
nslookup host.docker.internal

The network backend change (solution #1) has been the most successful for users experiencing this exact issue. Would you like me to help you implement any of these solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment