Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
19 votes

How to get kubernetes pod network CIDR

This command will give you the pod CIDR addresses for each of the nodes in your cluster. kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}'
user avatar
  • 311
8 votes

How to get kubernetes pod network CIDR

This will show pod network CIDR which used by kube-proxy kubectl cluster-info dump | grep -m 1 cluster-cidr
user avatar
8 votes
Accepted

Why should you do port mapping for docker containers?

TL;DR There are a number of use cases for port mapping, but for DevOps at scale the primary reason is generally to enable mapping well-known service ports to available ports on the host. This matters ...
user avatar
  • 232
7 votes

Internal network between container Docker Compose with outgoing connection

Internal Docker networks mean there is no gateway configured to reach the outside internet, you can only reach other containers from that network. In your scenario, none of your networks should have ...
user avatar
  • 2,700
6 votes
Accepted

SSH tunneling on steroids

Assuming the following: YOUR_PC, has Redis client, SSH client, SSH access to SSH_SERVER SSH_SERVER, has SSH server, redis access to REDIS_SERVER REDIS_SERVER, has Redis server Set up the tunnel from ...
user avatar
  • 176
4 votes
Accepted

VPN container providing access to host's LAN?

I am accessing my home network with a VPN running in a docker container in my home server. That sounds similar to what you want to do. Here's how I configured it (using this docker image - note that ...
user avatar
4 votes

Networking between Docker containers

Docker actually provides DNS support for networking between containers. This means that if you define your database connection as: http://redis:6379 This will resolve redis to the correct network ...
user avatar
  • 1,157
3 votes

How to get kubernetes pod network CIDR

The --cluster-cidr / --pod-network-cidr is fed to kube-controller-manager config. You can simply do ps -ef | grep "cluster-cidr" to get what you want.
user avatar
3 votes

Why should you do port mapping for docker containers?

When you instantiate a new container it has its own networking, isolated from the host. So you can NOT access the container directly from its port. ports: - 8080:80 this command will specify ...
user avatar
3 votes
Accepted

External access to internet from Kubernetes Pods

I found the solution ... Check your network interfaces (ifconfig -a cni0). Good config is: cni0: flags=4163 mtu 1450 inet 10.244.0.1 netmask 255.255.255.0 broadcast 0.0.0.0... That ...
user avatar
  • 41
3 votes

Sending HTTP requests to private EC2 DNS from other EC2 host works, but not from container on EC2 host

There are a couple of things that you can rule out, thanks to the testing that you have already done. You know your container port has an active network socket, that is listening for and accepting ...
user avatar
3 votes
Accepted

K8s cluster in peered VPC can't reach RDS cluster

For my Peering Connection, I went to: "Actions" -> "Edit DNS Settings" -> "Allow accepter VPC (vpc-<id>) to resolve DNS of requester VPC (vpc-<id-default>) ...
user avatar
3 votes

What do skipped, rescued, and ignored results mean in ANSIBLE playbook execution?

For example, the play below - hosts: localhost tasks: - name: Task will be SKIPPED debug: msg: You will never see this message. when: false - name: Failed command will ...
user avatar
3 votes
Accepted

Kubernetes container networking between pods

Normally, you access services using the name provided by a Service resource. For example, if I have a Pod running Redis, like this: apiVersion: v1 kind: Pod metadata: labels: app: redis name: ...
user avatar
  • 347
2 votes

SSH tunneling on steroids

We have redis connected through stunnel. That way you don't have to always establish the ssh connection, which can be a problem. Here is an article on how to setup redis through stunnel, which I won't ...
user avatar
  • 5,607
2 votes
Accepted

Join a Linux Docker swarm with a local Windows Docker for test purposes

Why do you want to create a new Manager node, risking damaging your raft consensus and cie? I find it way easier to simply expose the docker socket locally, as if you were working inside the node, but ...
user avatar
  • 131
2 votes

Debug Docker DNS

There is a comprehensive document about k8s' DNS. According to this document one could validate whether the DNS is working by running: busybox.yaml apiVersion: v1 kind: Pod metadata: name: busybox ...
user avatar
  • 12.5k
2 votes
Accepted

call container B inside container A using docker networks

If you have a user-defined network set to bridge, you can access other containers by their container's name which is automatically as hostname for containers inside same network. So from containerA ...
user avatar
2 votes

How to fix a "heartbeat failure" in Docker Swarm?

This might not be the answer to your specific cross data-center-ip setup. I occasionally run into one or more swarm-nodes being status: Down and Availability: Active. Having the Status.Message: "...
user avatar
  • 121
2 votes

Docker won't create a bridge network without being given an explicit subnet

Do you need to run it beside a VPN "OpenVPN service" ? I think using below would solve the issue for clearing any unused networks by at least 1 container. $ docker network prune
user avatar
  • 31
2 votes
Accepted

aws - Connect two private subnets?

Are they in the same VPC? If yes it should just work as the VPC CIDR route will take care of all the subnets intercommunication.
user avatar
  • 971
2 votes
Accepted

Docker container and their IPs on overlay (swarm) networks

When you ping nginx the docker swarm returns Virual IP of swarm service named "nginx" not the container ip. This is is how internal load balancer works - you can have multiple replicas of "nginx" ...
user avatar
2 votes

Check connectivity of 5000 + servers from ansible and get list of hosts which are connectable and which are not

Maybe a simple shell script would be more useful. If must to use ansible, it could be something like that (assuming you have all servers in group testall): - hosts: testall connection: local ...
user avatar
2 votes

Bridged network adapter for Packer + VirtualBox?

With a bridged adapter, your VM would get its IP from the host machine's network DHCP server. This would allow it to be pinged from your internal network. I'd also specify in your configuration that ...
user avatar
2 votes

Does Kubernetes internal networking keep traffic to co-located Pods where possible?

This looks to be answered on offcail docs here NodeLocal DNSCache improves Cluster DNS performance by running a dns caching agent on cluster nodes as a DaemonSet. With this architecture, Pods will ...
user avatar
  • 250
2 votes
Accepted

Does Kubernetes internal networking keep traffic to co-located Pods where possible?

No, Kubernetes will load-balance requests to a ClusterIP across all Pods with matching labels (and passing readiness checks). It won't keep traffic within the same Node. Q: So how does the NodeLocal ...
user avatar
  • 141
2 votes
Accepted

Blacklist network ranges Docker is allowed to use for its containers (swarm mode)

Docker should avoid using a network if there's a route to that network (see ip r). You can whitelist networks that docker is allowed to use with configurations in several places: You can adjust bip ...
user avatar
  • 2,700
2 votes

How to Save and Restore the Iptables rule and configuration from file?

If you want to modify the configuration and rules, so you must save the current configuration to a file. So step one is to save the rules configuration by typing the following commands: $ sudo ...
user avatar
  • 171
2 votes
Accepted

why is "docker run" used to connect to redis?

In short, docker exec is used to operate an already-running container, while docker run -it starts a new container interactively. When you ran docker run -it --network foo --rm redis redis-cli -h rd ...
user avatar
2 votes
Accepted

AWS Inspector "High Risk" : port open to the internet with IP whitelisting

If it is FTP (and not FTPS) then yes, it is a high severity risk. You are sending unencrypted traffic over the open internet. Even if you are whitelisting specific IP addresses, the traffic is still ...
user avatar
  • 2,973

Only top scored, non community-wiki answers of a minimum length are eligible