我很确定我有一些配置错误或遗漏了一些东西。
我的家庭网络是 10.11.0.0/16
我设置了一个 Kubernetes 实例
sudo kubeadm init --pod-network-cidr=10.166.0.0/16
然后我安装了印花布
CALICO_IPV4POOL_CIDR=10.166.32.0/20
然后我设置 MetalLB
apiVersion: 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
我使用 NodePort 在https://kubernetes.io/docs/tasks/access-application-cluster/service-access-application-cluster/上使用了教程,它在 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 机器上的 pod
curl http://10.110.245.152:8080
Hello Kubernetes!
如何让我家网络上的其他机器能够访问?当我在其他机器上尝试这个时,它只是挂起......
curl http://10.110.245.152:8080