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
SDN-1334: Pod to pod connectivity for OVN #18
Conversation
/assign @rcarrillocruz |
debug-scripts/ovn/pod_to_pod.sh
Outdated
spec: | ||
containers: | ||
- name: {{POD_NAME}} | ||
image: docker.io/centos/tools:latest |
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.
just to put here what we chatted in our call, let's change this to debug-network itself, that way you get golang SDK from base image and ovnkube-trace for free if you need to call it from src pod to dest pod.
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.
generally /lgtm except for the few nit's, Also I have found it useful to run any scripts I write through a shellchecking tool like this
debug-scripts/ovn/pod_to_pod.sh
Outdated
oc rsh -n $DEBUG_NETWORK_NAMESPACE client-debug traceroute $server_debug_pod_ip -m 10 | ||
# incorportate the logic to use ovnkube-trace to output the ovn/ovs trace | ||
echo "Something is wrong, running the ovnkube-trace and detrace to help figure out the packet route..." | ||
# [TODO]: Once ovnkube-trace is packed is oc, we can start using it directly and cleanup the nonsense from the below lines. |
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.
Will ovnkube-trace
ever be packed in oc
? I thought it would just be part of Ovn-k
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.
It will be packed in ovn-k yeah, then eventually the plan was to have something like 'oc adm diagnose network suite' where suite would be 'sdn' or 'ovn-kubernetes' and that would contain the suite of scripts for debugging those plugins.
That could be extended for specific features, e.g. 'oc adm diagnose network ipsec' etc.
|
||
# This will call a macro called "build-image" which will generate image specific targets based on the parameters: | ||
# $0 - macro name | ||
# $1 - target name | ||
# $2 - image ref | ||
# $3 - Dockerfile path | ||
# $4 - context directory for image build | ||
$(call build-image,ocp-debug-network,$(IMAGE_REGISTRY)/ocp/4.6:ocp-debug-network, ./Dockerfile.rhel7,.) |
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.
The reason why I chaned this to use centos was because the real rhel8 image requires fiddling with RHEL subscriptions. For testing purposes it's easier to just build a Fedora-based image or centos based image. We can flip this back when we fix the subscriptions.
/approve |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: juanluisvaladas, rcarrillocruz, tssurya The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What is the aim of the script?
Test connectivity between pods in OVN. It runs ovnkube-trace between the pods in case of connectivity failure to check what went wrong.
How to test the script?
The script assumes that $KUBECONFIG file is loaded/mounted at
/tmp/kubeconfig
inside the pod. This is just temporary and will go away once we add a serviceaccount for the debug-namespace.Method 1: Launch a debug pod on an OCP OVN cluster:
Sample yaml:
Replace the image with
registry.svc.ci.openshift.org/ocp/4.7:ocp-debug-network
once the image lands in the registry.oc rsh -n <DEBUG-NETWORK-NAMESPACE> <debug-network-podname> ./usr/bin/pod_to_pod.sh <src-node-name> <dst-node-name>
Method 2: Launch it via podman or docker:
podman run -v /tmp/kubeconfig:/tmp/kubeconfig <IMAGE_ID> ./usr/bin/pod_to_pod.sh