修复calico的BGP RR模式下的bgppeer的nodeSelector错误 #741
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
首先要说明的是,按照原文档的配置,最终是可以形成可用的rr节点和bgp连接的,但是不严谨。
根据我实际的操作情况来看,
nodeSelector: !has(i-am-a-route-reflector)
这种写法是无效的,并且创建出来的bgppeer是不会包含nodeSelector这一字段的,除非加上双引号“”(calico的官方文档也是含有双引号的)。而之所以原有的写法可以成功,是因为当bgppeer没有nodeSelector时,会将它设置为global的,global的意思就是说所有的节点都会与RR节点建立连接;但很显然,原有的目的是让所有非RR节点与RR节点建立连接,同时RR节点之间建立连接;并且按照原写法rr-mesh这个bgppeer其实也是不起作用的,因为global已包含RR节点之间的连接。