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
Test sdn live migration ovn #51412
Open
weliang1
wants to merge
1
commit into
openshift:master
Choose a base branch
from
weliang1:test-live-migration
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Test sdn live migration ovn #51412
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
ci-operator/step-registry/cucushift/sdn-live-migration-ovn/OWNERS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
approvers: | ||
- zhaozhanqi | ||
- weliang1 |
9 changes: 9 additions & 0 deletions
9
...try/cucushift/sdn-live-migration-ovn/cucushift-sdn-live-migration-ovn-chain.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"path": "cucushift/sdn-live-migration-ovn/cucushift-sdn-live-migration-ovn-chain.yaml", | ||
"owners": { | ||
"approvers": [ | ||
"zhaozhanqi", | ||
"weliang1" | ||
] | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...tep-registry/cucushift/sdn-live-migration-ovn/cucushift-sdn-live-migration-ovn-chain.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
chain: | ||
as: cucushift-sdn-live-migration-ovn | ||
steps: | ||
- ref: idp-htpasswd | ||
- ref: cucushift-pre | ||
- ref: cucushift-upgrade-prepare | ||
- ref: ovn-sdn-live-migration-ovn | ||
- ref: cucushift-upgrade-check | ||
- ref: openshift-upgrade-qe-test-report | ||
documentation: |- | ||
The workflow executes cucushift sdn live migration to ovn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
approvers: | ||
- sdn-approvers | ||
reviewers: | ||
- sdn-reviewers |
71 changes: 71 additions & 0 deletions
71
ci-operator/step-registry/ovn/sdn-live-migration-ovn/ovn-sdn-live-migration-ovn-commands.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/bash | ||
set -x | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
TARGET=${TARGET:-OVNKubernetes} | ||
|
||
# Wait for ClusterOperators to reach the desired state | ||
co_timeout=${OVN_SDN_MIGRATION_TIMEOUT:-2400s} | ||
timeout "$co_timeout" bash <<EOT | ||
until | ||
oc wait co --all --for='condition=Available=True' --timeout=10s && | ||
oc wait co --all --for='condition=Progressing=False' --timeout=10s && | ||
oc wait co --all --for='condition=Degraded=False' --timeout=10s; | ||
do | ||
sleep 10 | ||
echo "Some ClusterOperators are not in the desired state (Degraded=False, Progressing=False, Available=True)"; | ||
done | ||
EOT | ||
|
||
# Patch new setting for internalJoinSubnet and internalTransitSwitchSubnet | ||
oc patch network.operator.openshift.io cluster --type='merge' -p='{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"ipv4":{"internalJoinSubnet": "100.65.0.0/16"}}}}}' | ||
oc patch network.operator.openshift.io cluster --type='merge' -p='{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"ipv4":{"internalTransitSwitchSubnet": "100.85.0.0/16"}}}}}' | ||
|
||
# Patch the network configuration for live migration | ||
oc patch Network.config.openshift.io cluster --type='merge' --patch '{"metadata":{"annotations":{"network.openshift.io/network-type-migration":""}},"spec":{"networkType":"OVNKubernetes"}}' | ||
|
||
# Wait for the network migration to start | ||
co_timeout=${OVN_SDN_MIGRATION_TIMEOUT:-300s} | ||
timeout "$co_timeout" bash <<EOT | ||
until | ||
oc get network -o yaml | grep NetworkTypeMigrationInProgress > /dev/null | ||
do | ||
echo "Migration is not started yet" | ||
sleep 10 | ||
done | ||
EOT | ||
echo "Start Live Migration process now" | ||
|
||
# Wait for the live migration to fully complete | ||
co_timeout=${OVN_SDN_MIGRATION_TIMEOUT:-3600s} | ||
timeout "$co_timeout" bash <<EOT | ||
until | ||
oc get network -o yaml | grep NetworkTypeMigrationCompleted > /dev/null && \ | ||
for NODE in \$(oc get nodes -o custom-columns=NAME:.metadata.name --no-headers); do oc get node \$NODE -o yaml | grep "k8s.ovn.org/node-transit-switch-port-ifaddr:" | grep "100.85"; done > /dev/null && \ | ||
for NODE in \$(oc get nodes -o custom-columns=NAME:.metadata.name --no-headers); do oc get node \$NODE -o yaml | grep "k8s.ovn.org/node-gateway-router-lrp-ifaddr:" | grep "100.65"; done > /dev/null && \ | ||
oc get network.config/cluster -o jsonpath='{.status.networkType}' | grep OVNKubernetes > /dev/null; | ||
do | ||
echo "Live migration is still in progress" | ||
sleep 30 | ||
done | ||
EOT | ||
echo "The Migration is completed" | ||
|
||
# Check all ClusterOperators back to normal after live migration | ||
co_timeout=${OVN_SDN_MIGRATION_TIMEOUT:-3000s} | ||
timeout "$co_timeout" bash <<EOT | ||
until | ||
oc wait co --all --for='condition=Available=True' --timeout=10s && \ | ||
oc wait co --all --for='condition=Progressing=False' --timeout=10s && \ | ||
oc wait co --all --for='condition=Degraded=False' --timeout=10s; | ||
do | ||
sleep 10 && echo "Some ClusterOperators are not in the desired state (Degraded=False, Progressing=False, Available=True)"; | ||
done | ||
EOT | ||
echo "All ClusterOperators are in the desired state" | ||
|
||
# Output the status of ClusterOperators | ||
oc get co | ||
|
11 changes: 11 additions & 0 deletions
11
...tor/step-registry/ovn/sdn-live-migration-ovn/ovn-sdn-live-migration-ovn-ref.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"path": "ovn/sdn-live-migration-ovn/ovn-sdn-live-migration-ovn-ref.yaml", | ||
"owners": { | ||
"approvers": [ | ||
"sdn-approvers" | ||
], | ||
"reviewers": [ | ||
"sdn-reviewers" | ||
] | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
ci-operator/step-registry/ovn/sdn-live-migration-ovn/ovn-sdn-live-migration-ovn-ref.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ref: | ||
as: ovn-sdn-live-migration-ovn | ||
from_image: | ||
name: cli-jq | ||
namespace: ocp | ||
tag: latest | ||
commands: ovn-sdn-live-migration-ovn-commands.sh | ||
env: | ||
- name: OVN_SDN_MIGRATION_TIMEOUT | ||
default: 0s | ||
documentation: |- | ||
Default is 0s indicating variable not set, Generic timeout for all the steps involved in OpenshiftSDN to OVNKubernetes live migration | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 100Mi | ||
documentation: |- | ||
The step changes the networkType from OpenshiftSDN to OVNKubernetes in a running cluster |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update the cron job time by
./ci-operator/config/openshift/openshift-tests-private/tools/generate-cron-entry.sh
tool generate a new oneThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhaozhanqi Update it by using above tool.