Skip to content

Instantly share code, notes, and snippets.

View kincl's full-sized avatar
:fishsticks:
#fishsticks

Jason Kincl kincl

:fishsticks:
#fishsticks
View GitHub Profile
@kincl
kincl / 01-machineconfiguration.yaml
Last active April 16, 2025 01:12
machineconfig-multipath
# This only went GA for OpenShift in 4.17
#
# https://docs.openshift.com/container-platform/4.17/machine_configuration/machine-config-node-disruption.html
apiVersion: operator.openshift.io/v1
kind: MachineConfiguration
metadata:
name: cluster
namespace: openshift-machine-config-operator
spec:
nodeDisruptionPolicy:
@kincl
kincl / gist:18a65ddd6cf2b684d4c2cab407ac533b
Created March 12, 2025 16:30
Finding the pid limit with cgroupv2 and crio
# get the UID of the running pod and substitute dashes for underscores
POD_UID=$(crictl pods --name dns-default -o json | jq -r '.items[0].metadata.uid' | tr "-" "_")
# check the cgroup contents if it has resource requests:
systemd-cgls /kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod${POD_UID}.slice
# or if it doesn't :o
systemd-cgls /kubepods.slice/kubepods-besteffort.slice/kubepods-besteffort-pod${POD_UID}.slice
# check the pid max
cat /sys/fs/cgroup/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod${POD_UID}.slice/pids.max
@kincl
kincl / 01-README.md
Last active October 24, 2024 17:51
Debugging

Debugging

@kincl
kincl / gist:448ac949340d24135280a3dc316a452f
Created September 5, 2024 13:24
AWS CLI in OpenShift AI Workbench
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install -i /opt/app-root/share/aws-cli -b /opt/app-root/bin
aws s3 --endpoint-url $AWS_S3_ENDPOINT ls s3://$AWS_S3_BUCKET
@kincl
kincl / sriovnetwork.yaml
Created August 26, 2024 13:32
SRIOV Operator configs
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetwork
metadata:
name: sriovnetwork
namespace: openshift-sriov-network-operator
spec:
ipam: |
{
"type": "whereabouts",
"range": "172.20.133.0/24",
@kincl
kincl / ldap-sync-config.yaml
Created August 8, 2024 19:51
LDAPSyncConfig
kind: LDAPSyncConfig
apiVersion: v1
url: ldap://ad.example.com:389
insecure: true
bindDN: cn=admin,dc=example,dc=com
bindPassword:
value: "password"
rfc2307:
groupsQuery:
baseDN: "ou=groups,dc=example,dc=com"
@kincl
kincl / s3-like.py
Last active May 13, 2024 20:53
Using boto3 with RGW
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/list_objects.html
# https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-uploading-files.html
import os
import boto3
import botocore
s3 = boto3.client('s3', verify=False, region_name="default", endpoint_url=f"https://{os.environ['AWS_S3_ENDPOINT']}")
#s3.upload_file('test.txt', os.environ['AWS_S3_BUCKET'], 'test.txt')
# response = s3.list_buckets()
@kincl
kincl / nmstate.yaml
Last active February 17, 2024 21:22
NMState Snippets
interfaces:
- name: bond0
type: bond
state: up
ipv4:
address:
- ip: 192.168.126.30
prefix-length: 24
dhcp: false
enabled: true
@kincl
kincl / deployment.yaml
Last active November 30, 2023 17:56
simple-deployment
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test
spec:
rules:
- host: ingress.example.org
http:
paths:
- path: /
@kincl
kincl / default-net.xml
Last active November 29, 2023 23:33
libvirt-for-ocp
<network xmlns:dnsmasq='http://libvirt.org/schemas/network/dnsmasq/1.0'>
<name>default</name>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:b1:dd:cf'/>
<domain name='redhat.lab' localOnly='yes'/>