1

I have some docker containers running with docker compose (node.js, databases, nginx...). I have also a minikube Kubernetes cluster.

I am trying to communicate from node.js container to Kubernetes to manage some nodes (using Kubernetes API and the config file generated). But I can't get access to the Kubernetes, I tried to ping minikube IP from a docker container but I get not connection. But from my local machine, works without problems.

Someone can help? What is wrong?

My machine is a Linux Ubuntu 20.04 and minikube uses docker driver.

Alvaro98
  • 64
  • 5
  • 1
    You probably just need to set up routing from the docker interface to whatever interface the cluster is connected to. This answer might help: https://askubuntu.com/questions/1100432/iptables-setup-for-routing – joshmeranda Jun 07 '22 at 02:55
  • 1
    Can you run your management tools inside Kubernetes, with a Kubernetes service account to talk to the Kubernetes API? The standard Kubernetes SDKs should handle this case without any special setup. – David Maze Jun 07 '22 at 10:27

1 Answers1

0

For Kubernetes to work, you need to have two network interfaces configured. One in a private network and another in dhcp that allows you to get an internet connection. You must take into account that the dhcp address will coincide with the ip used at the time of initializing the cluster, so you must assign a static ip. Check your etcd.yaml file

maybe this network file configuration can help you

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp0s3:
        addresses: [10.0.0.1/24]
        dhcp4: no
        dhcp6: no
    enp0s8:
        addresses: [192.168.XX.XX/24]
        dhcp4: true
        dhcp6: no