Skip to content
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

Merged
merged 1 commit into from Dec 3, 2020

Conversation

tssurya
Copy link
Contributor

@tssurya tssurya commented Nov 20, 2020

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:

---
apiVersion: v1
kind: Pod
metadata:
  name: pod1
  labels:
    app: MyApp
spec:
  containers:
  - name: pod1
    image: quay.io/itssurya/dev-images:5919d6a1-080e-4bb2-a8b5-62627c78b2c7
    command:
      - /sbin/init

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

@tssurya
Copy link
Contributor Author

tssurya commented Nov 25, 2020

/assign @rcarrillocruz

spec:
containers:
- name: {{POD_NAME}}
image: docker.io/centos/tools:latest
Copy link
Contributor

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.

Copy link
Contributor

@astoycos astoycos left a 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 Show resolved Hide resolved
debug-scripts/ovn/pod_to_pod.sh Show resolved Hide resolved
debug-scripts/ovn/pod_to_pod.sh Outdated Show resolved Hide resolved
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.
Copy link
Contributor

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

Copy link
Contributor

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,.)
Copy link
Contributor Author

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.

@rcarrillocruz
Copy link
Contributor

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 3, 2020
@juanluisvaladas
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2020
@openshift-ci-robot
Copy link
Contributor

[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:
  • OWNERS [juanluisvaladas,rcarrillocruz]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 73c75bf into openshift:master Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants