问题描述
我是kubernetes的初学者,我可以在最新的calico.yaml文件(Install Calico on nodes)上看到默认的监听9099端口的配置。
我正在几个节点上进行部署,该端口(9099)被用作其他服务在后台运行。
从日志中我可以看到:
2020-08-28 12:15:15.107 [ERROR][59] Felix/health.go 246: Health endpoint Failed,trying to restart it... error=listen tcp 127.0.0.1:9099: bind: address already in use
2020-08-28 12:15:16.108 [ERROR][59] Felix/health.go 246: Health endpoint Failed,trying to restart it... error=listen tcp 127.0.0.1:9099: bind: address already in use
2020-08-28 12:15:17.108 [ERROR][59] Felix/health.go 246: Health endpoint Failed,trying to restart it... error=listen tcp 127.0.0.1:9099: bind: address already in use
2020-08-28 12:15:18.109 [ERROR][59] Felix/health.go 246: Health endpoint Failed,trying to restart it... error=listen tcp 127.0.0.1:9099: bind: address already in use
日志来自容器:
kube-system calico-node-d4ntt 1/1 Running 0 9m41s
kube-system calico-node-mjh4z 0/1 Running 3 3m31s
kube-system calico-node-p5lgf 0/1 Running 2 3m34s
kube-system calico-node-t4vmd 0/1 Running 2 3m30s
我们如何更新此端口?在yml文件上,我看不到端口。
我可以在yml文件中看到配置:
listenPort:
description: ListenPort is the port where BGP protocol should listen.
Defaults to 179
maximum: 65535
minimum: 1
但这不是阻止我进行部署的端口。
解决方法
根据您的配置-calico-kubernetes-requirements,确保您的主机和防火墙允许必要的流量。
设置TYPHA_HEALTHHOST
或检查本地主机要解析的内容。
类似的解决方案:felix-calico。
您还可以尝试更改livenessProve和readinessProbe:
livenessProbe:
httpGet:
path: /liveness
port: 9099 #here you can change port
如果上述解决方案不起作用,请在端口9099上终止进程,然后重新安装Calico。
查看更多:projectcalico-issue。
还要看看:calico-incubator,calico-felix。
,简而言之,您必须将containerPort参数添加到#OR,EVEN EASILY
result = [dict(item.items()) for item in li]
print(result) # [{'first': 1.1,'second': 1.2},{'first': 2.1,'second': 2.2}]
的calico-node容器部分:
首先下载calico.yaml
文件:
calico.yaml
此yaml文件中有一个DaemonSet,其中有一个名为curl https://docs.projectcalico.org/manifests/calico.yaml -O
的容器,向yaml文件中添加calico-node
并将其值更改为所需的内容(所需的任何端口)。像这样:
DaemonSet.spec.template.spec.containers.ports.containerPort parameter