25
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}'
11
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
9
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 ...
8
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 ...
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 ...
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 ...
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 ...
4
votes
How to get kubernetes pod network CIDR
my version of kubeadm is 1.22 and the command to view defaults is kubeadm config print init-defaults, towards the bottom:
networking:
dnsDomain: cluster.local
serviceSubnet: 10.96.0.0/12
4
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.
4
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>) ...
4
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 ...
4
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: ...
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 ...
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 ...
3
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" ...
3
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 ...
3
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 ...
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 ...
3
votes
How to generate a list of every external URL accessed during docker build?
One thing that pops my mind is using either of Wireshark, tshark, or tcpdump for capturing network packets originating at docker daemon while docker build is running.
After recording the traffic, need ...
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 ...
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 ...
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
...
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 ...
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: "...
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
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.
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
...
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 ...
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 ...
2
votes
Accepted
Why I cannot access k3s service from pod in rasbian?
It looks like you are configuring two services, mysql and mysql-nodeport to use the same port. Without information to indicate otherwise im assuming this is a 1 node setup with rasbian. I personally ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
networking × 108docker × 59
kubernetes × 24
docker-compose × 10
containers × 8
amazon-web-services × 6
ansible × 6
dns × 6
ports × 6
azure × 5
databases × 5
docker-swarm × 5
openstack × 5
dockerfile × 4
security × 4
deployment × 3
linux × 3
nginx × 3
kubectl × 3
mysql × 3
redis × 3
amazon-ec2 × 2
automation × 2
microservices × 2
cloud × 2