【发布时间】:2020-10-31 06:57:22
【问题描述】:
我很确定我有一些配置错误或遗漏了一些东西。
我的家庭网络是 10.11.0.0/16
我设置了一个 Kubernetes 实例
sudo kubeadm init --pod-network-cidr=10.166.0.0/16
然后我用 calico 安装了
CALICO_IPV4POOL_CIDR=10.166.32.0/20
然后我用
设置MetalLBapiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: default
protocol: layer2
addresses:
- 192.168.100.1-192.168.100.254
我在 https://kubernetes.io/docs/tasks/access-application-cluster/service-access-application-cluster/ 使用 NodePort 的教程,它在 kubernetes 机器上运行良好:
kubectl describe services example-service
Name: example-service
Namespace: default
Labels: app.kubernetes.io/name=load-balancer-example
Annotations: <none>
Selector: app.kubernetes.io/name=load-balancer-example
Type: NodePort
IP: 10.110.245.152
Port: <unset> 8080/TCP
TargetPort: 8080/TCP
NodePort: <unset> 30140/TCP
Endpoints: 10.166.32.243:8080,10.166.32.244:8080,10.166.32.245:8080 + 2 more...
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
我可以通过
访问 kubernetes 机器上的 podcurl http://10.110.245.152:8080
Hello Kubernetes!
如何让我家网络上的其他机器能够访问?当我在其他机器上尝试这个时它只是挂起......
curl http://10.110.245.152:8080
【问题讨论】:
标签: kubernetes debian project-calico metallb