-
Notifications
You must be signed in to change notification settings - Fork 272
SDN-662: OVN raft followups #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| apiVersion: policy/v1beta1 | ||
| kind: PodDisruptionBudget | ||
| metadata: | ||
| name: ovn-raft-quorum-guard | ||
| namespace: openshift-ovn-kubernetes | ||
| spec: | ||
| minAvailable: {{.OVN_MIN_AVAILABLE}} | ||
| selector: | ||
| matchLabels: | ||
| name: ovnkube-master |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,6 +188,25 @@ spec: | |
| containerPort: {{.OVN_NB_PORT}} | ||
| - name: nb-db-raft-port | ||
| containerPort: {{.OVN_NB_RAFT_PORT}} | ||
| readinessProbe: | ||
| initalDelaySeconds: 30 | ||
| exec: | ||
| command: | ||
| - /bin/bash | ||
| - -c | ||
| - | | ||
| set -e | ||
| OVN_NODES_ARRAY=({{.OVN_NODES}}) | ||
| AVAILABLE_NODES=0 | ||
| for node in "${OVN_NODES_ARRAY[@]}"; do | ||
| node_ip=$(getent ahostsv4 "${node}" | grep RAW | awk '{print $1}') | ||
| if ovs-appctl -t /var/run/openvswitch/ovnnb_db.ctl cluster/status OVN_Northbound | grep -q $node_ip; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just tested this, and it turns out we don't ever remove servers if we're not available. So we need to parse the "connections" line. I'll give you a sample in a bit.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, all we need to do is check that the DB port is open. it turns out ovsdb takes care of this for us and only opens the port when consensus is achieved. |
||
| (( AVAILABLE_NODES += 1 )) | ||
| fi | ||
| done | ||
| if [[ "${AVAILABLE_NODES}" -lt {{.OVN_MIN_AVAILABLE}} ]]; then | ||
| exit 1 | ||
| fi | ||
|
|
||
| # sbdb: The southbound, or flow DB. In raft mode | ||
| - name: sbdb | ||
|
|
@@ -278,6 +297,25 @@ spec: | |
| containerPort: {{.OVN_SB_PORT}} | ||
| - name: sb-db-raft-port | ||
| containerPort: {{.OVN_SB_RAFT_PORT}} | ||
| readinessProbe: | ||
| initalDelaySeconds: 30 | ||
| exec: | ||
| command: | ||
| - /bin/bash | ||
| - -c | ||
| - | | ||
| set -xe | ||
| OVN_NODES_ARRAY=({{.OVN_NODES}}) | ||
| AVAILABLE_NODES=0 | ||
| for node in "${OVN_NODES_ARRAY[@]}"; do | ||
| node_ip=$(getent ahostsv4 "${node}" | grep RAW | awk '{print $1}') | ||
| if ovs-appctl -t /var/run/openvswitch/ovnsb_db.ctl cluster/status OVN_Southbound | grep -q $node_ip; then | ||
| (( AVAILABLE_NODES += 1 )) | ||
| fi | ||
| done | ||
| if [[ "${AVAILABLE_NODES}" -lt {{.OVN_MIN_AVAILABLE}} ]]; then | ||
| exit 1 | ||
| fi | ||
|
|
||
| # ovnkube master: convert kubernetes objects in to nbdb logical network components | ||
| - name: ovnkube-master | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.