Cluster support for ovn-central.

Without minimal cluster configuration, even on a one node control plane,
the health check of the ovn-cental container always fails as it queries the
cluster/status.
This commit is contained in:
Jochen Friedrich 2022-12-19 13:25:39 +00:00
parent fc0d58ff48
commit 9477255fca
3 changed files with 13 additions and 4 deletions

View file

@ -28,8 +28,13 @@ kube_ovn_dpdk_node_memory_request: 2Gi
kube_ovn_dpdk_node_cpu_limit: 1000m
kube_ovn_dpdk_node_memory_limit: 2Gi
kube_ovn_central_replics: 1
kube_ovn_controller_replics: 1
kube_ovn_central_hosts: "{{ groups['kube_control_plane'] }}"
kube_ovn_central_replics: "{{ kube_ovn_central_hosts | length }}"
kube_ovn_controller_replics: "{{ kube_ovn_central_hosts | length }}"
kube_ovn_central_ips: |-
{% for item in kube_ovn_central_hosts -%}
{{ hostvars[item]['ip'] | default(fallback_ips[item]) }}{% if not loop.last %},{% endif %}
{%- endfor %}
# geneve or vlan
kube_ovn_network_type: geneve

View file

@ -1,7 +1,7 @@
---
- name: Kube-OVN | Label ovn-db node
command: >-
{{ kubectl }} label --overwrite node {{ groups['kube_control_plane'] | first }} kube-ovn/role=master
command: "{{ kubectl }} label --overwrite node {{ item }} kube-ovn/role=master"
loop: "{{ kube_ovn_central_hosts }}"
when:
- inventory_hostname == groups['kube_control_plane'][0]

View file

@ -249,6 +249,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NODE_IPS
value: "{{ kube_ovn_central_ips }}"
- name: POD_NAME
valueFrom:
fieldRef:
@ -386,6 +388,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: OVN_DB_IPS
value: "{{ kube_ovn_central_ips }}"
volumeMounts:
- mountPath: /var/run/netns
name: host-ns