Skip to content

Instantly share code, notes, and snippets.

View williamcaban's full-sized avatar

William Caban Babilonia williamcaban

View GitHub Profile
@williamcaban
williamcaban / pp-rps-mc.py
Last active April 19, 2021 14:12
Temporary workaround for RPS, IRQs and Queues
#!/usr/bin/python3
"""
Usage: python3 pp-rps-mc.py 1,2,52-53 > ran-rps-netqueues-fix.yaml ; oc apply -f ran-rps-netqueues-fix.yaml
Updated April 2 2021 -- patch to address issue cnf1360
This script generates a MachineConfiguration OCP object that
can be applied to a 4.6 cluster and adds additional tuning
fixes related to networking.
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
name: 50-master-blacklist-ipi
labels:
machineconfiguration.openshift.io/role: master
spec:
config:
ignition:
version: 3.1.0
#!/bin/bash -e
source set-environment
# Variables to set, suit to your installation
export AIRGAP_REGISTRY_INDEX_TAG=olm-index/redhat-operator-index:v$OCP_RELEASE_MAIN
export AIRGAP_REGISTRY_IMAGE_TAG=olm
# Set these values to true for the catalog and miror to be created
export RH_OP='true'
#version=RHEL8
ignoredisk --only-use=vda
# System bootloader configuration
bootloader --disabled
autopart --type=plain --fstype=ext4 --nohome --noboot --noswap
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all
# Reboot after installation
apiVersion: v1
kind: Pod
metadata:
  name: static-ip
  annotations:
    k8s.v1.cni.cncf.io/networks: '[
      {
        "name": "<name>", 
 "ips": [ "192.0.2.205/24","2001:333:333::333/64" ], 

Create OCP RHCOS LiveCD w/embedded Ignition

  • Download latest coreos-installer
podman pull quay.io/coreos/coreos-installer:release
  • Download latest RHCOS LiveCD
curl -O https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/latest-4.6/rhcos-live.x86_64.iso

OCP RANDOM NOTES

  • Import all sample images
IMAGES=`oc get is -o go-template --template="{{range .items}}{{.metadata.name}} {{end}}"`

for i in ${IMAGES}; do
  echo "Pulling: $i"
  ./oc import-image $i --all
@williamcaban
williamcaban / iperf-pods.md
Created August 2, 2020 22:22
Using client/server iperf pods

Using iperf Pods

  • Create namespace or project for running iperf tests:
oc new-project iperf-test
  • Create server Pod
rm -f pod-iperf-server.yaml 

OCP4 Explicit Manual Upgrades with CLI

In this example, the latest 4.4.x it is 4.4.3 and it has this entry:

Pull From: quay.io/openshift-release-dev/ocp-release@sha256:039a4ef7c128a049ccf916a1d68ce93e8f5494b44d5a75df60c85e9e7191dacc

Validate your current version is in the list of upgrade path for the desired release. For 4.4.3 these are the possible upgrade paths:

@williamcaban
williamcaban / NetFlow or SFlow with OpenShift 4.md
Created May 2, 2020 15:24
Simple procedure to enable NetFlow or SFlow on OpenShift 4

Netflow or sFlow on OpenShift 4 w/OVN Kubernetes

  • Identify the ovs-node of the Node hosting the Pods to monitor

    # oc get pods --selector="app=ovs-node" -o wide
    NAME             READY   STATUS    RESTARTS   AGE   IP              NODE       NOMINATED NODE   READINESS GATES
    ovs-node-4hldj   1/1     Running   0          47h   198.18.100.16   worker-1   <none>           <none>
    

ovs-node-bd9ln 1/1 Running 0 47h 198.18.100.12 master-1