Skip to content

Instantly share code, notes, and snippets.

Avatar

Doug Smith dougbtv

View GitHub Profile
@dougbtv
dougbtv / README.md
Created Aug 11, 2021
Multus: Reference external namespace in openshift
View README.md

Referring to "global namespaces" using Multus CNI in OpenShift

This demonstrates using a cross-namespace reference in OpenShift to refer to net-attach-defs in the openshift-multus namespace from another namespace.

See the additional pod.yml and net-attach-def.yaml files included in this gist.

Using latest OCP from CI (4.9 master)

@dougbtv
dougbtv / README.md
Created Jun 24, 2021
Whereabouts clear IP allocations
View README.md

Clearing IP allocations manually with Whereabouts

This outlines a process for clearing IP address allocations with Whereabouts manually. This clears all allocations, you could be more surgical about it, however, this is efficient if it's possible.

NOTE I have another procedure somewhere which has fancy bash commands to make this easier, and is fully tested, however, in theory this "should just work" (you've heard that before)

Overview

  1. Stop all pods which use Multus + Whereabouts (if possible)
  2. Clear IP allocations
@dougbtv
dougbtv / README.md
Created May 25, 2021
Flattening contracts for verification on the Matic blockscout block explorer
View README.md
@dougbtv
dougbtv / dummy.sh
Created May 14, 2021
Sample CNI plugin using Bash, for learning and debugging.
View dummy.sh
#!/usr/bin/env bash
DEBUG=true
# LOGFILE=/tmp/seamless.log
# Outputs errors to stderr
errorlog () {
>&2 echo $1
}
@dougbtv
dougbtv / README.md
Last active Jun 13, 2022
Multus runtime config (for IP / mac address)
View README.md

net-attach-def used:

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: centos-runtimeconfig-def
spec:
  config: '{
 "cniVersion": "0.3.1",
@dougbtv
dougbtv / README.md
Created Jan 21, 2021
How to setup an average joe user in OpenShift
View README.md

First, type the Konami code into your terminal, then...

Create a user, then create a password for the user...

oc create user doug
htpasswd -c -B -b /tmp/doughtpass doug s00persecret

Create an ident yaml...

@dougbtv
dougbtv / README.md
Last active Dec 4, 2020
Getting a container ID from the kube API with bash
View README.md

First create the resources.yml to create a service account, RBAC & bindings for it, as well as a pod that uses the downward API to get its own name...

kubectl create -f resources.yml

Now you can exec into the pod...

$ kubectl exec -it toolpod -- /bin/bash
@dougbtv
dougbtv / README.md
Created Sep 23, 2020
OpenShift & OpenShift Virtualization <3 SR-IOV -- An SR-IOV demo with virtual machines making a SIP phone call
View README.md

SR-IOV with OpenShift Virtualization

We're going to use SR-IOV technology with OpenShift Virtualization. Today we're going to cover looking at the SR-IOV network attachment definitions, spinning up VMs associated with those, and then we'll make a SIP phone call over the VMs (because we're all bored of a ping test!)

Notably, this gist does not cover installing the SR-IOV Operator, configuring the SR-IOV operator.

The NetworkAttachmentDefinition (which defines an intent to attach additional networks to pods in Kubernetes, which you typically see by the presence of an additional network interface) that we use here is the one [provided by default by the SR-IOV network operator](https://docs.openshift.com/container-platform/4.5/netw

@dougbtv
dougbtv / README.md
Last active May 5, 2020
static.route.whereabouts.json
View README.md
@dougbtv
dougbtv / README.md
Last active Jun 9, 2022
Istio + Multus CNI: Annotation clobbering, replication and fix
View README.md

Istio + Multus CNI: Annotation clobbering, replication and fix

This details a reference deployment of Istio w/ Multus CNI to demonstrate a problem where annotations are being clobbered by the Istio webhook. It also provides a patch and workflow for a possible fix.

This article first demonstrates how to reproduce the article, then proposes a patch, and demonstrates a way to build and deploy Istio with the modified code.

NOTE: Ignore the 1.5.1 through the install, I replicate it with latest (Nov 2021), and provide further steps following the rest of the installation.

Suggested system