kubernetes - Kubernetes - 外部 IP 与内部 IP
问题描述
当我运行以下命令从我的本地集群获取信息时,
kubectl 集群信息转储
我看到每个节点的以下内容。
在主人
"addresses": [
{
"type": "ExternalIP",
"address": "10.10.15.47"
},
{
"type": "InternalIP",
"address": "10.10.15.66"
},
{
"type": "InternalIP",
"address": "10.10.15.47"
},
{
"type": "InternalIP",
"address": "169.254.6.180"
},
{
"type": "Hostname",
"address": "k8s-dp-masterecad4834ec"
}
],
在工作节点 1 上
"addresses": [
{
"type": "ExternalIP",
"address": "10.10.15.57"
},
{
"type": "InternalIP",
"address": "10.10.15.57"
},
{
"type": "Hostname",
"address": "k8s-dp-worker5887dd1314"
}
],
在工作节点 2 上
"addresses": [
{
"type": "ExternalIP",
"address": "10.10.15.33"
},
{
"type": "InternalIP",
"address": "10.10.15.33"
},
{
"type": "Hostname",
"address": "k8s-dp-worker6d2f4b4c53"
}
],
我的问题是..
1.) 为什么有些节点有不同的 ExternalIP 和 InternalIP 而有些没有?2.) 同样对于具有不同 ExternalIP 和 InternalIP 的节点在相同的 CIDR 范围内,两者都可以从外部访问。这两个 IP 地址的内部/外部是什么?(目的是什么?) 3.) 为什么有些节点有随机的 169.xxx IP 地址?
尝试仍然了解有关 Kubernetes 的更多信息,如果有人可以帮助我理解这将非常有帮助。我使用 contiv 作为网络插件
解决方案
What you see is part of the status of these nodes:
- InternalIP: IP address of the node accessible only from within the cluster
- ExternalIP: IP address of the node accessible from everywhere
- Hostname: hostname of the node as reported by the kernel
These fields are set when a node is added to the cluster and their exact meaning depends on the cluster configuration and is not completely standardised, as stated in the Kubernetes documentation.
So, the values that you see are like this, because your specific Kubernetes configuration sets them like this. With another configuration you get different values.
For example, on Amazon EKS, each node has a distinct InternalIP, ExternalIP, InternalDNS, ExternalDNS, and Hostname (identical to InternalIP). Amazon EKS sets these fields to the corresponding values of the node in the cloud infrastructure.
推荐阅读
- c# - 如何在控制器外部使用 Startup.cs 上声明的服务
- mysql - MYSQL - 获取组中未通过条件测试的项目列表
- kubernetes - `operator-courier verify` 希望我更新的 CRD 的根列表在哪里?
- eclipse - Floodlight 安装错误:权限被拒绝
- arrays - 如何使用 mongodb 中的 $ne 查询来查询值数组?
- python - 如何为 python NamedTuple 实现“变化”的默认参数
- java - 由于依赖于 postgres 容器,spring boot 容器没有运行
- python - 在没有内置函数的情况下确定列表是升序、降序还是两者都不是
- python - 如何使用 plt.figure 和 add_subplot 放大 seaborn boxplot?
- javascript - Axios POST 解析为未定义