Skip to content

Instantly share code, notes, and snippets.

View jkeam's full-sized avatar
🍻

Jon Keam jkeam

🍻
View GitHub Profile
@jkeam
jkeam / imageset-additional-images-helper.py
Created October 20, 2024 21:27
Grabs the additional images required for a given OpenShift release and puts it in a format that can be pasted into an imageset.yaml
from urllib.request import urlopen
from re import sub
def read(version:str) -> None:
with urlopen(f"https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{version}/release.txt") as f:
contents = f.read().decode('utf-8').split('\n')
for content in contents:
if 'quay.io' in content:
line = sub(r"^\s*[\w-]+\s*", "", content)
print(f" - name: {line}")
@jkeam
jkeam / shutdown-compact-openshift.sh
Created September 23, 2024 19:56
Script to gracefully shutdown a compact OpenShift cluster.
#!/bin/bash
# This script tries to gracefully shutdown a 3-node / "compact" OCP cluster
# There seems to be some coordination required when shutting down
# when ODF, Logging, and Virtualization are deployed.
CLUSTER_NAME="your-cluster-name-here"
OC_BIN=/usr/local/bin/oc
KUBECONFIG=~/.kube/config
OC_CMD="$OC_BIN --kubeconfig=$KUBECONFIG"
@jkeam
jkeam / pihole.service
Created August 27, 2024 01:13
Pihole systemd service
[Unit]
Description=Pi-Hole Podman Container
After=firewalld.service
[Service]
ExecStart=/usr/bin/podman run --name pihole -p 7053:53/tcp -p 7053:53/udp -p 7067:67/udp -p 7080:80/tcp -v /home/jkeam/dev/projects/pi-hole/podman/dnsmasq:/etc/pihole -v /home/jkeam/dev/projects/pi-hole/podman/pihole:/etc/dnsmasq.d -e TZ="America/New_York" -e WEBPASSWORD="awesomepassword" -e FTLCONF_LOCAL_IPV4="192.168.1.201" -e DHCP_ACTIVE=true -e DHCP_START="192.168.1.202" -e DHCP_END="192.168.1.254" -e DHCP_ROUTER="192.168.1.1" -e DHCP_rapid_commit=true --hostname pi -e VIRTUAL_HOST="pi" -e PROXY_LOCATION="pi" -e INTERFACE="tap0" --security-opt label=disable --cap-add=NET_ADMIN --cap-add=NET_RAW --cap-add=CAP_AUDIT_WRITE --net=slirp4netns:port_handler=slirp4netns --dns=127.0.0.1 --dns=1.1.1.1 --restart=always docker.io/pihole/pihole:latest
ExecStop=/usr/bin/podman stop -t 2 pihole
ExecStopPost=/usr/bin/podman rm pihole
[Install]
@jkeam
jkeam / openshift_ai_ingress.md
Last active August 20, 2024 03:33
OpenShift AI Ingress Certs

OpenShift AI Ingress

Introduction

Wonderful Diagram of how KServe works from the docs

  +----------------------+        +-----------------------+      +--------------------------+
  |Istio Virtual Service |        |Istio Virtual Service  |      | K8S Service              |
  |                      |        |                       |      |                          |
@jkeam
jkeam / create-read-only-servicemesh-user.md
Created May 16, 2024 04:23
Create read only service mesh user

Create Read Only Servicemesh User

  1. Create user named ossm-viewer using htpasswd

  2. Either make the user a cluster-reader

oc adm policy add-cluster-role-to-user cluster-reader ossm-viewer
  1. Or apply the following yaml
@jkeam
jkeam / ocp-api-demo-script.md
Last active February 14, 2024 23:08
OCP API Demo Script

Service Registry Script

API Designer

Link

Designer

Based off of this

@jkeam
jkeam / local-llama.md
Created January 23, 2024 18:43
Running Local Llama

Running Local Llama

Installation

I'm using a Mac, sooooooooooo these instructions are Apple-esque.

brew install ollama
@jkeam
jkeam / rosa-installation-readme.md
Last active January 23, 2024 16:36
Rosa Installation README

Rosa Installation Readme

First, I wanted to say our docs are great, so any of my notes here will just at best be as good -- but most likely worse than the real docs.

Docs

  1. Awesome Official Docs
  2. ROSA Workshop - Although a bit dated, still has lots of gotchas that are still applicable

Installation

@jkeam
jkeam / Dockerfile
Last active April 19, 2024 04:18
Dockerfile for Cookiecutter Django
FROM registry.access.redhat.com/ubi9/python-311:1-52.1712567218
# Build args mainly for asset compilation
ARG DJANGO_SECRET_KEY
ARG REDIS_URL
ARG DJANGO_ADMIN_URL
ARG SPARKPOST_API_KEY
ARG CARE_OFFICE_PASSWORD
ARG DJANGO_AWS_ACCESS_KEY_ID
ARG DJANGO_AWS_SECRET_ACCESS_KEY
@jkeam
jkeam / generate-secret-key-django.sh
Created January 3, 2024 21:46
Generate Django Secret Key
python manage.py shell
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())