kubernetes将服务cidr和pod cidr设置为相同 [英] kubernetes set service cidr and pod cidr the same

查看:1500
本文介绍了kubernetes将服务cidr和pod cidr设置为相同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们使用kubeadm设置k8s集群时,有两个配置选项:

--pod-network-cidr

--service-cidr(默认为"10.96.0.0/12")

问题是:

  1. 如果对pod-network-cidr使用10.244.0.0./12,是否需要为Kubernetes保存该IP范围?如果我们已经开始在其他计算机上使用10.244.0.0/12会发生什么.

  2. 我可以将service-cidrpod-network-cidr设置为相同范围吗?我不明白service-cidr的工作原理.

解决方案

要简短答复:

    1. 您必须同时保留两者的Pod网络范围和服务网络范围.您不能在LAN上使用这些地址(也无法路由到它).这两个范围都是可配置的,因此您可以选择不使用的东西.如果不确定,请使用ipcalc.

    1. 您必须使用单独的范围.

查看这些幻灯片,以了解有关播放中的不同网络的信息. /p>

When we use kubeadm to set up a k8s cluster, there are two options to config:

--pod-network-cidr

--service-cidr (default ‘10.96.0.0/12’)

Question is:

  1. If I use 10.244.0.0./12 for pod-network-cidr, do I need to save that IP range for Kubernetes? What happens if we already start to use 10.244.0.0/12 for other machines.

  2. Can I set service-cidr and the pod-network-cidr the same range? I don't understand how service-cidr works.

解决方案

To reply briefly:

    1. You do have to reserve both the pod-network range and the service network range. You can't use those on your LAN (and you can't have routes to it). Both ranges are configurable so you can pick something that is not used. Use ipcalc if you are unsure.

    1. You have to use separate ranges.

Check out these slides for explanation about the different networks in play.

这篇关于kubernetes将服务cidr和pod cidr设置为相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆