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
#!/usr/bin/python3 | |
# usage python3 echoTcpServer.py [bind IP] [bind PORT] | |
import socket | |
import sys | |
import string | |
import random | |
# Create a TCP/IP socket | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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
# Get packet info thatll later be used for the trace. This info describes the flow. | |
1. tcpdump -XX -c1 -nn -i <dev> <some filter thatll just capture the flow you want> | ovs-tcpundump | |
# Lookup the port ID on which the packet is coming in | |
2. ovs-ofctl show <ovs bridge> | |
# Perform trace | |
ovs-appctl ofproto/trace <ovs bridge> in_port=${port id in step 2} ${pkt data from step 1} |
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
# Setup user group and user and ensure passwordless root | |
groupadd mk && useradd --gid mk --groups mk,users,adm --shell /bin/bash -c "mk home" --create-home mk | |
cat <<EOT >> /etc/sudoers.d/99-mk | |
mk ALL=(ALL) NOPASSWD:ALL | |
EOT | |
# Create new .ssh dir in mk home dir and add a public key to authorized_key file and set perms | |
chmod 400 authorized_key | |
chown -R mk:mk ~mk/.ssh |
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
# GetOAUTH token | |
https://oauth-openshift.apps.ci.l2s4.p1.openshiftapps.com/oauth/token/request | |
# Login with provided link | |
oc login.. | |
# Login to registry (for podman) | |
oc registry login --to ~/.config/containers/auth.json | |
# Login to registry (for docker) | |
oc registry login --to ~/.docker/config.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
#!/bin/bash | |
set -eou pipefail | |
tag="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 13 ; echo '')" | |
echo "Tag is $tag" | |
docker build -f Dockerfile -t quay.io/mkennell/cluster-network-operator:$tag . | |
docker push quay.io/mkennell/cluster-network-operator:$tag | |
oc patch clusterversion version --type json -p '[{"op":"add","path":"/spec/overrides","value":[{"kind":"Deployment","group":"apps","name":"network-operator","namespace":"openshift-network-operator","unmanaged":true},{"kind":"Deployment","group":"apps","name":"openshift-controller-manager-operator","namespace":"openshift-controller-manager-operator","unmanaged":true}]}]' | |
oc -n openshift-network-operator set image deployment/network-operator network-operator=quay.io/mkennell/cluster-network-operator:$tag |
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
You can possibly resolve it in two ways: | |
1. If OVN is in HA, exec onto the pod who is the current leader and execute `ovn-nbctl --no-leader-only show` | |
2. Find all the instances IPs and execute `ovn-nbctl --no-leader-only --db=...` |
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
echo -e "[logging]\nlevel=TRACE\n" > /etc/NetworkManager/conf.d/99-trace-logging.conf |
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
for f in $(oc get nodes --no-headers -o custom-columns=N:.metadata.name ) ; do oc debug node/$f -- chroot /host bash -c "echo $USER-ocp-qe-$(date -I) | passwd --stdin core" & done |
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
for f in $(oc -n openshift-ovn-kubernetes get pods -l app=ovnkube-master -o jsonpath={.items[*].metadata.name}) ; do echo -e "\n${f}\n" ; oc -n openshift-ovn-kubernetes exec "${f}" -c northd -- ovs-appctl -t /var/run/ovn/ovnnb_db.ctl cluster/status OVN_Northbound |grep Role ; done |
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
# When this exits, exit all background processes: | |
trap 'kill $(jobs -p) &> /dev/null && sleep 0.2 && echo ' EXIT | |
# Create one tcpdump output per interface and add an identifier to the beginning of each line: | |
if [[ $@ =~ -i[[:space:]]?[^[:space:]]+ ]]; then | |
tcpdump -l $@ | sed 's/^/[Interface:'"${BASH_REMATCH[0]:2}"'] /' & | |
else | |
for interface in $(ifconfig | grep '^[a-z0-9]' | awk '{print $1}'i | sed "/:[0-9]/d") | |
do | |
tcpdump -l -i $interface -nn $@ | sed 's/^/[Interface:'"$interface"'] /' 2>/dev/null & |
NewerOlder