Update Kube-router version to v0.4.0 (#5756)
This commit is contained in:
parent
45626a05dc
commit
974902af31
5 changed files with 32 additions and 28 deletions
|
@ -125,7 +125,7 @@ Note: Upstart/SysV init based OS types are not supported.
|
||||||
- [cilium](https://github.com/cilium/cilium) v1.5.5
|
- [cilium](https://github.com/cilium/cilium) v1.5.5
|
||||||
- [contiv](https://github.com/contiv/install) v1.2.1
|
- [contiv](https://github.com/contiv/install) v1.2.1
|
||||||
- [flanneld](https://github.com/coreos/flannel) v0.11.0
|
- [flanneld](https://github.com/coreos/flannel) v0.11.0
|
||||||
- [kube-router](https://github.com/cloudnativelabs/kube-router) v0.2.5
|
- [kube-router](https://github.com/cloudnativelabs/kube-router) v0.4.0
|
||||||
- [multus](https://github.com/intel/multus-cni) v3.4
|
- [multus](https://github.com/intel/multus-cni) v3.4
|
||||||
- [weave](https://github.com/weaveworks/weave) v2.5.2
|
- [weave](https://github.com/weaveworks/weave) v2.5.2
|
||||||
- Application
|
- Application
|
||||||
|
|
|
@ -82,7 +82,7 @@ pod_infra_version: 3.1
|
||||||
contiv_version: 1.2.1
|
contiv_version: 1.2.1
|
||||||
cilium_version: "v1.7.1"
|
cilium_version: "v1.7.1"
|
||||||
kube_ovn_version: "v0.6.0"
|
kube_ovn_version: "v0.6.0"
|
||||||
kube_router_version: "v0.2.5"
|
kube_router_version: "v0.4.0"
|
||||||
multus_version: "v3.4"
|
multus_version: "v3.4"
|
||||||
|
|
||||||
# Get kubernetes major version (i.e. 1.15.4 => 1.15)
|
# Get kubernetes major version (i.e. 1.15.4 => 1.15)
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
- name: kube-router | Slurp cni config
|
- name: kube-router | Slurp cni config
|
||||||
slurp:
|
slurp:
|
||||||
src: /etc/cni/net.d/10-kuberouter.conf
|
src: /etc/cni/net.d/10-kuberouter.conflist
|
||||||
register: cni_config_slurp
|
register: cni_config_slurp
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
|
@ -49,30 +49,24 @@
|
||||||
|
|
||||||
- name: kube-router | Set host_subnet variable
|
- name: kube-router | Set host_subnet variable
|
||||||
set_fact:
|
set_fact:
|
||||||
host_subnet: "{{ cni_config.ipam.subnet }}"
|
host_subnet: "{{ cni_config | json_query('plugins[?bridge==`kube-bridge`].ipam.subnet') | first }}"
|
||||||
when:
|
when:
|
||||||
- cni_config is defined
|
- cni_config is defined
|
||||||
- cni_config.ipam is defined
|
- cni_config | json_query('plugins[?bridge==`kube-bridge`].ipam.subnet') | length > 0
|
||||||
- cni_config.ipam.subnet is defined
|
|
||||||
|
|
||||||
- name: kube-router | Set wanted cni config variable
|
|
||||||
set_fact:
|
|
||||||
wanted_cni_config: "{{ lookup('template', 'cni-conf.json.j2') }}"
|
|
||||||
|
|
||||||
- name: kube-router | Set wanted_cni_config variable
|
|
||||||
set_fact:
|
|
||||||
wanted_cni_config: "{{ wanted_cni_config | combine({ 'ipam': { 'subnet': host_subnet }}, recursive=True) }}"
|
|
||||||
when: host_subnet is defined
|
|
||||||
|
|
||||||
- name: kube-router | Create cni config
|
- name: kube-router | Create cni config
|
||||||
copy:
|
template:
|
||||||
content: "{{ wanted_cni_config | to_nice_json }}"
|
src: cni-conf.json.j2
|
||||||
dest: /etc/cni/net.d/10-kuberouter.conf
|
dest: /etc/cni/net.d/10-kuberouter.conflist
|
||||||
owner: kube
|
owner: kube
|
||||||
changed_when: wanted_cni_config != cni_config
|
|
||||||
notify:
|
notify:
|
||||||
- reset_kube_router
|
- reset_kube_router
|
||||||
|
|
||||||
|
- name: kube-router | Delete old configuration
|
||||||
|
file:
|
||||||
|
path: /etc/cni/net.d/10-kuberouter.conf
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: kube-router | Create manifest
|
- name: kube-router | Create manifest
|
||||||
template:
|
template:
|
||||||
src: kube-router.yml.j2
|
src: kube-router.yml.j2
|
||||||
|
|
|
@ -1,13 +1,21 @@
|
||||||
{
|
{
|
||||||
|
"cniVersion":"0.3.0",
|
||||||
|
"name":"kubernetes",
|
||||||
|
"plugins":[
|
||||||
|
{
|
||||||
"name":"kubernetes",
|
"name":"kubernetes",
|
||||||
"cniVersion": "0.2.0",
|
|
||||||
"type":"bridge",
|
"type":"bridge",
|
||||||
"bridge":"kube-bridge",
|
"bridge":"kube-bridge",
|
||||||
"isDefaultGateway":true,
|
"isDefaultGateway":true,
|
||||||
{% if kube_router_support_hairpin_mode %}
|
{% if kube_router_support_hairpin_mode %}
|
||||||
"hairpinMode":true,
|
"hairpinMode":true,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
"ipam": {
|
"ipam":{
|
||||||
|
{% if host_subnet is defined %}
|
||||||
|
"subnet": "{{ host_subnet }}",
|
||||||
|
{% endif %}
|
||||||
"type":"host-local"
|
"type":"host-local"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,8 @@ spec:
|
||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: spec.nodeName
|
fieldPath: spec.nodeName
|
||||||
|
- name: KUBE_ROUTER_CNI_CONF_FILE
|
||||||
|
value: /etc/cni/net.d/10-kuberouter.conflist
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /healthz
|
path: /healthz
|
||||||
|
|
Loading…
Reference in a new issue