Skip to content

Instantly share code, notes, and snippets.

View therevoman's full-sized avatar

Nate Revo therevoman

  • Red Hat, Inc
  • Utah
View GitHub Profile
@therevoman
therevoman / mac-vendor.txt
Created December 9, 2021 20:26 — forked from aallan/mac-vendor.txt
List of MAC addresses with vendors identities
000000 Officially Xerox
000001 SuperLAN-2U
000002 BBN (was internal usage only, no longer used)
000003 XEROX CORPORATION
000004 XEROX CORPORATION
000005 XEROX CORPORATION
000006 XEROX CORPORATION
000007 XEROX CORPORATION
000008 XEROX CORPORATION
000009 powerpipes?
@therevoman
therevoman / convert-deploymentconfig-to-deployment.md
Created October 2, 2021 04:51 — forked from bmaupin/convert-deploymentconfig-to-deployment.md
Convert OpenShift DeploymentConfig to Kubernetes Deployment
  1. Change apiVersion from:

    - apiVersion: v1

    (or apiVersion: apps.openshift.io/v1)

    to:

@therevoman
therevoman / gist:c7a7a915d81f4d36cc0a03d0042071af
Created August 5, 2021 16:23 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote

While trying to set up the k8s submariner project I realized I needed a UDP proxy.

I had to forward 3 ports through my firewall to the server running podman, port 4800, 4501, 501.

udp_backends="compute1 compute2 compute3 compute4 compute5 compute6 compute7"
podman run -d --name ocs_submariner_4800 -p 4800:4800 -e BACKENDS="$udp_backends" -e PORT_BACKEND=4800 -e PORT_LISTEN=4800 instantlinux/udp-nginx-proxy
podman run -d --name ocs_submariner_4501 -p 4501:4501 -e BACKENDS="$udp_backends" -e PORT_BACKEND=4501 -e PORT_LISTEN=4501 instantlinux/udp-nginx-proxy
podman run -d --name ocs_submariner_501 -p 501:501 -e BACKENDS="$udp_backends" -e PORT_BACKEND=501 -e PORT_LISTEN=501 instantlinux/udp-nginx-proxy

Cleaning up is hard to do.

This is borrowed from submariner uninstall

My bash loop for cleaning up iptables entries

for i in `oc get nodes -o name`; do echo $i; oc debug $i -- chroot /host sh -c 'sudo iptables --flush SUBMARINER-INPUT; sudo iptables -D INPUT $(iptables -L INPUT --line-numbers | grep SUBMARINER-INPUT | awk '\''{print $1}'\''); sudo iptables --delete-chain SUBMARINER-INPUT; sudo iptables -t nat --flush SUBMARINER-POSTROUTING; sudo iptables -t nat -D POSTROUTING $(iptables -t nat -L POSTROUTING --line-numbers | grep SUBMARINER-POSTROUTING | awk '\''{print $1}'\''); sudo iptables -t nat --delete-chain SUBMARINER-POSTROUTING'; done
While attempting an upgrade of a single node cluster created using the assisted installer from candidate-4.8.0 to candidate-4.8.2 everything completed except the machine-config operator. The error looked like:
``` Master: pool is degraded because nodes fail with "1 nodes are reporting degraded status on sync": "Node sno-assisted is reporting: \"unexpected on-disk state validating against rendered-master-9adaa63f411b981cfffd0aba37e17729: expected target osImageURL \\\"quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:865d35cc4252422e66ff7d638530f61d59326f3a519283d9638813fb730ff4ce\\\", have \\\"quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:369c15034dee19e19aa725de19bfb91c49db28b1c57958104a278e7237eb1d3f\\\"\""```
Following the comment at the bottom of this Red Hat solution article https://access.redhat.com/solutions/5510891
I logged into the node via ssh and used the "expected target osImageUrl" in the following command
`sudo /run/bin/machine-config-daemon pivot quay.io/openshift-release
@therevoman
therevoman / ocs4-install-error-manifest-version
Last active April 11, 2025 10:59
OCP 4 install failure because manifest had version
While trying to install an OCP v4.6 cluster on 3 bare metal nodes I could not figure out why my bootstrap would listen on 6443 but not on 22623 (machine config).
After many reboots and much debugging I ran across a stopped pod on the bootstrap node. Looking at the pods logs revealed I had added a maninfest with an invalid manifest version (I built it for a 4.7 cluster but then tried to use it in a 4.6 cluster.
```[root@ocs-bootstrap ~]# crictl ps -a
CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID
1254caf68e308 c32243984e519c32cedbe26f1c5b2c486b15788711566590901a4f09df524d8c 45 seconds ago Exited machine-config-controller 7 cab653c29c692```
Here is the error message
```# oc logs 1254caf68e308
error: Missing or in
@therevoman
therevoman / ocp4-hacks.md
Last active April 18, 2024 15:32
OpenShift 4 Hacks

My list of OpenShift 4 hacks

How do I list all resources in a namespace (no, really ALL of them)

adapted from https://access.redhat.com/solutions/4165791

$ oc api-resources --verbs=list --namespaced -o name | xargs  -I {} bash -c "oc get --show-kind --ignore-not-found -n openshift-storage {}"

a little faster

// This file was initially generated by Windows Terminal 1.4.3141.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",